function Base(a,b,c){this.aLoadedImages=[];this.oPath=a;this.lang=b;this.companyID="string"==typeof c?c:"0";this.ua=null;this.init()}
Base.prototype.init=function(){this.ua={sUserAgent:navigator.userAgent.toLowerCase()};this.ua.bIsOpera=-1<this.ua.sUserAgent.indexOf("opera");this.ua.bIsSafari=-1<this.ua.sUserAgent.indexOf("safari");this.ua.bIsGecko=!this.ua.bIsOpera&&!this.ua.bIsSafari&&-1<this.ua.sUserAgent.indexOf("gecko");this.ua.bIsIE=!this.ua.bIsOpera&&-1<this.ua.sUserAgent.indexOf("msie");this.ua.bIsIE6=this.ua.bIsIE&&(-1<this.ua.sUserAgent.indexOf("msie 5")||-1<this.ua.sUserAgent.indexOf("msie 6"));this.ua.bIsIE7=this.ua.bIsIE&&
-1<this.ua.sUserAgent.indexOf("msie 7");this.ua.bIsChrome=-1<this.ua.sUserAgent.indexOf("chrome/");if(!window.XMLHttpRequest&&window.ActiveXObject)window.XMLHttpRequest=function(){return new ActiveXObject(-1<oBase.ua.sUserAgent.indexOf("MSIE 5")?"Microsoft.XMLHTTP":"MSXML2.XMLHTTP")};if(this.supportsXMLHTTP()&&-1==document.cookie.indexOf("xmlhttp="))document.cookie="xmlhttp=1; path=/; domain="+this.oPath.cookieURL};
Base.prototype.supportsXMLHTTP=function(){return!window.XMLHttpRequest||"opera"in window&&!("setRequestHeader"in new XMLHttpRequest)?!1:!0};Base.prototype.loadImage=function(a){if(!this.aLoadedImages[a])this.aLoadedImages[a]=new Image,this.aLoadedImages[a].src=a;return this.aLoadedImages[a]};
Base.prototype.copyAddress=function(a,b){document.getElementById(b+"Address").value=document.getElementById(a+"Address").value;document.getElementById(b+"Zipcode").value=document.getElementById(a+"Zipcode").value;document.getElementById(b+"City").value=document.getElementById(a+"City").value;document.getElementById(b+"Country").value=document.getElementById(a+"Country").value};Base.prototype.redirect=function(a){document.location=a;return!1};
Base.prototype.setInnerHTML=function(a,b){if("innerHTML"in a)a.innerHTML=b;else{var c=document.createRange();c.selectNodeContents(a);c.deleteContents();element.appendChild(c.createContextualFragment(b))}};
Base.prototype.getStyle=function(a,b){if(document.defaultView&&document.defaultView.getComputedStyle){var c=null,d=document.defaultView.getComputedStyle(a,"");d&&(c=d[b]);return a.style[b]||c}if(document.documentElement.currentStyle&&oBase.ua.bIsIE){if("opacity"==b){c=100;try{c=a.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(e){try{c=a.filters("alpha").opacity}catch(f){}}return c/100}c=a.currentStyle?a.currentStyle[b]:null;return a.style[b]||c}return a.style[b]};
Base.prototype.setStyle=function(a,b,c){if(oBase.ua.bIsIE)if("opacity"==b){if("filter"in a.style&&(a.style.filter="alpha(opacity="+100*c+")",!a.currentStyle||!a.currentStyle.hasLayout))a.style.zoom=1}else a.style[b]=c;else a.style[b]=c};
Base.prototype.isAncestor=function(a,b){if(a.contains&&!oBase.ua.bIsSafari)return a.contains(b);if(a.compareDocumentPosition)return!!(a.compareDocumentPosition(b)&16);for(var c=b.parentNode;c;){if(c==a)return!0;if(!c.tagName||"HTML"==c.tagName.toUpperCase())break;c=c.parentNode}return!1};
Base.prototype.getPos=function(a){if(null==a.parentNode||null==a.offsetParent||"none"==oBase.getStyle(a,"display"))return!1;var b=null,c={x:0,y:0};if(a.getBoundingClientRect){var b=a.getBoundingClientRect(),d=document;if(!oBase.isAncestor(document.documentElement,a)&&parent.document!=document&&(d=parent.document,!oBase.isAncestor(d.documentElement,a)))return!1;a=Math.max(d.documentElement.scrollTop,d.body.scrollTop);d=Math.max(d.documentElement.scrollLeft,d.body.scrollLeft);c.x=Math.ceil(b.left)+
d;c.y=Math.ceil(b.top)+a;return c}c.x=a.offsetLeft;c.y=a.offsetTop;b=a.offsetParent;if(b!=a)for(;b;)c.x+=b.offsetLeft,c.y+=b.offsetTop,b=b.offsetParent;oBase.ua.bIsSafari&&"absolute"==oBase.getStyle(a,"position")&&(c.x-=document.body.offsetLeft,c.y-=document.body.offsetTop);for(b=a.parentNode?a.parentNode:null;b&&"BODY"!=b.tagName.toUpperCase()&&"HTML"!=b.tagName.toUpperCase();)"inline"!=oBase.getStyle(b,"display")&&(c.x-=b.scrollLeft,c.y-=b.scrollTop),b=b.parentNode?b.parentNode:null;return c};
Base.prototype.setPos=function(a,b){var c=oBase.getStyle(a,"position");"static"==c&&(this.setStyle(a,"position","relative"),c="relative");var d=oBase.getPos(a);if(!1==d)return!1;var e=parseInt(oBase.getStyle(a,"left"),10),f=parseInt(oBase.getStyle(a,"top"),10);isNaN(e)&&(e="relative"==c?0:a.offsetLeft);isNaN(f)&&(f="relative"==c?0:a.offsetTop);if(null!==b.x)a.style.left=b.x-d.x+e+"px";if(null!==b.y)a.style.top=b.y-d.y+f+"px";return!0};
Base.prototype.getXMLDocument=function(a,b){if(!window.XMLHttpRequest)return null;var c=new XMLHttpRequest,d="undefined"!=typeof b,e=this;if(d)c.onreadystatechange=function(){if(4==c.readyState)b.call?b.call(e,200==c.status&&null!=c.responseXML?c.responseXML:!1):(e.tmpMethod=b,e.tmpMethod(200==c.status&&null!=c.responseXML?c.responseXML:!1),delete e.tmpMethod)};c.open("GET",a+"&rand="+parseInt(99999999*Math.random()),d);c.send(null);return c};
Base.prototype.sendXMLDocument=function(a,b,c,d){if(!window.XMLHttpRequest)return!1;var e=new window.XMLHttpRequest;if("undefined"!=typeof c&&null!=c)e.onreadystatechange=function(){4==e.readyState&&(null!=e.responseXML&&200==e.status?c(e.responseXML):c(!1))};e.open("POST",a,"undefined"==typeof d?!0:d);"setRequestHeader"in e&&e.setRequestHeader("Content-Type","application/x-www-form-urlencoded");e.send(b);return!0};
Base.prototype.getPostXMLDocument=function(a,b,c,d){if(!window.XMLHttpRequest)return!1;var e=new window.XMLHttpRequest,f=this;if("undefined"!=typeof c&&null!=c)e.onreadystatechange=function(){if(4==e.readyState)null!=e.responseXML&&200==e.status?c.call(f,e.responseXML):(f.tmpMethod=c,f.tmpMethod(null!=e.responseXML&&200==e.status?e.responseXML:!1),delete f.tmpMethod,c(!1))};e.open("POST",a,"undefined"==typeof d?!0:d);"setRequestHeader"in e&&e.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
e.send(b);return!0};Base.prototype.in_array=function(a,b){for(var c=0,d=b.length;c<d;c++)if(a==b[c])return!0;return!1};Base.prototype.addClass=function(a,b){if(!("className"in a))return!1;if(-1==a.className.indexOf(b))return a.className+=" "+b,!0;for(var c=""==a.className?[]:a.className.split(/ /g),d=0,e=c.length;d<e;d++)if(c[d]==b)return!0;c[c.length]=b;a.className=c.join(" ");return!0};
Base.prototype.removeClass=function(a,b){if(!("className"in a)||""==a.className||-1==a.className.indexOf(b))return!1;for(var c=a.className.split(/ /g),d=0,e=c.length;d<e;d++)c[d]==b&&delete c[d];a.className=c.join(" ");return!0};
Base.prototype.confirmAndGo=function(a,b,c,d){this.sConfirmRedirect=a;this.oCommonDialog=new CommonDialog({sSelf:"oBase.oCommonDialog",sConfirmation:b.replace(/\\n/g,"<br />").replace(/\\r/g,""),sTitle:"undefined"==typeof c||null==c?-1==document.title.indexOf(" - ")?document.title:document.title.substr(0,document.title.indexOf(" - ")):c,sType:"confirm",fCallback:"undefined"==typeof d?"oBase.confirmAndGoDone":d});return!1};Base.prototype.confirmAndGoDone=function(a){if(!0==a)location.href=this.sConfirmRedirect};
Base.prototype.confirmAndSubmit=function(a,b,c,d,e){this.oConfirmForm=a;this.oConfirmFormExtraControl=d;this.oCommonDialog=new CommonDialog({sSelf:"oBase.oCommonDialog",sConfirmation:b.replace(/\\n/g,"<br />").replace(/\\r/g,""),sTitle:"undefined"==typeof c||null==c?-1==document.title.indexOf(" - ")?document.title:document.title.substr(0,document.title.indexOf(" - ")):c,sType:"confirm",fCallback:"undefined"==typeof e?"oBase.confirmAndSubmitDone":e});return!1};
Base.prototype.confirmAndSubmitDone=function(a){if("object"==typeof this.oConfirmFormExtraControl&&null!=this.oConfirmFormExtraControl){var b=document.createElement("input");b.setAttribute("type","hidden");b.setAttribute("name",this.oConfirmFormExtraControl.name);b.setAttribute("value",this.oConfirmFormExtraControl.value);this.oConfirmForm.appendChild(b);this.oConfirmFormExtraControl=null}!0==a&&this.oConfirmForm.submit()};
Base.prototype.alert=function(a,b,c){this.oCommonDialog=new CommonDialog({sSelf:"oBase.oCommonDialog",sAlert:a.replace(/\\n/g,"<br />").replace(/\\r/g,""),sTitle:"undefined"==typeof b?-1==document.title.indexOf(" - ")?document.title:document.title.substr(0,document.title.indexOf(" - ")):b,sType:"alert",bExtended:"undefined"==typeof c?!1:c});return!1};
Base.prototype.includeJS=function(a,b){var c=b.createElement("script");c.setAttribute("language","javascript");c.setAttribute("type","text/javascript");c.setAttribute("src",a);b.getElementsByTagName("head").item(0).appendChild(c)};
Base.prototype.changeSelection=function(a){if("onselectstart"in document)document.onselectstart=a?null:new Function("return false");else if("MozUserSelect"in document.body.style)document.body.style.MozUserSelect=a?"text":"none";else if("KhtmlUserSelect"in document.body.style)document.body.style.KhtmlUserSelect=a?"text":"none";else if("UserSelect"in document.body.style)document.body.style.UserSelect=a?"text":"none"};Base.prototype.dummy=function(){};
String.prototype.htmlspecialchars=function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")};
String.prototype.php_to8bit=function(){if("UTF-8"==smf_charset)var a,b="";for(var c=0,d=this.length;c<d;c++)a=this.charCodeAt(c),b=128>a?b+String.fromCharCode(a):2048>a?b+(String.fromCharCode(192|a>>6)+String.fromCharCode(128|a&63)):65536>a?b+(String.fromCharCode(224|a>>12)+String.fromCharCode(128|a>>6&63)+String.fromCharCode(128|a&63)):b+(String.fromCharCode(240|a>>18)+String.fromCharCode(128|a>>12&63)+String.fromCharCode(128|a>>6&63)+String.fromCharCode(128|a&63));return b};
String.prototype.preg_quote=function(){return this.replace(/([\/\.\*\+\?\|\(\)\[\]\{\}\\])/g,"\\$1")};Array.prototype.htmlspecialchars=function(){for(var a=[],b=0,c=this.length;b<c;b++)a[b]=this[b].htmlspecialchars();return a};var EventClass=new function(){};EventClass.addEventHandler=function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):a["on"+b]=c};
EventClass.removeEventHandler=function(a,b,c){a.removeEventListener?a.removeEventListener(b,c,!1):a.detachEvent?a.detachEvent("on"+b,c):a["on"+b]=null};function Overlay(a){this.oOverlay=null;this.opt=a;this.fnResizeEvent=null;this.init()}
Overlay.prototype.init=function(){this.oOverlay=document.createElement("div");this.oOverlay.style.display="none";this.oOverlay.style.backgroundColor="black";this.oOverlay.style.left="0px";this.oOverlay.style.top="0px";oBase.ua.bIsIE6?(this.oOverlay.style.position="absolute",this.oOverlay.style.width=document.body.scrollWidth+"px",this.oOverlay.style.height=document.body.scrollHeight+"px"):(this.oOverlay.style.position="fixed",this.oOverlay.style.width="100%",this.oOverlay.style.height="100%");this.oOverlay.style.zIndex=
99;document.body.appendChild(this.oOverlay)};Overlay.prototype.show=function(a){oBase.setStyle(this.oOverlay,"opacity",a);this.oOverlay.style.display="inline";if(oBase.ua.bIsIE6)window.oOverlayInstanceRef=this,this.fnResizeEvent=function(){this.oOverlayInstanceRef.handleWindowResize()},EventClass.addEventHandler(window,"resize",this.fnResizeEvent)};
Overlay.prototype.handleWindowResize=function(){this.oOverlay.style.position="absolute";this.oOverlay.style.width=document.body.scrollWidth+"px";this.oOverlay.style.height=document.body.scrollHeight+"px"};Overlay.prototype.moveTo=function(a,b,c){var d=oBase.getStyle(this.oOverlay,"opacity");Math.abs(d-a)>=b&&(oBase.setStyle(this.oOverlay,"opacity",d>a?parseFloat(d)-parseFloat(b):parseFloat(d)+parseFloat(b)),setTimeout(this.opt.sSelf+".moveTo("+a+", "+b+", "+c+");",c))};
Overlay.prototype.hide=function(){this.oOverlay.style.display="none"};Overlay.prototype.destroy=function(){oBase.ua.bIsIE6&&EventClass.removeEventHandler(window,"resize",this.fnResizeEvent);this.oOverlay.parentNode.removeChild(this.oOverlay)};function Dialog(a){this.opt=a;this.oHeaderDiv=this.oDialogDiv=this.oOverlay=null;this.iRelMouseLeft=this.iRelMouseTop=0;this.oMouseMoveEvent=this.oMouseDownEvent=this.oKeyEventObject=null;this.init()}
Dialog.prototype.init=function(){this.oKeyEventObject=oBase.ua.bIsIE||oBase.ua.bIsOpera?document.body:window;this.oKeyEventObject.dialogRef=this};
Dialog.prototype.show=function(){if(oBase.ua.bIsIE6)for(var a=document.getElementsByTagName("select"),b=0,c=a.length;b<c;b++)a[b].style.visibility="hidden";this.oOverlay=new Overlay({sSelf:this.opt.sSelf+".oOverlay"});this.oOverlay.show(0.3);this.oDialogDiv=document.createElement("div");this.oDialogDiv.className="dialog";if("sId"in this.opt)this.oDialogDiv.id=this.opt.sId;this.oDialogDiv.instanceRef=this;oBase.setInnerHTML(this.oDialogDiv,'<div class="dialog-header" id="dialog-header"><div class="button"><div class="close" onclick="'+
this.opt.sSelf+'.close();" onmouseover="this.className=\'close-hover\';" onmouseout="this.className=\'close\';"></div></div>'+this.opt.sTitle.htmlspecialchars()+'</div><div class="dialog-content">'+this.opt.sContent+'</div><div class="dialog-buttons" id="dialog-buttons">'+this.opt.sButtons+'</div><div class="dialog-footer"></div>');document.body.appendChild(this.oDialogDiv);c=b=a=0;if("innerWidth"in window)a=window.innerWidth,b=window.innerHeight;else if("documentElement"in document&&("clientWidth"in
document.documentElement||"clientHeight"in document.documentElement))a=document.documentElement.clientWidth,b=document.documentElement.clientHeight;else if("body"in document&&("clientWidth"in document.body||"clientHeight"in document.body))a=document.body.clientWidth,b=document.body.clientHeight;if("pageXOffset"in window)c=window.pageYOffset;else if("documentElement"in document&&"scrollLeft"in document.documentElement)c=document.documentElement.scrollTop;else if("body"in document&&"scrollLeft"in document.body)c=
document.body.scrollTop;oBase.setPos(this.oDialogDiv,{x:parseInt(a/2-this.oDialogDiv.clientWidth/2),y:parseInt(b/2-(this.oDialogDiv.clientHeight+47)/2)+("bFixedPosition"in this.opt&&this.opt.bFixedPosition?0:c)});this.oHeaderDiv=document.getElementById("dialog-header");this.oHeaderDiv.style.cursor="move";this.oHeaderDiv.onmousedown=function(a){this.oMouseDownEvent="event"in window?window.event:a;a=this.parentNode.instanceRef;"focus"in a.oDialogDiv&&a.oDialogDiv.focus();document.onselectstart=new Function("return false");
document.body.draggedDialog=a;EventClass.addEventHandler(document.body,"mousemove",eval(a.opt.sSelf+".handleMouseMove"));EventClass.addEventHandler(document.body,"mouseup",eval(a.opt.sSelf+".handleMouseUp"));var b=oBase.getPos(a.oDialogDiv);a.iRelMouseTop=this.oMouseDownEvent.clientY-b.y;a.iRelMouseLeft=this.oMouseDownEvent.clientX-b.x};this.oKeyEventObject.onkeydown=function(a){return this.dialogRef.handleKey("event"in window?window.event:a)};a=document.getElementById("dialog-buttons").getElementsByTagName("input");
0<a.length&&a[0].focus()};Dialog.prototype.handleMouseMove=function(a){var b=document.body.draggedDialog;this.oMouseMoveEvent="event"in window?window.event:a;b.oDialogDiv.style.left=this.oMouseMoveEvent.clientX-b.iRelMouseLeft+"px";b.oDialogDiv.style.top=this.oMouseMoveEvent.clientY-b.iRelMouseTop+"px";"focus"in b.oDialogDiv&&b.oDialogDiv.focus()};
Dialog.prototype.handleMouseUp=function(){var a=document.body.draggedDialog;EventClass.removeEventHandler(document.body,"mousemove",eval(a.opt.sSelf+".handleMouseMove"));EventClass.removeEventHandler(document.body,"mouseup",eval(a.opt.sSelf+".handleMouseUp"));document.body.draggedDialog=null;document.onselectstart=null};Dialog.prototype.handleKey=function(a){a=a.keyCode;"fOnEnter"in this.opt&&13==a&&eval(this.opt.fOnEnter+"();");27==a&&this.destroy()};Dialog.prototype.hide=function(){this.oOverlay.hide()};
Dialog.prototype.destroy=function(a){if(null!=this.oDialogDiv){if(oBase.ua.bIsIE6)for(var b=document.getElementsByTagName("select"),c=0,d=b.length;c<d;c++)b[c].style.visibility="visible";this.oKeyEventObject.onkeydown=null;document.body.removeChild(this.oDialogDiv);this.oDialogDiv=null;this.oOverlay.destroy();this.oOverlay=null;"fOnDestroy"in this.opt&&("boolean"!=typeof a||!1==a)&&eval(this.opt.fOnDestroy+"();")}};Dialog.prototype.close=function(){this.destroy()};
function CommonDialog(a){this.opt=a;this.sInputId=this.returnValue=this.oDialog=null;this.init()}
CommonDialog.prototype.init=function(){var a="",b="",c=!1;this.sInputId="my-input-"+Math.floor(1E5*Math.random());var d="bExtended"in this.opt&&this.opt.bExtended?"extended":"common";switch(this.opt.sType){case "prompt":a='<div class="common-dialog-content"><p>'+this.opt.sQuestion+'</p></div><div class="common-dialog-content" id="'+this.sInputId+'-container"></div>';b='<input type="button" value="'+oBase.lang.buttonOk+'" onclick="return '+this.opt.sSelf+'.handleSubmit();" /><input type="button" value="'+
oBase.lang.buttonCancel+'" onclick="return '+this.opt.sSelf+'.cancel();" />';c=oBase.ua.bIsGecko;break;case "confirm":a='<div class="common-dialog-content">'+this.opt.sConfirmation+"</div>";b='<input type="button" value="'+oBase.lang.buttonYes+'" onclick="return '+this.opt.sSelf+'.handleConfirm(true);" /><input type="button" value="'+oBase.lang.buttonNo+'" onclick="return '+this.opt.sSelf+'.handleConfirm(false);" />';break;case "alert":a='<div class="common-dialog-content">'+this.opt.sAlert+"</div>",
b='<input type="button" value="'+oBase.lang.buttonOk+'" onclick="return '+this.opt.sSelf+'.handleConfirm(true);" />'}this.oDialog=new Dialog({sSelf:this.opt.sSelf+".oDialog",sTitle:this.opt.sTitle,sId:d+"-dialog",sContent:a,sButtons:b,fOnDestroy:this.opt.sSelf+".handleDestroy",fOnEnter:this.opt.sSelf+".handleSubmit",bFixedPosition:c});this.oDialog.show();if("prompt"==this.opt.sType){oBase.setInnerHTML(document.getElementById(this.sInputId+"-container"),'<form><input type="text" style="width: 280px;" id="'+
this.sInputId+'" /></form>');if(oBase.ua.bIsGecko)document.getElementById("common-dialog").style.position="fixed";document.getElementById(this.sInputId).focus()}};CommonDialog.prototype.handleDestroy=function(){if("fCallback"in this.opt){if(null==this.returnValue)this.returnValue=!1;eval(this.opt.fCallback+"(this.returnValue);")}};CommonDialog.prototype.handleSubmit=function(){this.returnValue=document.getElementById(this.sInputId).value;this.oDialog.close()};
CommonDialog.prototype.handleConfirm=function(a){this.returnValue=a;this.oDialog.close()};CommonDialog.prototype.cancel=function(){this.returnValue=!1;this.oDialog.close()};function ExtendedSelection(a){this.opt=a;this.oDialog=null;this.iCurCompany=0;this.init()}ExtendedSelection.prototype.init=function(){oBase.setInnerHTML(document.getElementById(this.opt.sId),'<a href="#" onclick="'+this.opt.sSelf+'.clickHandler();">'+this.opt.sLabel.htmlspecialchars()+"</a>")};
ExtendedSelection.prototype.clickHandler=function(){var a="";if(1<this.opt.aCompanies.length){for(var b="",c=0,d=this.opt.aCompanies.length;c<d;c++)if(b+='<option value="'+this.opt.aCompanies[c].sId+'"'+(this.opt.sCurCompany==this.opt.aCompanies[c].sId?' selected="selected"':"")+">"+this.opt.aCompanies[c].sName+"</option>",this.opt.sCurCompany==this.opt.aCompanies[c].sId)this.iCurCompany=c;a+=this.opt.sCompanyTemplate.replace(/%companies%/,b)}a+=this.opt.sTemplate.replace(/%customerSites%/,this._getCustomerSiteChecks(!0));
this.oDialog=new Dialog({sSelf:this.opt.sSelf+".oDialog",sTitle:this.opt.sDialogTitle,sContent:a,sButtons:this.opt.sButtonTemplate});this.oDialog.show()};ExtendedSelection.prototype.checkAll=function(){for(var a=document.getElementById("checkAll").checked,b=0,c=this.opt.aCompanies[this.iCurCompany].aCustomerSites.length;b<c;b++)document.getElementById("customerSite_"+this.opt.aCompanies[this.iCurCompany].aCustomerSites[b].sId).checked=a};
ExtendedSelection.prototype.checkItem=function(){for(var a=!0,b=0,c=this.opt.aCompanies[this.iCurCompany].aCustomerSites.length;b<c;b++)a=a&&document.getElementById("customerSite_"+this.opt.aCompanies[this.iCurCompany].aCustomerSites[b].sId).checked;document.getElementById("checkAll").checked=a};
ExtendedSelection.prototype.changeCompany=function(a){this.iCurCompany=a.selectedIndex;oBase.setInnerHTML(document.getElementById("customerSiteList"),this._getCustomerSiteChecks());document.getElementById("checkAll").checked=!1};ExtendedSelection.prototype.cancel=function(){this.oDialog.close()};
ExtendedSelection.prototype.doSelection=function(){for(var a=[],b=0,c=this.opt.aCompanies[this.iCurCompany].aCustomerSites.length;b<c;b++)if(document.getElementById("customerSite_"+this.opt.aCompanies[this.iCurCompany].aCustomerSites[b].sId).checked)a[a.length]=this.opt.aCompanies[this.iCurCompany].aCustomerSites[b].sId;0<a.length?location.href=location.pathname+"?setCustomerSiteIDs="+a.join(",")+"&setCompanyID="+this.opt.aCompanies[this.iCurCompany].sId:this.oDialog.close()};
ExtendedSelection.prototype._getCustomerSiteChecks=function(a){for(var b=this.opt.aCompanies[this.iCurCompany].aCustomerSites,c="",d=0,e=b.length;d<e;d++)c+='<input type="checkbox" value="1" id="customerSite_'+b[d].sId+'" onclick="'+this.opt.sSelf+'.checkItem();"'+(a&&b[d].bChecked?' checked="checked"':"")+' class="checkbox"> <label for="customerSite_'+b[d].sId+'">'+b[d].sName.htmlspecialchars()+"</label><br />";return c};function HelpDialog(a){this.opt=a;this.oDialog=null;this.init()}
HelpDialog.prototype.init=function(){var a=document.getElementById(this.opt.sHelpButtonId);a.style.display="block";document.getElementById(this.opt.sSeparatorId).style.display=document.getElementById(this.opt.sAddComponentsId).style.display;a.oHelpDialogRef=this;a.onclick=function(){this.oHelpDialogRef.show()}};HelpDialog.prototype.show=function(){this.oDialog=new Dialog({sSelf:this.opt.sSelf+".oDialog",sTitle:this.opt.sTitle,sContent:this.opt.sContents,sButtons:this.opt.sButton});this.oDialog.show()};
HelpDialog.prototype.close=function(){this.oDialog.close()};function ListView(a){this.opt=a;this.oExport=this.oMyReport=this.oColumnPicker=this.oAllCheck=this.oTable=this.oForm=null;this.init()}
ListView.prototype.init=function(){this.oForm=document.getElementById(this.opt.sFormId);this.oTable=document.getElementById(this.opt.sTableId);this.prepareRows();this.prepareCheckboxes();if("oColumnPicker"in this.opt)this.oColumnPicker=new ListViewColumnPicker(this.opt.oColumnPicker,this);if("oMyReport"in this.opt)this.oMyReport=new ListViewMyReport(this.opt.oMyReport,this);if("oExport"in this.opt)this.oExport=new ListViewExport(this.opt.oExport,this)};
ListView.prototype.prepareRows=function(){for(var a=this.oTable.getElementsByTagName("tr"),b=0,c=a.length;b<c;b++)if(!(null==a[b].childNodes||1>=a[b].childNodes.length||"th"==a[b].childNodes[1].nodeName.toLowerCase()))if(a[b].instanceRef=this,a[b].sBaseClass=a[b].className,a[b].sMarkedClass="",a[b].sHighlightClass="",a[b].onmouseover=function(){this.instanceRef.highlight(this,!0)},a[b].onmouseout=function(){this.instanceRef.delight(this,!0)},this.opt.bEnableClickSupport)a[b].onclick=function(){this.instanceRef.handleClick(this,
!0)}};ListView.prototype.prepareCheckboxes=function(){if(null!=this.opt.sAllCheck){this.oAllCheck=document.getElementById(this.opt.sAllCheck);this.oAllCheck.style.display="block";this.oAllCheck.instanceRef=this;this.oAllCheck.onclick=function(){this.instanceRef.checkAll()};for(var a=this.oTable.getElementsByTagName("input"),b=0,c=a.length;b<c;b++)if("type"in a[b]&&"checkbox"==a[b].type&&a[b].name==this.opt.sCheckName)a[b].instanceRef=this,a[b].onclick=function(){this.instanceRef.checkItem()}}};
ListView.prototype.checkAll=function(){for(var a=0;a<this.oForm.elements.length;a++){var b=this.oForm.elements[a];if(b.name==this.opt.sCheckName&&"checkbox"==b.type&&!1==b.disabled)b.checked=this.oAllCheck.checked}};
ListView.prototype.checkItem=function(){if(null==this.oForm)this.oForm=document.getElementById(this.opt.sFormId);for(var a=0,b=0,c=0;c<this.oForm.elements.length;c++){var d=this.oForm.elements[c];d.name==this.opt.sCheckName&&"checkbox"==d.type&&!1==d.disabled&&(a++,d.checked&&b++)}this.oAllCheck.checked=b==a?!0:!1};ListView.prototype.highlight=function(a){a.sHighlightClass=" highlight";a.className=a.sBaseClass+a.sMarkedClass+a.sHighlightClass};
ListView.prototype.delight=function(a){a.sHighlightClass="";a.className=a.sBaseClass+a.sMarkedClass+a.sHighlightClass};ListView.prototype.handleClick=function(a){a.sMarkedClass=""==a.sMarkedClass?" marked":"";a.className=a.sBaseClass+a.sMarkedClass+a.sHighlightClass};function ListViewExport(a,b){this.opt=a;this.oParentListView=b;this.iExportTimerID=this.oExportRequest=this.oLoadingDialog=this.sExportURL=null;this.init()}
ListViewExport.prototype.init=function(){for(var a=0,b=this.opt.aButtons.length;a<b;a++){var c=this.opt.aButtons[a],d=document.getElementById(c.sLinkId);if(null!=d)d.instanceRef=this,"iLimit"in c&&c.iLimit<this.oParentListView.opt.iNumRowsTotal?(oBase.setInnerHTML(d,'<img src="'+oBase.oPath.imageURL+"/shared/icons/"+c.sDisableImage+'" alt="" />'),d.onclick=function(){return this.instanceRef.handleButtonClickDisabled(this)}):d.onclick=function(){return this.instanceRef.handleButtonClick(this)}}};
ListViewExport.prototype.handleButtonClick=function(a){this.sExportURL=a.href;this.tmpMethod=oBase.getXMLDocument;this.oExportRequest=this.tmpMethod(this.sExportURL+"&generate=1",this.handleGenerateReady);delete this.tmpMethod;this.oLoadingDialog=new Dialog({sSelf:this.opt.sSelf+".oLoadingDialog",sId:"export-loading",sTitle:this.opt.oLabels.dialogTitle,sContent:'<div class="common-dialog-content" id="list-view-loader-container"><div id="list-view-loader" class="loader"><img src="/public/images/shared/icons/loading_yellow.gif" alt="" /></div><p>'+
this.opt.oLabels.dialogMessage+"</p></div>",sButtons:'<input type="button" value="'+oBase.lang.buttonCancel+'" onclick="return '+this.opt.sSelf+'.oLoadingDialog.destroy();" />',fOnDestroy:this.opt.sSelf+".abortExport"});this.oLoadingDialog.show();this.iExportTimerID=setTimeout(this.opt.sSelf+".handleTimerDone()",this.opt.iDelayThreshold);return!1};ListViewExport.prototype.handleButtonClickDisabled=function(){oBase.alert(this.opt.oLabels.exportDisabled);return!1};
ListViewExport.prototype.abortExport=function(){this.sExportURL=null;this.oExportRequest.abort();if(null!=this.iExportTimerID)clearTimeout(this.iExportTimerID),this.iExportTimerID=null};ListViewExport.prototype.handleTimerDone=function(){var a=document.getElementById("list-view-loader-container");if("object"==typeof a&&null!=a){var b=document.createElement("p");oBase.setInnerHTML(b,this.opt.oLabels.exportDelayedMessage.htmlspecialchars());a.appendChild(b)}this.iExportTimerID=null};
ListViewExport.prototype.handleGenerateReady=function(){if(null!=this.iExportTimerID)clearTimeout(this.iExportTimerID),this.iExportTimerID=null;if(null!=this.sExportURL)if(this.oLoadingDialog.destroy(!0),202!=this.oExportRequest.status)oBase.alert(this.opt.oLabels.exportFailedMessage);else{var a=document.createElement("iframe");a.src=this.sExportURL+"&generate=2";a.style.width="0px";a.style.height="0px";document.body.appendChild(a)}};
function ListViewColumnPicker(a,b){this.opt=a;this.oParentListView=b;this.oDialog=null;this.init()}ListViewColumnPicker.prototype.init=function(){var a=document.getElementById(this.opt.sId);oBase.setInnerHTML(a,'<img src="'+oBase.oPath.imageURL+'/shared/icons/columnPicker.png" style="" alt="" />');a.instanceRef=this;a.onclick=function(){this.instanceRef.show()}};
ListViewColumnPicker.prototype.show=function(){for(var a="",b=[],c=0,d=this.opt.aColumnGroups.length;c<d;c++){var e=this.opt.aColumnGroups[c];null!=e.sName&&(a+="<h4>"+e.sName+"</h4>");for(var a=a+'<div style="clear: both; height:5px;"></div>',f=0,h=e.aColumns.length;f<h;f++){var g=e.aColumns[f],a=a+('<div class="column-picker-column" id="option_'+g.sId+'"><input type="checkbox" name="c[]" id="column_'+g.sId+'" value="'+g.sId+'"'+(g.bSelected?' checked="checked"':"")+' /> <label for="column_'+g.sId+
'" id="option-label-'+g.sId+'">'+g.sName+"</label></div>");null!=g.sDescription&&(b[b.length]={sId:"option-label-"+g.sId,sTitle:null==g.sTitle?g.sName:g.sTitle,sContent:g.sDescription})}a+='<div style="clear: both; height:5px;"></div>'}this.oDialog=new Dialog({sSelf:this.opt.sSelf+".oDialog",sTitle:this.opt.sTitle,sContent:a,sButtons:this.opt.sButtonTemplate,fOnDestroy:this.opt.sSelf+".oDialog.destroy"});this.oDialog.show();this.oDialog.oHint=0<b.length?new Hint({sSelf:this.opt.sSelf+".oDialog.oHint",
aTargets:b}):null};ListViewColumnPicker.prototype.cancel=function(){this.oDialog.destroy()};ListViewColumnPicker.prototype.destroy=function(){null!=this.oDialog.oHint&&this.oDialog.oHint.destroy()};
ListViewColumnPicker.prototype.submit=function(){for(var a=[],b=0,c=this.opt.aColumnGroups.length;b<c;b++)for(var d=0,e=this.opt.aColumnGroups[b].aColumns.length;d<e;d++)if(this.opt.aColumnGroups[b].aColumns[d].bSelected=document.getElementById("column_"+this.opt.aColumnGroups[b].aColumns[d].sId).checked,this.opt.aColumnGroups[b].aColumns[d].bSelected)a[a.length]=this.opt.aColumnGroups[b].aColumns[d].sId;location.href=this.opt.sReportURL+"&c="+a.join(":")};
function ListViewMyReport(a,b){this.opt=a;this.oParentListView=b;this.bCollapsed=!0;this.oCommonDialogAdd=this.oCommonDialogRemove=this.oRemoveButton=this.oSaveButton=this.iCurReport=this.oSelect=null;this.init()}
ListViewMyReport.prototype.init=function(){oBase.setInnerHTML(document.getElementById(this.opt.sContainerId),this.opt.sTemplate);this.opt.bCollapsed||this.toggle();this.oSelect=document.getElementById(this.opt.sSelectId);this.oSelect.instanceRef=this;this.oSelect.onchange=function(){this.instanceRef.handleSelectChange()};for(var a=0,b=this.opt.aReports.length;a<b;a++)this.addReportOption(a);this.oSaveButton=document.getElementById(this.opt.sSaveId);this.oRemoveButton=document.getElementById(this.opt.sRemoveId);
this.updateButtonStatus()};
ListViewMyReport.prototype.toggle=function(){var a=document.getElementById(this.opt.sToggleId),b=document.getElementById(this.opt.sPanelId);this.bCollapsed?(a.src=a.src.replace(/maximize/,"minimize"),b.style.display="block",oBase.getXMLDocument("/XMLHTTP/setMyReportToggle?collapse=0&listview="+this.oParentListView.opt.sId)):(a.src=a.src.replace(/minimize/,"maximize"),b.style.display="none",oBase.getXMLDocument("/XMLHTTP/setMyReportToggle?collapse=1&listview="+this.oParentListView.opt.sId));this.bCollapsed=
!this.bCollapsed};ListViewMyReport.prototype.handleSelectChange=function(){var a=this.oSelect.options[this.oSelect.selectedIndex].value;switch(a){case "-1":location.href=this.opt.sBaseURL;break;case "0":this.iCurReport=null;this.updateButtonStatus();break;default:for(var b=0,c=this.opt.aReports.length;b<c;b++)if(this.opt.aReports[b].sId==a)location.href=this.opt.aReports[b].sURL+(-1==this.opt.aReports[b].sURL.indexOf("?")?"?":"&")+"r="+a}};
ListViewMyReport.prototype.updateButtonStatus=function(){var a="0"==this.oSelect.options[this.oSelect.selectedIndex].value||null!=this.iCurReport&&this.opt.aReports[this.iCurReport].bIsModified;this.oSaveButton.src=this.oSaveButton.src.replace(/[a-zA-Z_]+\.png/,a?"save.png":"save_off.png");this.oSaveButton.style.cursor=a?"pointer":"auto";a?(this.oSaveButton.instanceRef=this,this.oSaveButton.onclick=function(){this.instanceRef.saveReport()}):this.oSaveButton.onclick=null;a=null!=this.iCurReport;this.oRemoveButton.src=
this.oRemoveButton.src.replace(/[a-zA-Z_]+\.png/,a?"delete.png":"delete_off.png");this.oRemoveButton.style.cursor=a?"pointer":"auto";a?(this.oRemoveButton.instanceRef=this,this.oRemoveButton.onclick=function(){this.instanceRef.removeReport()}):this.oRemoveButton.onclick=null};
ListViewMyReport.prototype.saveReport=function(){if(null==this.iCurReport)return this.addReport();oBase.getXMLDocument(this.opt.sReportURL+"&updateReport="+this.opt.aReports[this.iCurReport].sId);this.opt.aReports[this.iCurReport].bIsModified=!1;oBase.setInnerHTML(this.oSelect.options[this.oSelect.selectedIndex],this.opt.aReports[this.iCurReport].sName);this.updateButtonStatus();return null};
ListViewMyReport.prototype.removeReport=function(){if(null!=this.iCurReport)this.oCommonDialogRemove=new CommonDialog({sSelf:this.opt.sSelf+".oCommonDialogRemove",sConfirmation:this.opt.oLabels.sConfirmDelete,sTitle:this.opt.oLabels.sConfirmDeleteTitle,sType:"confirm",fCallback:this.opt.sSelf+".removeReportDone"})};
ListViewMyReport.prototype.removeReportDone=function(a){if(!1!=a){oBase.getXMLDocument(this.opt.sReportURL+"&removeReport="+this.opt.aReports[this.iCurReport].sId);this.oSelect.removeChild(this.oSelect.options[this.oSelect.selectedIndex]);if(1==this.oSelect.options.length||0!=this.oSelect.options[1].value)a=document.createElement("option"),a.value="0",oBase.setInnerHTML(a,this.opt.oLabels.sCustomOption),1==this.oSelect.options.length?this.oSelect.appendChild(a):this.oSelect.insertBefore(a,this.oSelect.options[1]);
this.oSelect.selectedIndex=1;this.iCurReport=null;this.updateButtonStatus()}};ListViewMyReport.prototype.addReportOption=function(a){var b=document.createElement("option");oBase.setInnerHTML(b,this.opt.aReports[a].sName+(this.opt.aReports[a].bIsModified?" *":""));b.value=this.opt.aReports[a].sId;this.oSelect.appendChild(b);if(this.opt.aReports[a].bSelected)this.oSelect.selectedIndex=this.oSelect.options.length-1,this.iCurReport=a};
ListViewMyReport.prototype.addReport=function(){this.oCommonDialogAdd=new CommonDialog({sSelf:this.opt.sSelf+".oCommonDialogAdd",sQuestion:this.opt.oLabels.sAddReportQuestion,sTitle:this.opt.oLabels.sAddReportTitle,sType:"prompt",fCallback:this.opt.sSelf+".addReportDone"})};ListViewMyReport.prototype.addReportDone=function(a){if(!1!=a)a=oBase.getXMLDocument(this.opt.sReportURL+"&saveReport="+escape(a)).responseText.substr(1),location.href=this.opt.sReportURL+"&r="+a};
function InlineListView(a){this.opt=a;this.init()}InlineListView.prototype.init=function(){this.tmpMethod=oBase.getXMLDocument;this.tmpMethod(this.opt.sUrl,this.handleInjectListView);delete this.tmpMethod;document.body.inlineListView_instanceRef=this;oBase.setInnerHTML(document.getElementById(this.opt.sTargetId),this.opt.sLoaderTemplate)};
InlineListView.prototype.handleInjectListView=function(a){if("boolean"==typeof a&&!1==a)return oBase.setInnerHTML(document.getElementById(this.opt.sTargetId),'<div class="loader">'+oBase.lang.errorLoadingData.htmlspecialchars()+"</div>");var b="",c=a.getElementsByTagName("root")[0];this.opt.oListViewOptions.iNumRowsTotal=parseInt(c.getAttribute("numRowsTotal"));for(var d=0,e=c.childNodes.length;d<e;d++)b+=c.childNodes[d].nodeValue;oBase.setInnerHTML(document.getElementById(this.opt.sTargetId),b);
window[this.opt.oListViewOptions.sSelf]=new ListView(this.opt.oListViewOptions);oBase.dummy(a);return null};
function DateSelector(a){this.opt=a;this.oPeriodDiv=this.oForm=null;this.oGroupBy={year:{aPeriodsVisible:[!0,!1,!1,!1,!1,!1,!1,!0,!0,!0],oFieldsVisible:{fd:!1,fm:!1,fy:!0,td:!1,tm:!1,ty:!0},sAlternativePeriod:"6"},month:{aPeriodsVisible:[!0,!1,!1,!1,!1,!0,!0,!0,!0,!0],oFieldsVisible:{fd:!1,fm:!0,fy:!0,td:!1,tm:!0,ty:!0},sAlternativePeriod:"4"},week:{aPeriodsVisible:[!0,!1,!1,!0,!0,!0,!0,!0,!0,!0],oFieldsVisible:{fd:!0,fm:!0,fy:!0,td:!0,tm:!0,ty:!0},sAlternativePeriod:"8"},defaultPeriod:{aPeriodsVisible:[!0,
!0,!0,!0,!0,!0,!0,!0,!0,!0],oFieldsVisible:{fd:!0,fm:!0,fy:!0,td:!0,tm:!0,ty:!0},sAlternativePeriod:null}};this.oPeriodFields=null;this.init()}
DateSelector.prototype.init=function(){this.oPeriodDiv=document.getElementById(this.opt.sPeriodDivId);this.oForm=this.oPeriodDiv.form;this.oPeriodFields={gb:this.opt.sField+"[gb]"in this.oForm?this.oForm[this.opt.sField+"[gb]"]:null,fd:this.oForm[this.opt.sField+"[fd]"],fm:this.oForm[this.opt.sField+"[fm]"],fy:this.oForm[this.opt.sField+"[fy]"],td:this.oForm[this.opt.sField+"[td]"],tm:this.oForm[this.opt.sField+"[tm]"],ty:this.oForm[this.opt.sField+"[ty]"]};this.setupPeriodDiv();null!=this.oPeriodFields.gb&&
this.setupGroupBy();"sMinDate"in this.opt&&this.setupMinimumDate()};
DateSelector.prototype.setupPeriodDiv=function(){this.oPeriodDiv.name=this.opt.sField+"[t]";this.oPeriodDiv.style.display="inline";this.oPeriodDiv.instanceRef=this;this.oPeriodDiv.onchange=function(){this.instanceRef.selectPeriod(this.value,!1);1!=this.value&&this.form.submit()};for(var a=0,b=this.opt.aPeriods.length;a<b;a++){var c=document.createElement("option");oBase.setInnerHTML(c,this.opt.aPeriods[a].sLabel.htmlspecialchars());c.value=this.opt.aPeriods[a].sName;this.oPeriodDiv.appendChild(c);
if(this.opt.aPeriods[a].bSelected)this.oPeriodDiv.selectedIndex=this.oPeriodDiv.options.length-1,this.selectPeriod(c.value,!1)}for(var d in this.oPeriodFields)if("gb"!=d)this.oPeriodFields[d].instanceRef=this,this.oPeriodFields[d].onchange=function(){this.instanceRef.resetPredefinedPeriod()};if(this.opt.sUpdateGroupByButtonName in this.oForm)this.oForm[this.opt.sUpdateGroupByButtonName].style.display="none"};
DateSelector.prototype.setupGroupBy=function(){this.oPeriodFields.gb.instanceRef=this;this.oPeriodFields.gb.onchange=function(){this.instanceRef.handleChangeGroupBy(!0)};this.handleChangeGroupBy(!1)};DateSelector.prototype.setupMinimumDate=function(){var a=this.oForm[this.opt.sSubmitButtonName];a.instanceRef=this;a.onclick=function(){return this.instanceRef.handleSubmit()}};
DateSelector.prototype.handleSubmit=function(){if(!("sMinDate"in this.opt)||null==this.opt.sMinDate)return!0;for(var a=this.opt.sMinDate.split("-"),b=0;3>b;b++)a[b]=parseInt(a[b]);var b="none"==this.oPeriodFields.fd.display?1:parseInt(this.oPeriodFields.fd.options[this.oPeriodFields.fd.selectedIndex].value),c="none"==this.oPeriodFields.fm.display?1:parseInt(this.oPeriodFields.fm.options[this.oPeriodFields.fm.selectedIndex].value),d=parseInt(this.oPeriodFields.fy.options[this.oPeriodFields.fy.selectedIndex].value);
return d<a[0]||d==a[0]&&c<a[1]||d==a[0]&&c==a[1]&&b<=a[2]?(this.oCommonDialog=new CommonDialog({sSelf:this.opt.sSelf+".oCommonDialog",sTitle:"undefined"==typeof sTitle?-1==document.title.indexOf(" - ")?document.title:document.title.substr(0,document.title.indexOf(" - ")):sTitle,sType:"alert",sAlert:this.opt.sOutOfBoundsError.replace(/%numDays%/g,this.opt.iMaxPeriodCovered),fCallback:this.opt.sSelf+".confirmPeriodDone"}),!1):!0};DateSelector.prototype.confirmPeriodDone=function(a){!1!=a&&this.oForm.submit()};
DateSelector.prototype.selectPeriod=function(a,b){for(var c=0,d=this.opt.aPeriods.length;c<d;c++)if(this.opt.aPeriods[c].sName==a){if(""!=this.opt.aPeriods[c].sBeginDate)this.oPeriodFields.fd.selectedIndex=parseInt(this.opt.aPeriods[c].sBeginDate.substr(8,2).replace(/^0/,""))-1,this.oPeriodFields.fm.selectedIndex=parseInt(this.opt.aPeriods[c].sBeginDate.substr(5,2).replace(/^0/,""))-1,this.oPeriodFields.fy.selectedIndex=parseInt(this.opt.aPeriods[c].sBeginDate.substr(0,4).replace(/^0/,""))-2E3,this.oPeriodFields.td.selectedIndex=
parseInt(this.opt.aPeriods[c].sEndDate.substr(8,2).replace(/^0/,""))-1,this.oPeriodFields.tm.selectedIndex=parseInt(this.opt.aPeriods[c].sEndDate.substr(5,2).replace(/^0/,""))-1,this.oPeriodFields.ty.selectedIndex=parseInt(this.opt.aPeriods[c].sEndDate.substr(0,4).replace(/^0/,""))-2E3;break}if(b){c=0;for(d=this.oPeriodDiv.length;c<d;c++)if(this.oPeriodDiv[c].value==a&&this.oPeriodDiv.selectedIndex!=c)this.oPeriodDiv.selectedIndex=c,this.oForm.submit()}};
DateSelector.prototype.resetPredefinedPeriod=function(){this.oPeriodDiv.selectedIndex=0};
DateSelector.prototype.handleChangeGroupBy=function(a){var b=null;switch(this.oPeriodFields.gb.options[this.oPeriodFields.gb.selectedIndex].value){case "1":b=this.oGroupBy.year;break;case "2":b=this.oGroupBy.month;break;case "4":b=this.oGroupBy.week;break;default:b=this.oGroupBy.defaultPeriod}for(var c in b.oFieldsVisible)this.oPeriodFields[c].style.display=b.oFieldsVisible[c]?"inline":"none";b.aPeriodsVisible[this.oPeriodDiv.selectedIndex]||this.selectPeriod(b.sAlternativePeriod,!0);c=0;for(var d=
b.aPeriodsVisible.length;c<d;c++)this.oPeriodDiv.options[c].style.display=b.aPeriodsVisible[c]?"block":"none";a&&this.oForm.submit()};function Flash(a){this.opt=a;this.init()}
Flash.prototype.init=function(){document.write('<object type="application/x-shockwave-flash" data="'+oBase.oPath.imageURL+"/"+this.opt.sFile+'" width="'+this.opt.sWidth+'" height="'+this.opt.sHeight+'">');document.write('<param name="movie" value="'+oBase.oPath.imageURL+"/"+this.opt.sFile+'" />');"sFlashVars"in this.opt&&document.write('<param name="flashvars" value="'+this.opt.sFlashVars+'" />');document.write('<param name="quality" value="high" />');document.write('<param name="wmode" value="transparent" />');
document.write('<param name="menu" value="false" />');document.write('<param name="loop" value="false" />');document.write('<param name="scale" value="noscale" />');document.write('<param name="allowScriptAccess" value="sameDomain" />');document.write('<img src="'+oBase.oPath.imageURL+"/"+this.opt.sAltImage+'" alt="" />');document.write("</object>")};function NavigationButtons(a){this.opt=a;this.init()}
NavigationButtons.prototype.init=function(){for(var a=document.getElementById(this.opt.sListContainerId).getElementsByTagName("li"),b=0,c=a.length;b<c;b++)if(!("className"in a[b])||null==a[b].className||-1==a[b].className.indexOf("selected"))a[b].instanceRef=this,a[b].onmouseover=function(){this.instanceRef.handleMouseOverButton(this,!0)},a[b].onmouseout=function(){this.instanceRef.handleMouseOverButton(this,!1)}};
NavigationButtons.prototype.handleMouseOverButton=function(a,b){var c=!("className"in a)||null==a.className?"":a.className;if(b){if(-1==c.indexOf("selected"))a.className=-1!=c.indexOf("first")?"first selected":"selected"}else a.className=-1!=c.indexOf("first")?"first":""};function Hint(a){this.opt=a;this.iTimeoutId=this.oTarget=this.oContentDiv=this.oTitleDiv=this.oBox=this.oContainer=null;this.init()}
Hint.prototype.init=function(){for(var a=0,b=this.opt.aTargets.length;a<b;a++){var c=document.getElementById(this.opt.aTargets[a].sId);c.instanceRef=this;c.sHintTitle=this.opt.aTargets[a].sTitle;c.sHintContent=this.opt.aTargets[a].sContent;c.style.cursor="pointer";c.bTransparent="bTransparent"in this.opt.aTargets[a]&&this.opt.aTargets[a].bTransparent;c.onmouseover=function(){this.instanceRef.showHint(this.sHintTitle,this.sHintContent,this.bTransparent)};c.onmouseout=function(){this.instanceRef.hideHint()}}};
Hint.prototype.showHint=function(a,b,c){if(null!=this.iTimeoutId)window.clearTimeout(this.iTimeoutId),this.iTimeoutId=null;if(null==this.oBox)this.oBox=document.createElement("div"),document.body.appendChild(this.oBox),this.oContainer=document.createElement("div"),this.oContainer.className="hint-container",this.oBox.appendChild(this.oContainer),this.oTitleDiv=document.createElement("div"),this.oTitleDiv.style.display="none",this.oTitleDiv.style.fontWeight="bold",this.oTitleDiv.style.padding="2px",
this.oTitleDiv.style.backgroundColor="#f6eeaa",this.oTitleDiv.style.borderBottom="1px solid #212121",this.oContainer.appendChild(this.oTitleDiv),this.oContentDiv=document.createElement("div"),this.oContentDiv.style.padding="2px",this.oContainer.appendChild(this.oContentDiv);c?(this.oTitleDiv.style.display="none",this.oContentDiv.style.display="block",this.oBox.className="hint-transparent"):(this.oBox.className="hint-shade",oBase.setInnerHTML(this.oTitleDiv,a.htmlspecialchars()),this.oTitleDiv.style.display=
"block",this.oContentDiv.style.display=""==b?"none":"block",this.oTitleDiv.style.borderBottom=""==b?"0px solid black":"1px solid black");oBase.setInnerHTML(this.oContentDiv,b);this.oBox.style.visibility="visible";document.MouseOver_instanceRef=this;document.onmousemove=function(a){document.MouseOver_instanceRef.mouseMove(a?a:window.event)}};Hint.prototype.hideHint=function(){if(null==this.iTimeoutId)this.iTimeoutId=setTimeout(this.opt.sSelf+".hideHint2()",5)};
Hint.prototype.hideHint2=function(){this.oBox.style.visibility="hidden";this.iTimeoutId=document.onmousemove=null};Hint.prototype.mouseMove=function(a){a.pageX?(this.oBox.style.left=a.pageX+20+"px",this.oBox.style.top=a.pageY+20+"px"):(this.oBox.style.left=a.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft)+10,this.oBox.style.top=a.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)+10)};
Hint.prototype.destroy=function(){document.onmousemove=null;null!=this.oBox&&this.oBox.parentNode.removeChild(this.oBox)};function MaterialPreview(a){this.opt=a;this.oHint=null;this.oMaterialDone={};this.init()}MaterialPreview.prototype.init=function(){this.oHint=new Hint({aTargets:[],sSelf:this.opt.sSelf+".oHint"})};
MaterialPreview.prototype.initMaterial=function(a,b){if(!(a.sMaterialId in this.oMaterialDone)){b.instanceRef=this.oHint;switch(a.iType){case 1:b.sHintTitle="";b.sHintContent='<div style="background-color: white; border: 1px solid black; width: '+a.sWidth+"px; height: "+a.sHeight+'px;"><img src="'+oBase.oPath.currentURL+"/affiliateMaterial/getFile/materialID/"+a.sMaterialId+'" alt="" width="'+a.sWidth+'" height="'+a.sHeight+'" /></div>';b.bTransparent=!0;break;case 2:b.sHintTitle=a.sLinkText;b.sHintContent=
a.sLinkTextAdditional;b.bTransparent=!1;break;case 3:b.sHintTitle="";b.sHintContent='<div style="background-color: white; border: 1px solid black; width: '+a.sWidth+"px; height: "+a.sHeight+'px; position: absolute;"><object type="application/x-shockwave-flash" data="'+oBase.oPath.currentURL+"/affiliateMaterial/getFile/materialID/"+a.sMaterialId+'" width="'+a.sWidth+'" height="'+a.sHeight+'"><param name="movie" value="'+oBase.oPath.currentURL+"/affiliateMaterial/getFile/materialID/"+a.sMaterialId+
'" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="menu" value="false" /><param name="loop" value="true" /><param name="flashvars" value="campaignID=0&amp;materialID='+a.sMaterialId+'&amp;affiliateID=0&amp;clickTAG=&amp;clickTag=" /></object></div>';b.bTransparent=!0;break;case 4:b.sHintTitle="",b.sHintContent='<div style="background-color: white; border: 1px solid black; width: '+a.sWidth+"px; height: "+a.sHeight+'px;"><img src="'+oBase.oPath.currentURL+
"/affiliateMaterial/getFile/materialID/"+a.sMaterialId+'" alt="" width="'+a.sWidth+'" height="'+a.sHeight+'" /></div>',b.bTransparent=!0}for(var c=b.getElementsByTagName("span"),d=0,e=c.length;d<e;d++)if("title"in c[d])c[d].title="";b.style.cursor="pointer";b.onmouseover=function(){this.instanceRef.showHint(this.sHintTitle,this.sHintContent,this.bTransparent)};b.onmouseout=function(){this.instanceRef.hideHint()};this.oHint.showHint(b.sHintTitle,b.sHintContent,b.bTransparent);this.oMaterialDone[a.sMaterialId]=
!0}};MaterialPreview.handleMouseOver=function(a,b){if("0"!=a.sMaterialId){if(!("oMaterialPreview"in window))window.oMaterialPreview=new MaterialPreview({sSelf:"oMaterialPreview"});window.oMaterialPreview.initMaterial(a,b)}};function FormHelp(a){this.opt=a;this.init()}
FormHelp.prototype.init=function(){for(var a=0,b=this.opt.aControls.length;a<b;a++){var c=document.getElementById("form-field-description-"+this.opt.aControls[a]);if(!("object"!=typeof c||null==c)){c.style.display="none";c=document.getElementById("form-field-"+this.opt.aControls[a]);c.className=c.className;c=document.createElement("img");c.src=oBase.oPath.imageURL+"/shared/icons/form_help.png";c.style.paddingLeft="3px";c.alt=this.opt.sHintTitleLabel;var d=document.createElement("a");d.href="#";d.instanceRef=
this;d.sControlName=this.opt.aControls[a];d.onclick=function(){return this.instanceRef.handleIconClick(this.sControlName,this)};d.title=this.opt.sHintTitleLabel;d.appendChild(c);document.getElementById("form-field-title-"+this.opt.aControls[a]).appendChild(d)}}};
FormHelp.prototype.handleIconClick=function(a,b){var c=document.getElementById("form-field-description-"+a);c.style.display="none"==c.style.display?"":"none";document.getElementById("form-field-"+a).className=document.getElementById("form-field-"+a).className;b.blur()};function CheckAll(a){this.opt=a;this.oCheckBox=null;this.init()}
CheckAll.prototype.init=function(){var a=document.getElementById(this.opt.sContainerId);oBase.setInnerHTML(a,'<input type="checkbox" value="" id="'+this.opt.sId+'"/> <label for="'+this.opt.sId+'">'+this.opt.sLabel+"</label>");this.oCheckBox=document.getElementById(this.opt.sId);this.oCheckBox.instanceRef=this;this.oCheckBox.onclick=function(){this.instanceRef.onClick()}};
CheckAll.prototype.onClick=function(){for(var a=this.oCheckBox.checked,b=document.getElementById(this.opt.sBaseContainerId).getElementsByTagName("input"),c=0,d=b.length;c<d;c++)if("type"in b[c]&&"checkbox"==b[c].type&&"id"in b[c]&&this.opt.regexpMask.test(b[c].id))b[c].checked=a};function RefreshForm(a){this.opt=a;this.oForm=null;this.init()}
RefreshForm.prototype.init=function(){for(var a=0,b=this.opt.aSections.length;a<b;a++){var c=this.opt.aSections[a],d=document.getElementById(c.sRefreshId);if("object"==typeof d&&null!=d){d.style.display="none";for(var d=0,e=c.aUpdateControls.length;d<e;d++){var f=document.getElementById(c.aUpdateControls[d]);f.instanceRef=this;f.oSectionSettings=c;f.onclick=function(){this.instanceRef.handleUpdateControlClick(this,this.oSectionSettings)}}}}};
RefreshForm.prototype.handleUpdateControlClick=function(a,b){var c=document.createElement("input");c.type="hidden";c.name=b.sRefreshId;c.value="1";a.form.appendChild(c);a.form.submit()};

