var SWA=typeof SWA==="undefined"?{}:SWA;
SWA.TNT=typeof SWA.TNT==="undefined"?{}:SWA.TNT;
SWA.TNT.toggles=[];
SWA.TNT.setToggle=function(a,b){if(!SWA.TNT.toggles[a]){SWA.TNT.createToggle(a)
}SWA.TNT.toggles[a].setValue(b);
if(document.getElementById("webappServerInformation")!=null){document.getElementById("BSUpsellLabelInfo").style.visibility="visible";
document.getElementById("UpsellInfo").innerHTML+=(a+": "+b+"</br>")
}};
SWA.TNT.getToggle=function(a){if(this.containsToggle(a)){return SWA.TNT.toggles[a].getValue()
}else{return
}};
SWA.TNT.containsToggle=function(a){if(SWA.TNT.toggles[a]){return true
}else{return false
}};
SWA.TNT.removeToggle=function(a){if(this.containsToggle(a)){return SWA.TNT.toggles[a]=null
}else{return
}};
SWA.TNT.createToggle=function(b,a){SWA.TNT.toggles[b]=new SWA.TNT.Toggle(b,a)
};
SWA.TNT.ToggleHiddenInput=function(a){var b=a.getHiddenInputName();
document.write('<input type="hidden" id="'+b+'" name="'+b+'" value="'+a.getValue()+'"/>');
return document.getElementById(b)
};
SWA.TNT.Toggle=function(b,a){this.name=b;
a=a?a:{};
this.options=a;
this.getValue=function(c){return this.value
};
this.setValue=function(c){this.value=c;
if(this.options.onSet){this.options.onSet.apply(this,[c])
}if(this.hiddenInput){this.hiddenInput.value=c
}};
this.getHiddenInputName=function(){function e(f){if(f.length){if(f.length==1){f=f.toUpperCase()
}else{f=f.substr(0,1).toUpperCase()+f.substr(1,f.length-1)
}}return f
}var d=this.name.split("_");
for(var c=0;
c<d.length;
c++){d[c]=e(d[c])
}return"toggle"+d.join("")
};
this.hiddenInput=new SWA.TNT.ToggleHiddenInput(this);
if(a.defaultValue){this.setValue(a.defaultValue)
}};
