document.write(""); var submitFun = 0; var submitFunArray = new Array(); var onloadFun = 0; var onloadFunArray = new Array(); /* It will compare 2 array is the same or different. */ Array.prototype.compare = function(testArr) { if (this.length != testArr.length) { return false; } for (var i = 0; i < testArr.length; i++) { if (this[i].compare) { if (!this[i].compare(testArr[i])) { return false; } } if (this[i] !== testArr[i]) { return false; } } return true; } /* htmlContent is HTML file id. When user initial the module. It must to be set value. */ function ShowItem(A,htmlContent) { document.getElementById(htmlContent).innerHTML += A.join(''); } function CBall(A) { A[A.length] = "
"; return A; } function CStrWidth(A,str,divclass,width) { if( width == "") { str += " "; } A[A.length] = "
" + str + "
"; return A; } function CLink(A,str,divclass,link,width,height) { A[A.length] = "
" + str + "
"; return A; } function CSpace(A, width) { A[A.length] = "
"; return A; } function CText(A,webName,size,maxlength,txtfunc) { A[A.length] = "
"; return A; } function CPassword(A,webName,size,maxlength,func) { A[A.length] = "
"; return A; } function CRadio(A,webName,webValue,clickFun) { var margin = 3; if( getOs().indexOf("IE") >= 0 ) { if(langCoolie == "tw") { margin = -3; }else{ margin = 0; } } A[A.length] = "
"; return A; } function CCheckbox(A,webName,webValue,clickFun) { var margin = 6; if( getOs().indexOf("IE") >= 0 ) { margin = 2; } A[A.length] = "
"; return A; } function CSelect(A,webName,size,style,func) { A[A.length] = "
"; return A; } function CButton(A,webName,webValue,width,clickFun) { if(width == 0) { width = webValue.length * fontLen+20; } A[A.length] = "
"; return A; } function CSubmit(A,webName,webValue,width,clickFun) { if(width == 0) { width = webValue.length * 8+20; } A[A.length] = "
"; return A; } function CSubmitoName(A,webId,webValue,width,clickFun) { if(width == 0) { width = webValue.length * fontLen+20; } A[A.length] = "
"; return A; } function CFileUpload(A,webName) { A[A.length] = "
"; return A; } function CTextarea(A,webName,rows,cols,func) { A[A.length] = "
"; return A; } function CHostname(A,webName,func) { A[A.length] = "
"; return A; } function CImage(A,id,title,style,path) { A[A.length] = "
"; return A; } function CGroup(A,name,func,status) { switch(status) { case "s": //start A[A.length] = "
"; return A; case "e": //end A[A.length] = "
"; return A; } } /* It is a template function. It will add a header or a end in the item block. */ function T(A) { switch(arguments[1]) { case 0: if(arguments[2] != undefined) { A[A.length] = "
"; break; }else{ A[A.length] = "
"; break; } case 1: A[A.length] = "
"; break; case 2: A[A.length] = "
"; break; case 3: A[A.length] = "
"; break; case 4: if( getOs().indexOf("IE") >= 0 ) { arguments[3] += 13; }else{ arguments[3] += 15; } //A[A.length] = "
"; break; A[A.length] = "
"; break; } return A; } function OnSubmitCancelButton(ok,cancel) { document.getElementById(ok).value = loadLangString("L_Save",false); document.getElementById(cancel).value = loadLangString("L_Cancel",false); document.getElementById(ok).className='btn'; document.getElementById(cancel).className='btn'; document.getElementById(ok).onclick = function OkF(){ OnSubmit(); }; document.getElementById(cancel).onclick = function CancelF(){ JavaScript:location.reload(true); }; } function DoInitial() { var i = 0; for( i = 0 ; i < onloadFun ; i ++) { onloadFunArray[i](); } } function SetBgColor(idx,color) { if( EID(idx) != undefined) { EID(idx).style.backgroundColor = color; } } function SetColor() { var vLayout = GetQueryVariable('Layout.OwnBGColor'); var idx = new Array("topBox","leftBox","rightBox","middleBox","header","middleDown"); var i = 0; color = new Array(); // color define in profile switch(vLayout) { default: case "0": color = color0; break; case "1": color = color1; break; case "2": color = color2; break; case "3": color = color3; break; } for( i = 0; i < 6; i++) { SetBgColor(idx[i], color[i]); } } function CCornor() { if(FixedStyle == "yes") { if(EID("header")==undefined) { SetBgColor("topBox", def_topBox); SetBgColor("leftBox", def_leftBox); SetBgColor("middleBox", def_middleBox); SetBgColor("middleDown", def_middleDown); } }else{ SetColor(); } topSettings = { tl: { radius: 15 }, tr: { radius: 15 }, bl: { radius: 0 }, br: { radius: 0 }, antiAlias: true, autoPad: true, validTags: ["div"] } leftSettings = { tl: { radius: 0 }, tr: { radius: 0 }, bl: { radius: 15 }, br: { radius: 0 }, antiAlias: true, autoPad: true, validTags: ["div"] } rightSettings = { tl: { radius: 0 }, tr: { radius: 0 }, bl: { radius: 0 }, br: { radius: 15 }, antiAlias: true, autoPad: true, validTags: ["div"] } if( EID("topBox") != undefined ) $('.topBox').corner(topSettings); if( EID("leftBox") != undefined ) $('.leftBox').corner(leftSettings); if( EID("rightBox") != undefined ) $('.rightBox').corner(rightSettings); if( EID("middleDown") != undefined ) $('.middleDown').corner(rightSettings); } function OnSubmit() { var cgi='/cgi-bin/admin/param?action=update'; var cgitmp = ""; var i = 0; for( i = 0 ; i < submitFun ; i ++) { cgitmp = submitFunArray[i](); if(cgitmp == "abort"){ return; }else if(cgitmp == undefined){ alert("Set param undefined. " + i); return; }else if( cgitmp != "" ){ cgi += eval(cgitmp); } } if(cgi != "/cgi-bin/admin/param?action=update" ) { if(UpdateParam(cgi) == false) { return; } if(reloadPage==true) { window.location.reload(); } }else{ alert(loadLangString("L_ApplySuccess",false)); } }