﻿function MM_swapImgRestore()
{
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages()
{
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments;for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d)
{
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length){
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function openWin(n,u,w,h)
{
	var windowLeft = (window.screen.availWidth - w)/2;
	var windowTop = (window.screen.availHeight - h)/2;
	args = "left="+windowLeft+",top="+windowTop+",width="+w+",height="+h+",resizable=yes,scrollbars=yes,status=1";
	window.open(u,n,args);
}

function openWin(n,u,w,h)
{
	var windowLeft = (window.screen.availWidth - w)/2;
	var windowTop = (window.screen.availHeight - h)/2;
	args = "left="+windowLeft+",top="+windowTop+",width="+w+",height="+h+",status=yes,toolbar=no,menubar=no,location=no";
	window.open(u,n,args);
}

function $id(a)
{
	return document.getElementById(a);
}

function $name(a)
{
	return document.getElementsByTagName(a);
}

function setStatusText(statusText)
{
	window.status = unescape(statusText);
	window.defaultStatus = unescape(statusText);
}


function setStatusText(statusText)
{
	window.status = unescape(statusText);
	window.defaultStatus = unescape(statusText);
}

function $ID( strID )
{
	if(document.all && !window.opera)
	{
		return document.all[ strID ];
	}
	else
	{
		return document.getElementById(strID);
	}
}

function bottom1()
{
	try {
		$ID("bottom").style.top=(document.documentElement.clientHeight + document.documentElement.scrollTop - $ID("bottom").offsetHeight);
	}
	catch(e)
	{
		
	}
}

function Bottom()
{
	document.getElementById("bottom").style.top=(document.documentElement.scrollTop+document.documentElement.clientHeight-document.getElementById("bottom").offsetHeight)+"px";
}

function addEvent(obj, eventType, func, useCaption)
{
	if (!obj || !eventType || !func)
	{
		return false;
	}
	else if(obj.addEventListener)
	{
		obj.addEventListener(eventType, func, useCaption);
		return true;
	}
	else if(obj.attachEvent)
	{
		var retVal = obj.attachEvent("on"+eventType, func);
		return retVal;
	}
	else
	{
		return false;
	}
}

function ReadV()
{
	if(window.XMLHttpRequest)
	{
		if(!window.ActiveXObject)
		{
			return 'X';
		}
		else
		{
			return '2';
		}
	}
	else
	{
		return '1';
	}
}

function getPageSize()
{
	var xScroll, yScroll;
	if (window.innerHeight && window.scrollMaxY)
	{
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	}
 	else if (document.body.scrollHeight > document.body.offsetHeight)
	{
		xScroll = document.body.scrollWidth;yScroll = document.body.scrollHeight;
	}
 	else 
	{
		xScroll = document.body.offsetWidth;yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) 
	{
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	}
 	else if (document.documentElement && document.documentElement.clientHeight)
	{
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	}
 	else if (document.body) 
	{
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}
	
	if(yScroll < windowHeight)
	{
		pageHeight = windowHeight;
	}
 	else 
	{
		pageHeight = yScroll;
	}
	
	if(xScroll < windowWidth)
	{
		pageWidth = windowWidth;
	}
 	else 
	{
		pageWidth = xScroll;
	}
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
	return arrayPageSize;
}

function open_S_Win(u)
{
	var w = window.screen.availWidth;
	var h = window.screen.availHeight;
	var a='left='+0+',top='+0+',width='+w+',height='+h+'channelmode=1,toolbar=1,location=1,directories=yes,status=1,menubar=1,scrollbars=1,resizable=1,alwaysRaised=yes,fullscreen=no';
	//;
	var Sc=window.open(u,'S_cless_G',a);
	Sc.focus();
}

function none()
{
	for (var i = 0; i < arguments.length; i++)
	{
		if(document.getElementById(arguments[i]))
		{
			document.getElementById(arguments[i]).style.display="none";
		}
	}
}

function block()
{
	for (var i = 0; i < arguments.length; i++)
	{
		if(document.getElementById(arguments[i]))
		{
			document.getElementById(arguments[i]).style.display="block";
		}
	}
}

function bottom()
{
	document.getElementById("bottom").style.top=(document.documentElement.scrollTop+document.documentElement.clientHeight-document.getElementById("bottom").offsetHeight)+"px";
}

function TVC_content()
{
	var arrayPageSize=getPageSize();
	document.getElementById("TVC_content").style.top=(document.documentElement.scrollTop+document.documentElement.clientHeight-parseInt(arrayPageSize[3]/2))+"px";
}

function init()
{
	if('1' == ReadV())
	{
		window.onscroll=function ()
		{
			bottom();
		}
	//;
		window.onresize=function ()
		{
			bottom();
		}
	//;
	}

	MM_preloadImages('');
}


function showSubMenu(objId,action,MenuNav,isMenuId)
{
	var bgValueOn;
	var bgValueOff;
	switch(isMenuId)
	{
		case "3":
			bgValueOn = "-148px -29px";
			bgValueOff = "-148px 0px";
			document.getElementById('subMenu4').style.display="none";
			if(isNavId == '4')
			{
				document.getElementById('Menu_nav4Btn').style.backgroundPosition = '-241px -58px';
			}
			else
			{
				document.getElementById('Menu_nav4Btn').style.backgroundPosition = '-241px 0px';
			}
		break;
		case "4":
			bgValueOn = "-241px -29px";
			bgValueOff = "-241px 0px";
			document.getElementById('subMenu3').style.display="none";
			if(isNavId == '3')
			{
				document.getElementById('Menu_nav3Btn').style.backgroundPosition = '-148px -58px';
			}
			else
			{
				document.getElementById('Menu_nav3Btn').style.backgroundPosition = '-148px 0px';
			}
			break;
		case "7":
			bgValueOn = "-451px -29px";
			bgValueOff = "-451px 0px";
			break;			
	}
	if(action=="on")
	{
		document.getElementById(MenuNav).style.backgroundPosition = bgValueOn;
		document.getElementById(objId).style.display="block";	
		clearTimeout(ttt3);
	}
	else
	{
		ttt3 = setTimeout('resetMainMenu("'+objId+'","'+MenuNav+'","'+isMenuId+'","'+bgValueOff+'")',50);
	}
}

function resetMainMenu(objId,MenuNav,isMenuId,bgValueOff)
{
	var bgValue;
	switch(isMenuId)
	{
		case "3":
			bgValue = "-148px -58px";
			break;
		case "4":
			bgValue = "-241px -58px";
			break;
		case "7":
			bgValue = "-451px -58px";
			break;			
	}
	document.getElementById(objId).style.display="none";
	if(isNavId != isMenuId)
	{
		document.getElementById(MenuNav).style.backgroundPosition = bgValueOff;
	}
	else
	{
		document.getElementById(MenuNav).style.backgroundPosition = bgValue;
	}
}

var isNavId,ttt3

function init(){
}
if (document.all){ 
	window.attachEvent('onload',init)//对于IE 
} 
else{ 
	window.addEventListener('load',init,false);//对于FireFox 
}


function $(a){return document.getElementById(a);}

function none(){for (var i=0;i < arguments.length; i++){if($(arguments[i])){$(arguments[i]).style.display="none";}}}function block(){for (var i=0;i < arguments.length; i++){if($(arguments[i])){$(arguments[i]).style.display="block";}}}