//*********************************************************
//            上海鸿禧科技有限公司 版权所有
//      ◎Hongxi Corporation. All rights reserved.
//*********************************************************
window.onerror=function(){return true;}//禁止错误提示

var intValue=0;
var intTitle="";
if (!document.all)
window.addEventListener('load',function(){document.readyState='complete'},false)   
//*********************************************************
//   简/繁体转换模块
//   通过简体s和繁体t字库对应转换HTML
//   模块开始
//*********************************************************
	document.write("<script language='javascript' src='\/Script\/language.js'><\/script>");

     String.prototype.s2t=function ()
    {
        var k='';
        for(var i=0;i<this.length;i++) k+=(s.indexOf(this.charAt(i))==-1)?this.charAt(i):t.charAt(s.indexOf(this.charAt(i)))
        return k;
    }
    String.prototype.t2s=function ()
    {
        var k='';
        for(var i=0;i<this.length;i++) k+=(t.indexOf(this.charAt(i))==-1)?this.charAt(i):s.charAt(t.indexOf(this.charAt(i)))
        return k;
    }
    function s2t()
    {
		if (document.readyState!="complete")
		{
			setTimeout("s2t();",200);
			return false;
		}
        if (intValue==0)
        {
			StranBody();
			if (document.getElementById('gb2big')!=null)
			{
				document.getElementById('gb2big').src='/images/gb.gif';
				document.getElementById('gb2big').alt='转换到简体';
			}
			if (document.getElementById('gb2big2')!=null)
			{
				document.getElementById('gb2big2').src='/images/gb.gif';
				document.getElementById('gb2big2').alt='转换到简体';
			}
            intValue=1;
        }
        else
        {
			StranBody();
			if (document.getElementById('gb2big')!=null)
			{
				document.getElementById('gb2big').src='/images/big5.gif';
				document.getElementById('gb2big').alt='转换到繁体';
			}
			if (document.getElementById('gb2big2')!=null)
			{
				document.getElementById('gb2big2').src='/images/big5.gif';
				document.getElementById('gb2big2').alt='转换到繁体';
			}
            intValue=0;
        }
    }
//*********************************************************
//   简/繁体转换模块
//   模块结束
//*********************************************************

	
//*********************************************************
//   动态变换样式表模块
//   通过切换LINK中的SRC文件实现动态样式表切换
//*********************************************************
function setActiveStyleSheet(title){
	var obj=document.getElementsByTagName("link")[0];
	if (obj!=null)
	{
		if(document.all)
		{
		objBody.style.filter="blendtrans(duration=3)";
		objBody.filters[0].apply();
				
		}
		obj.href="css/"+title+".css";
		if (title=="style100")
		{
			document.getElementById("top01").style.display='none';
			document.getElementById("top02").style.display='';
			createCookie("hongxistyle_index", title, 365); 
		}
		else
		{
			try
			{
				document.getElementById("top01").style.display='';
				document.getElementById("top02").style.display='none'; 
			}
			catch (e)
			{
			}
			createCookie("hongxistyle", title, 365); 
			createCookie("hongxistyle_index", "", 365); 
		}
		if(document.all)
		{
			objBody.filters[0].play();
		}
	}
}
function setActiveStyleSheetChild(title){
	var obj=document.getElementsByTagName("link")[0];
	//window.objBody=document.getElementsByTagName("body")[0];
	if (obj!=null)
	{
		if(document.all)
		{
			document.body.style.filter="blendtrans(duration=3)";
			document.body.filters[0].apply();
				
		}
		/*else
		{
		 window.x=1;
		 window.ppID=setInterval(function(){setOpacity("-",title,obj)},10);
		 
		}*/
		
		obj.href="../css/"+title+".css";	
		if (title=="style100")
		{
			document.getElementById("top01").style.display='none';
			document.getElementById("top02").style.display='';
			createCookie("hongxistyle_index", title, 365); 
		}
		else
		{
			try
			{
				document.getElementById("top01").style.display='';
				document.getElementById("top02").style.display='none'; 
			}
			catch (e)
			{
			}
			createCookie("hongxistyle", title, 365); 
			createCookie("hongxistyle_index", "", 365); 
		}
		if(document.all)
		{
			document.body.filters[0].play();
		}

	}
}

//---------------------------------------------
//	设置透明度
//-----------------------------------------------
function setOpacity(method,title,obj)
{
		//x=window.x
		if(method=="-")
		{
			if(x>=0.2)
			{
				x-=0.05
				
			}else{clearInterval(ppID);obj.href="../css/"+title+".css";window.ppID2=setInterval(function(){setOpacity("+",title,obj)},10)}
		}
		else if(method=="+")
		{
			if(x<=0.99)
			{
				x+=0.05
				
			}else{clearInterval(ppID2);}
		}
		objBody.style.opacity=x

}

//*********************************************************
//   创建Cookie
//   记录用户选择的样式表变量
//*********************************************************
function createCookie(nm,val,y){
	var exp="";
	if(y){ 
		var dt=new Date(); 
		dt.setTime(dt.getTime()+(y*86400000)); 
		exp="; expires="+dt.toGMTString();
	} 
	document.cookie=nm+"="+escape(val)+exp+";path=/"; 
}
function readCookie(nm){ 
	var m=""; 
	if(window.RegExp){ 
		var re=new RegExp(";\\s*"+nm+"=([^;]*)","i"); 
		m=re.exec(';'+document.cookie); 
	} 
	return(m?unescape(m[1]):"");
}
//*********************************************************
//   动态变换样式表模块
//   模块结束
//*********************************************************


