var ie=navigator.userAgent
var k=navigator.userAgent.indexOf('MSIE')
var ver=parseInt( ie.substring(k+5, ie.indexOf('.',k) ))

if(ver>=4 || isNaN(ver)) {
nav0=new Image();	nav0.src=''
temp=new Image();
}

function MOver(nn) {
if(ver>=4 || isNaN(ver)) {
	temp.src=nn.src;
	eval("nn.src="+nn.name+".src")
	}
}

function MOut(nn) {
if(ver>=4 || isNaN(ver)) {
	nn.src=temp.src;
	}
}

function WinOpen(name,w,h) {
if(k>0) { h>document.body.clientHeight ? h2=document.body.clientHeight : h2=h+20; }
else { h>document.body.clientHeight-60 ? h2=document.body.clientHeight-60 : h2=h-30; }
w>screen.width-18 ? w2=screen.width-80 : w2=w+30;
eval("window.open('/winopen.shtml?"+name+"','','status=no, location=yes, toolbar=no, resizable=1, scrollbars=1, top=30, width="+w2+", height="+h2+", left="+(screen.width/2-w2/2)+"');");
}

function Toggle(div) {
div.style.display = (div.style.display == 'none')?'block':'none';
}

function verScroll(dir, spd, loop) { 

loop = true; 
direction = "up"; 
speed = 10; 
scrolltimer = null; 
if (document.layers) { 
var page = eval(document.catautolist); 
} 
else { 
if (document.getElementById) { 
var page= eval("document.getElementById('catautolist').style"); 
} 
else { 
if (document.all) { 
var page = eval(document.all.catautolist.style); 
} 
} 
} 
direction = dir; 
speed = parseInt(spd); 

var y_pos = parseInt(page.left); 
//alert(catautolist.style.height);
if (loop == true) { 
if (direction == "left") { 
	if (direction == "left" && y_pos > -200) { page.left = (y_pos - (speed)); } 
} else { 
	if (direction == "right" && y_pos < 0) { page.left = (y_pos + (speed)); } 
	else { 
		if (direction == "top") { page.left = 0; } 
	} 
} 
window.status=y_pos;
scrolltimer = setTimeout("verScroll(direction,speed)", 10); 
} 

} 

function stopScroll() { 
loop = false; 
clearTimeout(scrolltimer); 
}

/* --------------------------------------- */

function flashEnable(version) {
	if (!isFlash()) return false;
	if (navigator.userAgent.indexOf("MSIE") != -1 &&
		navigator.userAgent.indexOf("Windows") != -1 &&
		navigator.userAgent.indexOf("Opera") == -1)
		return ieFlashDetect(version);
	return flashDetect(version);
}

function ieFlashDetect(version) {
	try {
        flash = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.' + version);
    } catch (err) {
        return false;
    }
    return flash;
}

function flashDetect(version) {
	if (navigator.plugins['Shockwave Flash']) {
		plugin_descr = navigator.plugins['Shockwave Flash'].description;
		return (parseInt(plugin_descr.substring(plugin_descr.indexOf(".") - 1)) >= version)
	}
	return false
}

function isFlash() {
	return !(navigator.userAgent.indexOf("iCab") != -1 || navigator.userAgent.indexOf("MSIE 3") != -1);
}

function open_picture(url,w,h) {
	max_width = 800;
	max_height = 600;
	if (window.screen) {
		max_width = window.screen.width - 20;
		max_height = window.screen.height - 53;
	}
	win_w = w + 16;
	win_h = h + 4;
	if (win_w > max_width)
		win_w = max_width;
	if (win_h > max_height)
		win_h = max_height;

	win = window.open("", "", "status=1, resizable=1, toolbar=1, scrollbars=1, width="+win_w+", height="+win_h);
	win.document.write('<html><body leftmargin=0 rightmargin=0 topmargin=0 marginwidth=0 marginheight=0><img src="' +url+'" width='+w+' height='+h+'"></body></html>');
	win.focus();
	return false;
}