var Doc = {
    "g" :  function(objid){
    	if (typeof(objid) != "string" || objid == "") return null;
    	if (document.getElementById) return document.getElementById(objid);
    	if (document.all) return document.all(objid);
    	try {return eval(objid);} catch(e){ return null;}
    },
    "s" : function(objid,html){
        var obj = document.getElementById(objid);
        obj.innerHTML = html;
    }
}
var Win = {
    "open" : function(url,width,height,menubar,toolbar,location,status,scrollbars,resizable,backFun){
        if(menubar == null) menubar = "yes";
        if(scrollbars == null) scrollbars = "yes";
        if(toolbar == null) toolbar = "yes";
        if(resizable == null) resizable = "yes";
        x = parseInt((window.screen.width - width) / 2.0);
		y = parseInt((window.screen.height - height) / 2.0) - 60;
        var win = window.open(url, "", "top=" + y + ",left=" + x + ",menubar=" + menubar + ",location=" + location + ",status=" + status + ",scrollbars=" + scrollbars + ",toolbar=" + toolbar + ",dialog=yes,minimizable=yes" + ",modal=yes,width=" + width + ",height=" + height + ",resizable=" + resizable);
        if(backFun != null)
            window.BackValue = backFun;
    },
    "customDialog" : function(content,w,h,callBack){
        var winobj = Dialog.custom(content,{windowParameters: {width:w, height:h},ok:callBack});
    }
}
String.prototype.trim = function()
{
	return this.replace(/(^\s*)|(\s*$)/g, "");
}

//模仿语言包式的简繁转换功能插件！

var Default_isFT = 0		//默认是否繁体，0-简体，1-繁体

var StranIt_Delay = 50 //翻译延时毫秒（设这个的目的是让网页先流畅的显现出来）


//－－－－－－－代码开始，以下别改－－－－－－－
//转换文本
function StranText(txt,toFT,chgTxt)
{
	if(txt==""||txt==null)return ""
	toFT=toFT==null?BodyIsFt:toFT
	if(chgTxt)txt=txt.replace((toFT?"简":"繁"),(toFT?"繁":"简"))
	if(toFT){return Traditionalized(txt)}
	else {return Simplized(txt)}
}
//转换对象，使用递归，逐层剥到文本
function StranBody(fobj)
{
	if(typeof(fobj)=="object"){var obj=fobj.childNodes}
	else 
	{
		var tmptxt=StranLink_Obj.innerHTML.toString()
		if(tmptxt.indexOf("简")<0)
		{
			BodyIsFt=1
			StranLink_Obj.innerHTML=StranText(tmptxt,0,1)
			StranLink.title=StranText(StranLink.title,0,1)
		}
		else
		{
			BodyIsFt=0
			StranLink_Obj.innerHTML=StranText(tmptxt,1,1)
			StranLink.title=StranText(StranLink.title,1,1)
		}
		setCookie(JF_cn,BodyIsFt,7)
		var obj=document.body.childNodes
	}
	for(var i=0;i<obj.length;i++)
	{
		var OO=obj.item(i)
		if("||BR|HR|TEXTAREA|".indexOf("|"+OO.tagName+"|")>0||OO==StranLink_Obj)continue;
		if(OO.title!=""&&OO.title!=null)OO.title=StranText(OO.title);
		if(OO.alt!=""&&OO.alt!=null)OO.alt=StranText(OO.alt);
		if(OO.tagName=="INPUT"&&OO.value!=""&&OO.type!="text"&&OO.type!="hidden")OO.value=StranText(OO.value);
		if(OO.nodeType==3){OO.data=StranText(OO.data)}
		else StranBody(OO)
	}
}