function showXSLT(allXml,filename){var bro=$.browser;if(window.ActiveXObject){var xsl=new ActiveXObject("MSXML2.FreeThreadedDOMDocument");xsl.async=false;xsl.validateOnParse=false;xsl.load(filename);var xslTemplate=new ActiveXObject("MSXML2.XSLTemplate");xslTemplate.stylesheet=xsl;var xslProcessor=xslTemplate.createProcessor();xslProcessor.input=allXml;xslProcessor.transform();document.getElementById("divContent").innerHTML=xslProcessor.output;}else if(document.implementation&&document.implementation.createDocument){if(bro.mozilla){var xsl=document.implementation.createDocument("","",null);xsl.async=false;xsl.validateOnParse=false;xsl.load(filename);var xslProcessor=new XSLTProcessor();xslProcessor.importStylesheet(xsl);var result=xslProcessor.transformToDocument(allXml);var xmls=new XMLSerializer();document.getElementById("divContent").innerHTML=xmls.serializeToString(result);}else{var xmlhttp2=new window.XMLHttpRequest();xmlhttp2.open("GET",filename,false);xmlhttp2.send(null);xsldoc=xmlhttp2.responseXML;var xslProcessor=new XSLTProcessor();xslProcessor.importStylesheet(xsldoc);var result=xslProcessor.transformToDocument(allXml);var xmls=new XMLSerializer();document.getElementById("divContent").innerHTML=xmls.serializeToString(result);}}$("form").submit(function(){$("input:button[name='submit']").click();$("input:button[name='login']").click();return false;});}
function setCss(type,cssname){var csspath;if(type=="OM"){csspath="CSS_OM/"+cssname;}
else{csspath="CSS_OX/"+cssname;}$("head").append("<link href=\""+csspath+"\" rel=\"stylesheet\" type=\"text/css\">");}
function setTitle(){var model=getCookie("model");var type=getCookie("type");var nr=getCookie("nr");var lang=getCookie("language");var file;if(lang=="0"){file="zh.xml";}
else if(lang=="1"){file="en.xml";}
type=type.replace("(","");type=type.replace(")","");$.get(file,function(data){x=data;if(model=="OX"&&nr=="1"){document.title=$(data).find("pagetitle OX").text();}
else if(model=="OX"&&nr=="0"){document.title=$(data).find("pagetitle OXST").text();}
else if(model=="OM"&&nr=="1"){document.title=$(data).find("pagetitle OM").text();}
else if(model=="OM"&&nr=="0"){document.title=$(data).find("pagetitle OMST").text();}});}
function setVisible(){if(getCookie("model")=="OX"){$(".om").hide();$(".omnr").hide();$("img[src='load.gif']").parent().css("border-right","1px solid #E5E3E3");}else{$(".ox").hide();}if(getCookie("nr")=="0"){$(".nr").hide();$(".omnr").hide();}else{$(".st").hide();}if(getCookie("language")=="1"){$(".zh").hide();}else{$(".en").hide();}}
function setIFrameHeight(){if(document.documentElement.clientHeight<=120)
return;$("#body_frm_0").attr("height",document.documentElement.clientHeight-50);}
function clicklogout(allXml){var cookie=getCookie("cookie");var msg=$(allXml).find("jsmsg logout").text();if(confirm(msg)){$.get(curl+"/xml?method=gw.account.logout&cookie="+cookie+"&tmp="+Math.random(),function(data){if($(this).find("rsp").attr("stat")=="ok"){deleteCookie("admin");deleteCookie("more");window.open("index.htm","_top");}else{window.open("index.htm","_top");}});return true;}
else return false;}
var cookie=getCookie("cookie");function click980(allXml){var software=$(allXml).find("jsmsg restartSoft").text();var softwareFail=$(allXml).find("jsmsg restartSoftFail").text();if(confirm(software)){$.ajax({type:"POST",url:curl+'/xml?method=gw.app.reboot&cookie='+cookie+'&tmp='+Math.random(),dataType:"xml",error:function(xml){$(xml).find('Error').each(function(){var errortext=$(this).attr('msg');showmsg(errortext);});},success:function(xml){$(xml).find('rsp').each(function(){var stat=$(this).attr('stat');if(stat=="fail"){var errorcode=$(xml).find('Error').attr('code');if(errorcode=='5')
gotologin();else{alert(softwareFail);window.location.href("rebootsys.htm");}}
else{window.open("apprebootok.htm","upload");gotologin();}});}});return true;}
else
return false;}
function click990(allXml){var resys=$(allXml).find("jsmsg rebootSys").text();var resysFail=$(allXml).find("jsmsg rebootSysFail").text();if(confirm(resys)){$.ajax({type:"POST",url:curl+'/xml?method=gw.system.reboot&cookie='+cookie+'&tmp='+Math.random(),dataType:"xml",error:function(xml){$(xml).find('Error').each(function(){var errortext=$(this).attr('msg');showmsg(errortext);});},success:function(xml){$(xml).find('rsp').each(function(){var stat=$(this).attr('stat');if(stat=="fail"){var errorcode=$(xml).find('Error').attr('code');if(errorcode=='5')
gotologin();else
alert(resysFail);}
else
gotologin();});}});return true;}
else
return false;}
