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] = "
"; 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));
}
}