var eventHandler={KeyDown:"keydown",KeyUp:"keyup",DocumentClick:"click",DocumentMouseUp:"mouseup",DocumentMouseDown:"mousedown",DocumentMouseMove:"mousemove",DocumentOnBeforeUnload:"beforeunload",DocumentOnUnload:"unload",MouseWheelScroll:"mousescroll",_moduleReferences:null,Wrappers:new Object(),NewWrapperId:1,Add:function(D,B,E,C,A){if(!D||typeof (D)!="object"){D=this.GetCorrObject(B)}if(!D){return }if(!D.EW){this.Wrappers[this.NewWrapperId]=new EventWrapper(this.NewWrapperId,D);this.NewWrapperId++}return D.EW.Add(B,E,C,A)},AddSpecial:function(A,D,B){var C=this.GetCorrObject(A);if(!C.EW){this.Wrappers[this.NewWrapperId]=new EventWrapper(this.NewWrapperId,C);this.NewWrapperId++}return C.EW.AddSpecial(A,D,B)},Exists:function(A,B){if(typeof (item)!="object"){return }return(A&&A.EW&&A.EW[B]!=null)},Remove:function(B,C){var A=false;if(!B||typeof (B)!="object"){A=B;B=this.GetCorrObject(B)}if(!B||!C||!B.EW){return }return B.EW.Remove(C,A)},Dispose:function(A){if(!A){for(var C in this.Wrappers){if(this.Wrappers[C]){this.Wrappers[C].Dispose()}}}else{try{if(A.EW){A.EW.Dispose()}}catch(B){}}},GetCorrObject:function(A){switch(A){case eventHandler.KeyDown:case eventHandler.KeyUp:return window.document;case eventHandler.DocumentClick:case eventHandler.DocumentMouseUp:case eventHandler.DocumentMouseDown:case eventHandler.DocumentMouseMove:return document;case eventHandler.DocumentOnBeforeUnload:case eventHandler.DocumentOnUnload:return document.body;case eventHandler.MouseWheelScroll:if(window.addEventListener){return window}else{if(document.attachEvent){return document}}break}return null},SetModuleReference:function(B,A){if(this._moduleReferences==null){this._moduleReferences=new Object()}if(!this._moduleReferences[B]){this._moduleReferences[B]=new Array()}this._moduleReferences[B].push(A)},GetModuleReference:function(A){return this._moduleReferences[A]}};var eh=eventHandler;function EventWrapper(A,B){this.Id=A;this.Object=B;this.Object.EW=this;this.Events=new Object();this.NewId=1;EventWrapper.prototype.GetFireEvents=function(E,D,C){return function(H){if(typeof (eventHandler)!="undefined"){var F=new Array();if(arguments.length>1){for(var G=1;G<arguments.length;G++){F.push(arguments[G])}}eventHandler.Wrappers[E].FireEvents(D,H,C,F)}}};EventWrapper.prototype._add=function(D,H,E,G,C){if(this.Events[D]==null){this.Events[D]=new Object();if(!G()){return -1}}if(E){this.RemoveAll(D)}var F=new Object();F.Callback=H;F.Id=this.NewId;F.StopBubble=C;this.Events[D][this.NewId]=F;return this.NewId++};EventWrapper.prototype.Add=function(D,G,E,C){var F=this;return this._add(D,G,E,function(){try{F.Object["on"+D]=F.GetFireEvents(F.Id,D);return true}catch(H){Qport.Alert("Unexpected EventWrap Exception! ("+D+")");return false}},C)};EventWrapper.prototype.AddSpecial=function(C,F,D){var E=this;return this._add(C,F,D,function(){try{switch(C){case eventHandler.MouseWheelScroll:if(window.addEventListener){window.addEventListener("DOMMouseScroll",E.GetFireEvents(E.Id,C),false)}else{if(document.attachEvent){document.attachEvent("onmousewheel",E.GetFireEvents(E.Id,C))}}break}return true}catch(G){return false}})};EventWrapper.prototype.Remove=function(E,C){if(C){if(this.Events[C]&&this.Events[C][E]){this.Events[C][E].Callback=null;this.Events[C][E]=null;return true}else{return false}}else{for(var C in this.Events){if(this.Events[C]){for(var D in this.Events[C]){if(this.Events[C][D]&&this.Events[C][D].Id==E){this.Events[C][D].Callback=null;this.Events[C][D]=null;return true}}}}return false}};EventWrapper.prototype.RemoveAll=function(C){for(var D in this.Events[C]){if(this.Events[C][D]){this.Events[C][D].Callback=null;this.Events[C][D]=null}}};EventWrapper.prototype.FireEvents=function(K,I,D,N){if(!this.Events[K]){return }for(var C in this.Events[K]){if(this.Events[K]!=null&&this.Events[K][C]!=null){var H=this.Events[K][C];var M=H.Callback;var F=H.StopBubble;try{if(F==undefined){F=false}if(M!=null&&typeof (M.apply)=="function"){var J=new Array();J.push(Browser.Event(I,F));if(N&&N.length>0){for(var G=0;G<N.length;G++){J.push(N[G])}}M.apply(this.Object,J)}}catch(E){if(window.console&&window.console.error){window.console.error("Fire event error");window.console.dir(E)}}}}},EventWrapper.prototype.Dispose=function(){for(var C in this.Events){if(this.Events[C]){try{this.Object["on"+C]=null}catch(E){}try{for(var D in this.Events[C]){if(this.Events[C][D]){this.Events[C][D].Callback=null;this.Events[C][D]=null}}}catch(E){}}}this.Object.EW=null;eh.Wrappers[this.Id]=null}}function ControlEvent(){this._handlers=[]}ControlEvent.prototype={_handlers:null,addHandler:function(A){if(typeof (A)!="function"&&typeof (A)!="Delegate"){throw new IllegalArgumentException("Handler must be function or delegate.")}if(this._handlers==null){this._handlers=[]}this._handlers.push(A);return true},removeHandler:function(B){var A=this._findHandler(B);if(A!=null&&A>=0&&A<this._handlers.length){this._handlers.splice(A,1);return true}else{return false}},hasHandlers:function(){return this._handlers!=null&&this._handlers.length>0},removeAllHandlers:function(){this._handlers=[]},fire:function(B){if(this._handlers!=null){var A;for(A=0;A<this._handlers.length;A++){this._handlers[A](B)}}},_findHandler:function(B){if(this._handlers==null){return null}var A;for(A=0;A<this._handlers.length;A++){if(this._handlers[A]===B){return A}}return null}};function Qollection(){this.List=new Object();this.index=0;Qollection.prototype.Add=function(A,B){if(!B){B=this.index;this.index++}A.Id=B;this.List[B]=A;return B};Qollection.prototype.Remove=function(A){this.List[A]=null}}var qookieHandler={Set:function(C,E,A,H,D,G){cookiename=C.toLowerCase();var B=new Date();B.setTime(B.getTime());if(A){A=A*1000*60*60*24}var F=new Date(B.getTime()+(A));document.cookie=cookiename+"="+escape(E)+((A)?";expires="+F.toGMTString():"")+((H)?";path="+H:"")+((D)?";domain="+D:"")+((G)?";secure":"")},Get:function(C){cookiename=C.toLowerCase();var D=document.cookie.indexOf(cookiename+"=");var A=D+cookiename.length+1;if((!D)&&(cookiename!=document.cookie.substring(0,cookiename.length))){return null}if(D==-1){return null}var B=document.cookie.indexOf(";",A);if(B==-1){B=document.cookie.length}return unescape(document.cookie.substring(A,B))},Remove:function(A,C,B){cookiename=A.toLowerCase();if(this.Get(cookiename)){document.cookie=cookiename+"="+((C)?";path="+C:"")+((B)?";domain="+B:"")+";expires=Mon, 24-Jan-1983 10:00:01 GMT+01:00"}},Reset:function(B,D,A,F,C,E){if(document.cookie.indexOf(B.toLowerCase()+"=")!=-1){this.Remove(B,F,C)}this.Set(B,D,A,F,C,E)}};var Browser={Cookie:qookieHandler,currentFocussedField:null,Blank:"about:blank",Test:function(){return((typeof (new Array().push)!="undefined")&&SOAPClient._getXmlHttp!=null)},Warn:function(){return !this.Test()},GetElementById:function(A){return document.getElementById(A)},GetWindowWidth:function(){if(document.documentElement.clientWidth){return document.documentElement.clientWidth}else{return document.body.clientWidth}},GetInnerText:function(B){var A=B.innerText;if(A==undefined){A=B.textContent}return A},GetActualDimensions:function(B){if(!B){return }var A=new Object();B.style.visibility="hidden";B.style.display="block";A.Width=B.offsetWidth;A.Height=B.offsetHeight;B.style.display="none";B.style.visibility="visible";return A},EscapeHtml:function(A){A=A.replace(/\&/g,"&amp;");A=A.replace(/\</g,"&lt;");A=A.replace(/\>/g,"&gt;");return A},WordBreak:function(H,E,B){if(B<13){alert("Invalid charCount! Must be minimal 13!");return }var C="";var F=new RegExp("[a-zA-Z0-9.\\/-:!]{"+B+",}");if(BrowserDetect.browser.toLowerCase()=="explorer"){if(E.match(F)){H.style.wordBreak="break-all"}else{H.style.wordWrap="break-word"}C=E}else{if(E.match(F)){while(E.match(F)){var A=F.exec(E);if(A==null){break}var D=A[0];var G=D.replace(/([a-zA-Z0-9\.\\\/\-\:]{1})/g,"$1<div style='display:inline; font-size:0px;'> </div>");E=E.replace(D,G)}C=E}else{C=E}}H.innerHTML=C},UnEscapeHtml:function(A){A=A.replace(/\&gt;/g,">");A=A.replace(/\&lt;/g,"<");A=A.replace(/\&amp;/g,"&");return A},Event:function(C,A){if(C&&C.Q){return C}var B={};try{B.Q=true;if(C==undefined||!C||C.srcElement){C=window.event;if(C){B.x=C.clientX;B.y=C.clientY;B.targetobject=C.srcElement;B.keyCode=C.keyCode;B.wheelDelta=(C.wheelDelta*-1)}}else{if(C){B.x=C.clientX;B.y=C.clientY;B.targetobject=C.target;B.keyCode=C.keyCode;B.wheelDelta=C.detail}}if(A&&!B.targetobject.noEventCancelBubble){if(C.stopPropagation){C.stopPropagation();C.preventDefault()}else{if(C.cancelBubble){C.cancelBubble=true;C.returnValue=false}}}}catch(C){}return B},GetWindowHeight:function(){if(document.clientHeight){return document.clientHeight}else{if(document.documentElement.clientHeight){return document.documentElement.clientHeight}else{return document.body.clientHeight}}},SetBrowserTitle:function(A){document.title=A},GetBrowserTitle:function(){return document.title},GetScrollHeight:function(){var A=document.getElementsByTagName("html")[0].scrollHeight;if(A<this.GetWindowHeight()){A=this.GetWindowHeight()}return A},GetScrollWidth:function(){return document.getElementsByTagName("html")[0].scrollWidth},OpenWindow:function(B,A){if(B.length==0){B=this.Blank}return this.OpenSizedWindow(B,false,false,false,A)},OpenSizedWindow:function(C,A,D,F,B){var E;if(C.length==0){C=this.Blank}if(!B){B=""}if(!A||!D){E=window.open(C,B)}else{E=window.open(C,B,"scrollbars=1,width="+A+",height="+D)}if(E==null){Qport.Alert(L()("popupBlocked"))}return E},GetScrollleft:function(){if(document.documentElement&&document.documentElement.scrollLeft){return document.documentElement.scrollLeft}else{if(document.body){return document.body.scrollLeft}}},GetScrolltop:function(){if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop}else{if(document.body){return document.body.scrollTop}}},SetScrolltop:function(A){if(document.documentElement&&(document.documentElement.scrollTop||document.documentElement.scrollTop==0)){document.documentElement.scrollTop=A}else{if(document.body){document.body.scrollTop=A}}},CreateElement:function(B,A){var D;B=B.toLowerCase();if(A&&A.length>0){try{D=document.createElement("<"+B+" name='"+A+"'>")}catch(C){D=document.createElement(B);D.name=A}}else{D=document.createElement(B)}return D},EnterEventAttach:function(B){try{eh.Add(B,"focus",function(){Browser.EnterEventListenerFocus.call(this)});eh.Add(B,"blur",function(){Browser.EnterEventListenerBlur.call(this)})}catch(A){}},EnterEventListenerFocus:function(){this.hasFocus=true;Browser.SetFocusField(this)},EnterEventListenerBlur:function(){this.hasFocus=false;Browser.SetFocusField(null)},SetFocusField:function(A){Browser.currentFocussedField=A},InitEnterListener:function(){eh.Add(false,eh.KeyDown,function(B){if(B.keyCode==13){var A=Browser.currentFocussedField;if(A!=null&&typeof (A.onPressEnter)=="function"){A.onPressEnter()}}})},CreateTextNode:function(){return document.createTextNode("")},SetHandCursor:function(B){try{B.style.cursor="pointer"}catch(A){B.style.cursor="hand"}},SetHighLightOnMouseOver:function(B){try{eh.Add(B,"mouseover",function(){B.orgColor=B.style.color;if(B.style.backgroundColor==""||B.style.backgroundColor=="#FFFFFF"||B.style.backgroundColor=="rgb(255, 255, 255)"){B.style.color=Qport.GUI().Colors.SecondaryColor.ToCssString()}});eh.Add(B,"mouseout",function(){B.style.color=this.orgColor})}catch(A){}},IsChildNode:function(A,B){if(!A||!B){return false}while(B.parentNode){if(B.parentNode==A){return true}else{B=B.parentNode}}return false},FocusNextInParent:function(C){if(!C){return }if(C.parentNode.childNodes.length>0){var B=false;for(var D=0,A=C.parentNode.childNodes.length;D<A;D++){var F=C.parentNode.childNodes[D];if(!F){continue}if(F==C){B=true}else{if(B&&(F.tagName.toLowerCase()=="input"||F.tagName.toLowerCase()=="textarea"||F.tagName.toLowerCase()=="select-one")){try{F.focus();this.currentFocussedField=F;return F}catch(E){}}}}}try{C.focus()}catch(E){}this.currentFocussedField=C;return C},FocusFirstInObject:function(D){if(!D){return }for(var B=0,A=D.childNodes.length;B<A;B++){var E=D.childNodes[B];if((E.type=="text"||E.type=="textarea"||E.type=="select-one")){try{E.focus();this.currentFocussedField=E;return true}catch(C){}}else{if(E.childNodes.length>0){if(Browser.FocusFirstInObject(E)){return true}}}}return false},RemoveAllChilds:function(A){if(A==null){return }while(A.hasChildNodes()){var B=A.firstChild;if(B.childNodes.length>0&&B.hasChildNodes()&&(!B.tagName||B.tagName.toLowerCase()!="select")){Browser.RemoveAllChilds(B)}if(typeof (Qport)!="undefined"&&!Qport.Halt&&eh!=undefined){eh.Dispose(B)}A.removeChild(B)}},RemoveNode:function(A){if(A==null){return }if(A.hasChildNodes()){Browser.RemoveAllChilds(A)}if(typeof (Qport)=="object"&&!Qport.Halt){eh.Dispose(A)}if(A.parentNode){A.parentNode.removeChild(A)}},SetOpacity:function(B,A){if(A<100&&A>=0){B.style.opacity=(A/100);B.style.MozOpacity=(A/100);B.style.KhtmlOpacity=(A/100);B.style.filter="alpha(opacity="+A+")"}else{B.style.opacity="";B.style.MozOpacity="";B.style.KhtmlOpacity="";B.style.filter=""}},SetPng:function(D,C,B,A){if(!D){return }if($.browser.msie&&$.browser.version<7){if(A==null){A=" sizingMethod='scale'"}D.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+C+"', "+A+")"}else{if(B==null){D.style.backgroundImage="url("+C+")";D.style.backgroundRepeat="no-repeat"}else{D.style.background="url("+C+")"+B}}},GetAbsoluteTop:function(B){if(B==null){return 0}var A=0;A+=B.offsetTop;while(B.offsetParent){B=B.offsetParent;A+=B.offsetTop}return A},GetAbsoluteLeft:function(A){if(A==null){return 0}var B=0;B+=A.offsetLeft;while(A.offsetParent){A=A.offsetParent;B+=A.offsetLeft}return B},SetMyHomepage:function(A,C){try{C.style.behavior="url(#default#homepage)";C.setHomePage(A)}catch(B){alert(L()("SetHomepageError").replace("{0}",A))}},selectEnabled:true,EnableSelect:function(){eh.Add(document,"selectstart",function(){return true},true);this.selectEnabled=true},DisableSelect:function(){eh.Add(document,"selectstart",function(){return false},true);this.selectEnabled=false},FixSelectboxInPopupIE6:function(A){if(BrowserDetect.browser.toLowerCase()=="explorer"&&BrowserDetect.version==6){eh.Add(A,"mouseover",function(){if(!this.__fixedIE6PopupBug){var B=this.options.length;this.options[B]=new Option("","");this.options[B]=null;this.__fixedIE6PopupBug=true}})}}};var BrowserDetect={init:function(){this.browser=this.searchString(this.dataBrowser)||"An unknown browser";this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||"an unknown version";this.OS=this.searchString(this.dataOS)||"an unknown OS"},searchString:function(D){for(var A=0;A<D.length;A++){var B=D[A].string;var C=D[A].prop;this.versionSearchString=D[A].versionSearch||D[A].identity;if(B){if(B.indexOf(D[A].subString)!=-1){return D[A].identity}}else{if(C){return D[A].identity}}}},searchVersion:function(B){var A=B.indexOf(this.versionSearchString);if(A==-1){return }return parseFloat(B.substring(A+this.versionSearchString.length+1))},dataBrowser:[{string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:"Apple",identity:"Safari"},{prop:window.opera,identity:"Opera"},{string:navigator.vendor,subString:"iCab",identity:"iCab"},{string:navigator.vendor,subString:"KDE",identity:"Konqueror"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.vendor,subString:"Camino",identity:"Camino"},{string:navigator.userAgent,subString:"Netscape",identity:"Netscape"},{string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"}],dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};BrowserDetect.init();var Q_EXCEPTION=0;var Q_ERROR=1;var Q_ACTION=2;var Q_MESSAGE=3;var LOGEVENTS=new Array();function Log(B,A){A.Init();FireLogEvent(B,A);WriteLog(B,A)}function LogArgs(C,A,B){this.Type=A;this.Code=B;this.Message="";this.Source=C;this.ExtraArgs;LogArgs.prototype.Init=function(){if(this.ExtraArgs==undefined){this.ExtraArgs=new Array()}};LogArgs.prototype.Add=function(E,F){this.Init();var D=this.ExtraArgs.length;this.ExtraArgs[D]=new Argument();this.ExtraArgs[D].Name=E;this.ExtraArgs[D].Value=F};LogArgs.prototype.ToString=function(){var D="Source: "+this.Source+"<br>Type: "+this.Type+"<br>Code: "+this.Code+"<br>Message: "+this.Message+"<br>Args:";for(var E in this.ExtraArgs){D+=this.ExtraArgs[E].Name+": "+this.ExtraArgs[E].Value+"<br>"}return D}}function Argument(){this.Name;this.Value}function WriteLog(B,A){if(A.Source!="soapclient"){for(var D in A.ExtraArgs){A.ExtraArgs[D].__JavascriptPropertyName="Argument"}var C=new SOAPClientParameters();C.add("viewUserId",Qport.Security.ViewUserId);C.add("source",A.Source);C.add("type",A.Type);C.add("code",A.Code);C.add("args",A.ExtraArgs);SOAPClient.invoke("LogService.asmx","DoLog",C,true,function(){},true)}}function AttachLogEvent(D,A){var C=false;for(var B=0;B<LOGEVENTS.length;B++){if(D.toLowerCase()==LOGEVENTS[B][0].toLowerCase()&&A==LOGEVENTS[B][1]){C=true}}if(!C){var E=LOGEVENTS.length;LOGEVENTS[E]=new Array();LOGEVENTS[E][0]=D;LOGEVENTS[E][1]=A}}function DetachLogEvent(C,A){for(var B=0;B<LOGEVENTS.length;B++){if(C.toLowerCase()==LOGEVENTS[B][0].toLowerCase()&&A==LOGEVENTS[B][1]){LOGEVENTS.splice(B,1)}}}function FireLogEvent(C,A){for(var B=0;B<LOGEVENTS.length;B++){if(A.Source.toLowerCase()==LOGEVENTS[B][0].toLowerCase()||LOGEVENTS[B][0].toLowerCase()=="all"){if(A.SupressOtherListeners==undefined||(A.SupressOtherListeners!=undefined&&!A.SupressOtherListeners)){LOGEVENTS[B][1](C,A)}}}}function SyncASyncQueue(){this.Queue=new Array();this.OnComplete;SyncASyncQueue.prototype.AddQueueItem=function(A){this.Queue.push(new SyncQueueItem(A,this))};SyncASyncQueue.prototype.Complete=function(){for(var B=0,A=this.Queue.length;B<A;B++){if(!this.Queue[B].Complete){return }}this.OnComplete();for(var B=0,A=this.Queue.length;B<A;B++){this.Queue[B].Complete=false}};SyncASyncQueue.prototype.ExecAll=function(){for(var B=0,A=this.Queue.length;B<A;B++){this.Queue[B].Exec()}}}function SyncQueueItem(B,A){this.ptrCallback=B;this.Complete=false;this.Queue=A;SyncQueueItem.prototype.Exec=function(C){this.ptrCallback(C);this.Complete=true;this.Queue.Complete()}}function Page(){this.Id;this.Title;this.ModHosts;this.LoadedCols=0;Page.prototype.Contains=function(B){if(this.ModHosts==null){return false}B=parseInt(B);for(var A=0;A<this.ModHosts.length;A++){if(this.ModHosts[A].Id==B){return true}}return false}}var BorderLayout={North:0,South:1,West:2,East:3,Center:4,PageCenter:5};var ModuleEditType={InPlace:0,Popup:1,Combined:2};function UseMod(){this.Id=0;this.ModHost;this.ClientArea;this.EditClientArea;this.IsLoaded=false;this.IsInstantiated=false;this.EditType=ModuleEditType.Popup;this.EditLocation=BorderLayout.Center;this.EditPopupWidth=-1;this.EditPopupHeight=-1;this.EditHasCloseButton=false;this.DefaultEditPopupHeight=150;this.IsReload=false;this.DoReload=function(){this.IsReload=true;this.IsLoaded=false};this.GUI=Qport.GUI();this.OnAfterLoad}UseMod.prototype.AfterLoad=function(){if(Qport.CurrentPage.Id!=this.ModHost.PageId||this.IsReload){return }if(typeof (this.OnAfterLoad)=="function"){this.OnAfterLoad(this)}this.OnAfterLoad=null;this.GUI.ModHostCompletelyLoaded(this.ModHost)};UseMod.prototype.SetEdit=function(B){if(!this.ModHost.IsEditable){var A=new LogArgs("UseMod",Q_ERROR,1);A.Add("UseMod",this.Id);Qport.Log(this,A)}else{if(this.ModHost.IsExpanded){this.ModHost.SetActive(!B)}else{if(!B&&!this.ModHost.IsExpanded){this.IsLoaded=false}}this.ModHost.Template.RenderEdit(B)}};UseMod.prototype.SetActive=function(A){if(A){if(!this.IsLoaded){this.IsLoaded=true;if(!this.IsReload){this.AfterLoad()}this.IsReload=false}}};UseMod.prototype.Init=function(A){this.ModHost=A};UseMod.prototype.CreateElement=function(C,A,B){var D=this.GUI.CreateElement(C,A,B);D.Owner=this;return D};UseMod.prototype.CreateElementBeforeFirst=function(C,A,B){var D=this.GUI.CreateElement(C,A,B,null,true);D.Owner=this;return D};UseMod.prototype.WsCall=function(B,A,F){var C=new SOAPClientParameters();for(var E in A){var D="";if(A[E]!=null&&A[E].length&&A[E].length==2&&(A[E][1]=="int"||A[E][1]=="string")){D=A[E][1];A[E]=A[E][0]}C.add(E,A[E],D)}SOAPClient.invoke(this.ModHost.WebServiceUri,B,C,true,F)};UseMod.prototype.WriteStat=function(D,A,B){if(D.length>40){alert("Stat action > 40 chars! (action:'"+D+"', itemTitle: '"+A+"')");return }var C=new SOAPClientParameters();C.add("userId",(Qport.Security.UserId>0?Qport.Security.UserId:null));C.add("moduleId",this.ModHost.ModuleId);C.add("action",D);C.add("itemTitle",A);C.add("virtualModuleId",(B)?this.Id:null);C.add("virtualModuleProviderId",(B)?B:null);SOAPClient.invoke(this.ModHost.StatsGenericWebServiceUri,"LogAction",C,true)};UseMod.prototype.Dispose=function(){Utilities.DisposeObject(this)};function ModHost(){this.ClientArea;this.UseMod;this.Id;this.PageId;this.ModuleId;this.Column;this.Row;this.ModuleArea;this.IsExpanded;this.IsEditable;this.WebServiceUri;this.StatsGenericWebServiceUri="StatsGenericService.asmx";this.RefreshRate;this.Title;this.HasHelp;this.IsVisible;this.doRunRefresher=false;this.IsInEditModus=false;this.IsMandatory;this.MandatoryCol;this.MandatoryPos;this.IsTitleEditable;this.IsDeleteable;this.IsFrontEndOnlyToggleable;this.OrgTitle;this.Template;this.IsBeingDragged=false;this.__JavascriptPropertyName=null;this.__ScriptLoadTries=0;this.__nonSerializableFieldsArray=["Template","IsBeingDragged","EditInited","IsVisible","IsInEditModus","doRunRefresher","ClientArea","ModuleArea","UseMod","__nonSerializableFields","__nonSerializableFieldsArray","WebServiceUriExtends","ScriptUriExtends"];this.EditInited=false}ModHost.prototype.IsNonSerializeableField=function(C){for(var B=0,A=this.__nonSerializableFieldsArray.length;B<A;B++){if(this.__nonSerializableFieldsArray[B]==C){return true}}return false};ModHost.prototype.Toggle=function(){if(this.IsExpanded){this.Collapse()}else{this.Expand()}};ModHost.prototype.SetVisible=function(A){this.IsVisible=A;if(this.IsExpanded){this.UseMod.IsLoaded=false;this.Template.SetVisible(this.IsVisible);this.SetActive(A)}else{this.Template.SetVisible(this.IsVisible)}};ModHost.prototype.Expand=function(){if(this.UseMod&&typeof (this.UseMod.SetActive)=="function"){this.IsExpanded=true;this.Template.Expand();if(this.RefreshRate>0){this.UseMod.IsLoaded=false}if(this.UseMod.IsInstantiated){if(this.IsToggleable){Qport.UpdateModHost(this,new Delegate(this,this.ExpandCallback))}}else{this.LaunchRefreshWatcher()}this.UseMod.SetActive(true)}else{Qport.Log(this,new LogArgs("modhost",Q_ERROR,1))}};ModHost.prototype.ExpandCallback=function(B){if(B){this.UseMod.SetActive(true);if(this.RefreshRate>0){this.UseMod.IsLoaded=false}this.LaunchRefreshWatcher();var A=new LogArgs("modhost",Q_ACTION,6);A.Add("IsExpanded",this.IsExpanded);Qport.Log(this,A)}else{if(Qport.Security.MajorEditAllowed()){Qport.Alert(L()("toggleFailed"));this.IsExpanded=false;this.UseMod.SetActive(false);this.Template.Collapse()}}};ModHost.prototype.Collapse=function(){if(this.IsMandatory){return }if(this.UseMod&&typeof (this.UseMod.SetActive)=="function"){this.IsExpanded=false;if(this.UseMod.IsInstantiated){this.Template.Collapse();if(this.IsToggleable){Qport.UpdateModHost(this,new Delegate(this,this.CollapseCallback))}}else{this.doRunRefresher=false;this.UseMod.SetActive(false);this.Template.Collapse()}}else{Qport.Log(this,new LogArgs("modhost",Q_ERROR,2))}};ModHost.prototype.CollapseCallback=function(B){if(B){this.doRunRefresher=false;this.UseMod.SetActive(false);var A=new LogArgs("modhost",Q_ACTION,6);A.Add("IsExpanded",this.IsExpanded);Qport.Log(this,A)}else{if(Qport.Security.MajorEditAllowed()){Qport.Alert(L()("toggleFailed"));this.IsExpanded=true;this.UseMod.SetActive(true);this.Template.Expand()}}};ModHost.prototype.LaunchRefreshWatcher=function(){if(this.RefreshRate>0){this.doRunRefresher=true;qTimeout.setTimeout(this.RefreshRate,new Delegate(this,this.DoRefresh))}};ModHost.prototype.DoRefresh=function(){if(this.doRunRefresher){this.UseMod.DoReload();this.UseMod.SetActive(true);qTimeout.setTimeout(this.RefreshRate,new Delegate(this,this.DoRefresh))}};ModHost.prototype.SetActive=function(A){if(this.UseMod){if(!A){this.doRunRefresher=false}else{if(!this.doRunRefresher){this.LaunchRefreshWatcher()}}if(typeof (this.UseMod.SetActive)=="function"){this.UseMod.SetActive(A)}}else{Qport.Log(this,new LogArgs("modhost",Q_ERROR,3));Qport.Alert(L()("activationFailed"))}};ModHost.prototype.SetEdit=function(edit){if(this.UseMod){if(this.IsEditable){if(edit){if(!this.UseMod.IsLoaded){this.UseMod.OnAfterLoad=new Delegate(this,this.SetEdit,edit);this.SetActive(true);return }var editurl=MHJSUriToEdit(this.ScriptUri);var editclass=MHJSToEdit(this.ClassName);if(eval("typeof("+editclass+")")=="undefined"||!this.EditInited){this.IsInEditModus=edit;if(this.UseMod.OnBeforeEditScriptLoad&&typeof (this.UseMod.OnBeforeEditScriptLoad)=="function"){this.UseMod.OnBeforeEditScriptLoad(new Delegate(this,function(){Qport.ScriptManager.Add(editclass,editurl,new Delegate(this,this.__editScriptLoaded,editclass))}))}else{Qport.ScriptManager.Add(editclass,editurl,new Delegate(this,this.__editScriptLoaded,editclass))}return }}this.IsInEditModus=edit;this.UseMod.SetEdit(edit);var args=new LogArgs("modhost",Q_ACTION,7);args.Add("IsInEditModus",edit);Qport.Log(this,args);Qport.WriteStat("module_edit",this.ClassName)}else{Qport.Log(this,new LogArgs("modhost",Q_ERROR,4))}}else{Qport.Log(this,new LogArgs("modhost",Q_ERROR,5))}};ModHost.prototype.__editScriptLoaded=function(editClass){var editPrototype=eval("new "+editClass);for(var memberName in editPrototype){if(memberName.indexOf("-")==0&&eval(this.ClassName+".prototype."+memberName)){if(window.console&&window.console.error){window.console.error("Modules.js: Member '"+memberName+"' in '"+editClass+"' replaces the member of the same name in '"+this.ClassName+"'. This is propably not what you want.")}}eval(this.ClassName+".prototype."+memberName+" = "+editClass+".prototype."+memberName)}this.EditInited=true;this.SetEdit(this.IsInEditModus)};ModHost.prototype.Disable=function(){this.Template.Disable()};ModHost.prototype.SetTitle=function(A){this.Title=A;this.Template.SetTitle(A);Qport.WriteStat("module_title_edit",this.ClassName)};ModHost.prototype.CreateElement=function(D,A,B){var C=Qport.GUI().CreateElement(D,A,B);try{C.Owner=this}catch(E){}return C};ModHost.prototype.InitModHost=function(){Qport.GUI().AddModhost(this);Qport.AddAfterLoadEvent(new Delegate(this,this.InitScript))};ModHost.prototype.InitScript=function(forceLoadCollapsed){if(this.ClassName==null){Qport.GUI().ModHostCompletelyLoaded(this)}else{if(eval("typeof("+this.ClassName+")")!="undefined"){this.AddScriptComplete()}else{if(this.IsExpanded||forceLoadCollapsed){if(Qport.BulkLoad.IsActive){Qport.BulkLoad.Register(this,this.AddScriptComplete)}else{Qport.ScriptManager.Add(this.ClassName,this.ScriptUri,new Delegate(this,this.AddScriptComplete))}}else{Qport.GUI().ModHostCompletelyLoaded(this)}}}};ModHost.prototype.AddScriptComplete=function(err){if(err){if(this.__ScriptLoadTries<2){this.__ScriptLoadTries++;this.InitScript()}else{if(this.UseMod){this.UseMod.ClientArea.innerHTML=l()("errorContentLoad")}this.__ScriptLoadTries=1;Qport.GUI().ModHostCompletelyLoaded(this)}return }this.__ScriptLoadTries=1;if(this.ClassNameExtends!=""&&eval("typeof("+this.ClassNameExtends+")")!="function"){Qport.ScriptManager.Add(this.ClassNameExtends,this.ScriptUriExtends,new Delegate(this,this.AddScriptComplete));return }if(this.UseMod&&this.UseMod.ClientArea){Browser.RemoveNode(this.UseMod.ClientArea)}this.InitUseMod();if(this.IsExpanded){this.Expand()}else{Qport.GUI().ModHostCompletelyLoaded(this)}this.UseMod.IsInstantiated=true};ModHost.prototype.InitUseMod=function(){this.UseMod=eval("new "+this.ClassName+"();");this.UseMod.Id=this.Id;this.UseMod.Init(this);if(this.ClassNameExtends&&this.ClassNameExtends!=""){this.UseMod[this.ClassNameExtends]=eval("new "+this.ClassNameExtends+"();");this.UseMod[this.ClassNameExtends].Id=this.Id;this.UseMod[this.ClassNameExtends].IsInstantiated=true;this.UseMod[this.ClassNameExtends].ModHost=this;this.UseMod[this.ClassNameExtends].IsLoaded=false}};ModHost.prototype.Dispose=function(){try{this.UseMod.Dispose()}catch(A){}this.Template.Dispose();Utilities.DisposeObject(this)};function MHJSUriToEdit(A){return A.replace(/^(.+)\.(js)$/,"$1Edit.$2")}function MHJSToEdit(A){return A+"Edit"}var qTimeout={setTimeout:function(A,B){return setTimeout(B,A)},removeTimeout:function(A){clearTimeout(A)}};function GUI(){this.ModInnerWidth=230;this.SpacingColWidth=14;this.HeaderHeight=70;this.FooterHeight=18;this.__moduleAreaPadding=15;this.ClientArea;this.Header;this.Logo;this.__div_logo_topname;this.__div_top_centerright;this.HeadButtons;this.TopActionButtons;this.ModuleArea;this.ColumnArea=new Array();this.ColumnSpacers=new Array();this.Footer;this.LoginNotifier;this.ModuleDropArea=null;this.AutoCompleteArea=null;this.TooltipArea=null;this.PageChangeArea=null;this.PopupModalDiv=null;this.PopupModalIFrame=null;this.__pageStatusDiv;this.__multiMediaPlayerArea=null;this.__trialHeader=null;this.Fancy=FancyGUI;this.ColumnCount=3;this.TotalQportHeight=0;this.TotalQportWidth=0;this.IsLoaded=false;this.modHostDoneCount=0;this.ActualWidth="";this.ActualHeight="";this.LayoutTemplateDir="js/LayoutTemplates/"+layoutTemplate+"/";this.LayoutTemplateImgDir=this.LayoutTemplateDir+"Images/";this.Colors={QportColor:defaultQportColor,PrimaryColor:defaultQportColor,SecondaryColor:defaultQportColor,SecondaryDarkColor:defaultQportColor,PrimaryTextColor:new QColor(QColor.RGB,255,255,255),SecondaryTextColor:new QColor(QColor.RGB,255,255,255)}}GUI.prototype.LoadCSSColors=function(){var B=primaryColor=secondaryColor=secondaryDarkColor=defaultQportColor;var A=secondaryTextColor=new QColor(QColor.RGB,255,255,255);if(customPrimaryColor&&(customPrimaryColor!=""||customPrimaryColor!="-")){primaryColor=new QColor(QColor.HEX,customPrimaryColor)}if(customPrimaryTextColor&&(customPrimaryTextColor!=""||customPrimaryTextColor!="-")){A=new QColor(QColor.HEX,customPrimaryTextColor)}if(customSecondaryColor&&(customSecondaryColor!=""||customSecondaryColor!="-")){secondaryColor=new QColor(QColor.HEX,customSecondaryColor)}if(customSecondaryTextColor&&(customSecondaryTextColor!=""||customSecondaryTextColor!="-")){secondaryTextColor=new QColor(QColor.HEX,customSecondaryTextColor)}this.Colors={QportColor:B,PrimaryColor:primaryColor,SecondaryColor:secondaryColor,SecondaryDarkColor:secondaryDarkColor,PrimaryTextColor:A,SecondaryTextColor:secondaryTextColor}};GUI.prototype.RenderQport=function(){if(Qport.Halt){return }this.LoadCSSColors();if(Qport.InitialLoadDiv!=null){Browser.RemoveNode(Qport.InitialLoadDiv);Qport.InitialLoadDiv=null}Qport.AddCssClass(document.body,"PrimaryBackFlex");this.ClientArea=this.CreateElement("div");this.ClientArea.style.width="100%";document.body.insertBefore(this.ClientArea,document.body.childNodes[0]);this.RenderTheme();this.Header=this.CreateElement("div",this.ClientArea);this.Header.className="header";this.Header.style.height=this.HeaderHeight+"px";this.Header.style.zIndex=Qport.ZIndex.Header;this.Header.style.borderBottom="solid 2px ";Qport.AddCssClass(this.Header,"SecondaryBorderOnlyColor");this.__div_logo_topname=this.CreateElement("div",this.Header);this.__div_logo_topname.className="div_logo_topname";if(showNameTopRight){var A=this.CreateElement("div",this.__div_logo_topname);A.className="divTopRightName";A.innerHTML=fullName}this.Logo=this.CreateElement("div",this.__div_logo_topname);this.Logo.style.width=logoWidth+"px";this.Logo.style.height=logoHeight+"px";this.Logo.className="logo"+(showNameTopRight?"":"NoTopRightName");Qport.AddCssClass(this.Logo,"SecondaryBack");Browser.SetPng(this.Logo,"Images/logo.png",null,null);Browser.SetHandCursor(this.Logo);Qport.GUI().Fancy.SetTooltip(this.Logo,L()("gotoQport"));eh.Add(this.Logo,"click",new Delegate(Qport,Qport.LogoClickEventHandler));if(doShowQuote&&Qport.UserSettings.DoShowQuote){this.__divQuote=this.CreateElement("div",this.Header);this.__divQuote.style.textAlign="center";this.__divQuote.style.position="absolute";this.__divQuote.style.left="0";this.__divQuote.style.width="100%";this.__divQuote.style.paddingTop="15px";this.__divQuote.style.height="20px";this.__lblQuote=this.CreateElement("span",this.__divQuote);if(Qport.Security.UserId>0){this.__txtQuote=this.CreateElement("input",this.__divQuote);this.__txtQuote.style.display="none";this.__txtQuote.style.width="300px";this.__txtQuote.maxLength=255;eh.Add(this.__txtQuote,"PressEnter",new Delegate(this,this.____txtQuotePressEnterEventHandler));eh.Add(this.__txtQuote,"blur",new Delegate(this,this.____txtQuoteBlurEventHandler));Browser.SetHandCursor(this.__lblQuote);Browser.SetHighLightOnMouseOver(this.__lblQuote);eh.Add(this.__lblQuote,"click",new Delegate(this,this.____lblQuoteClickEventHandler))}else{if(ShowLoginNotifier){this.__divQuote.style.textAlign="left";this.__divQuote.style.marginLeft="10px"}}this.__renderQuote()}this.HeadButtons=this.CreateElement("div",this.Header);this.HeadButtons.className="headButtons";this.__div_top_centerright=this.CreateElement("div",this.Header);this.ModuleArea=this.CreateElement("div",this.ClientArea);this.ModuleArea.style.width="100%";this.ModuleArea.style.padding=this.__moduleAreaPadding+"px";this.ModuleArea=this.ConvertToBoxedElement(this.ModuleArea).Main;this.ModuleArea.Outer.style.position="relative";this.ModuleArea.Outer.style.zIndex=Qport.ZIndex.Module;this.ModuleArea.Outer.style.overflow="hidden";this.ModuleArea.Outer.Mid.style.overflow="hidden";this.ModuleArea.style.overflow="hidden";if(isTrial){this.__trialHeader=this.CreateElement("div",this.ModuleArea);this.__trialHeader.style.backgroundColor="#FFFFFF";this.__trialHeader.style.marginRight="15px";this.__trialHeader.style.height="65px";this.__trialHeader.style.marginBottom="30px";this.__trialHeader.style.marginTop="10px";this.__trialHeader.style.padding="1px";this.__trialHeader.style.border="solid 1px ";Qport.AddCssClass(this.__trialHeader,"SecondaryBorderOnlyColor");this.__renderTrialHeader();if(trialExpired){this.__renderTrialExpired()}}for(var B=0;B<this.ColumnCount;B++){this.__addColumn()}this.Footer=this.CreateElement("div",this.ClientArea);this.Footer.className="footer";this.Footer.style.width="100%";this.Footer.style.textAlign="center";this.Footer.style.height=this.FooterHeight+"px";this.Footer.style.paddingTop="3px";this.Footer.style.borderTop="solid 1px #CCCCCC";this.Footer=this.ConvertToBoxedElement(this.Footer);this.Footer.Main.style.height="";this.Footer.style.position="absolute";this.Footer.style.zIndex=Qport.ZIndex.Footer;this.Footer.style.backgroundColor="#FFFFFF";this.__renderFooter();this.__renderFooterLocation();this.CalculateQportDimensions();this.__renderHeaderAndFooterWidth();eh.Add(Qport,"resize",new Delegate(this,this.__qportResizeEventHandler));eh.Add(Qport,"scroll",new Delegate(this,this.__qportScrollEventHandler));if(!Qport.IsVisiting()&&Qport.Security.UserId==0&&ShowPublicLoginWindow&&(Qport.Security.GetLastLoginUserId()==Qport.Security.ViewUserId)){Qport.Security.ShowLoginForm(true)}if(!showedFirstLoginMessage&&showFirstLoginMessage){this.__showFirstLoginMessage()}};GUI.prototype.__renderTrialExpired=function(){var B="trialexpired";var A=new Popup();A.Title=L(B)("title");A.Modal=true;A.Draggable=false;A.HasCloseButton=false;A.DisableEscape=true;A.NoClose=true;A.Width=300;A.Height=250;A.OnLoad=new Delegate(this,this.__trialExpiredPopupLoaded,B);A.Show()};GUI.prototype.__trialExpiredPopupLoaded=function(C,A){var B=this.CreateElement("div",A.ClientArea);B.style.height="175x";B.innerHTML=L(C)("message");B.style.marginBottom="30px";var D=this.CreateElement("button",A.ClientArea);D.value=L("trial")("subscribeBtn");D.className="floatL";eh.Add(D,"click",new Delegate(this,this.__trialExpiredBtnSubscribeClickEventHandler,A))};GUI.prototype.__trialExpiredBtnSubscribeClickEventHandler=function(A){this.__loadSubscribeControl()};GUI.prototype.____lblQuoteClickEventHandler=function(){this.__editQuote()};GUI.prototype.____txtQuoteBlurEventHandler=function(A){this.__saveQuote()};GUI.prototype.____txtQuotePressEnterEventHandler=function(A){this.__saveQuote()};GUI.prototype.__renderQuote=function(){if(userQuote!=""){this.__lblQuote.innerHTML='"'+userQuote+'"';this.__lblQuote.style.fontStyle="italic";this.__lblQuote.style.color="#000000"}else{this.__lblQuote.innerHTML=L()("defaultQuote");this.__lblQuote.style.fontStyle="normal";this.__lblQuote.style.color="#999999"}if(this.__txtQuote){this.__txtQuote.style.display="none"}this.__lblQuote.style.display="inline"};GUI.prototype.__editQuote=function(){this.__txtQuote.value=userQuote;this.__lblQuote.style.display="none";this.__txtQuote.style.display="inline";this.__txtQuote.focus();if(userQuote!=""){this.__txtQuote.select()}};GUI.prototype.__saveQuote=function(){var A=this.__txtQuote.value;A=A.replace(/'/gi,"`");if(A==userQuote){this.__renderQuote();return }this.__txtQuote.value=A;Qport.SaveQuote(A,new Delegate(this,this.__saveQuoteCallback))};GUI.prototype.__saveQuoteCallback=function(A){if(A){userQuote=this.__txtQuote.value;this.__renderQuote()}else{Qport.Alert(L()("tech"))}};GUI.prototype.__showFirstLoginMessage=function(){var A="firstloginmessage";Qport.InfoPopup(L(A)("title"),QString.Format(L(A)("welcome"),[helpdeskMail]))};GUI.prototype.__renderTrialHeader=function(){if(!isTrial){return }var E=["#FFFFFF","#EEEEEE"];var H=1;var I=(!trialExpired&&(trialExpires<10||Qport.Security.UrlInfo.IsLocal));if(trialExpires==0){I=false}if(!I){H=(H==1?0:1)}var F=this.CreateElement("div",this.__trialHeader);F.style.backgroundColor=E[H];F.style.width="80px";F.style.fontSize="11px";F.style.fontFamily="sans-serif";F.style.lineHeight="16px";this.__renderTrialButton(F,L()("alreadyMember"));H=(H==1?0:1);if(footerAbout){var B=this.CreateElement("div",this.__trialHeader);B.style.backgroundColor=E[H];B.style.width="100px";B.style.fontSize="11px";B.style.fontFamily="sans-serif";B.style.lineHeight="16px";B.style.paddingRight="2px";this.__renderTrialButton(B,L()("moreInfo"));Browser.SetHandCursor(B);eh.Add(B,"click",new Delegate(this,this.__divMoreInfoClickEventHandler));H=(H==1?0:1)}if(I){var A=this.CreateElement("div",this.__trialHeader);A.style.backgroundColor=E[H];A.style.width="155px";A.style.fontSize="11px";A.style.fontFamily="sans-serif";A.style.lineHeight="16px";A.style.paddingRight="5px";this.__renderTrialButton(A,QString.Format(L()("trialExpiration"),[trialExpires]))}var G=this.CreateElement("div",this.__trialHeader);G.innerHTML=L()("trialPageSubscribe");G.style.backgroundColor="#EEEEEE";G.className="floatL";if(I){G.style.width="240px"}else{G.style.width="400px"}G.style.fontSize="11px";G.style.fontFamily="sans-serif";G.style.lineHeight="16px";G.style.paddingRight="5px";G.style.paddingLeft="5px";G.style.height="100%";var D=this.CreateElement("div",this.__trialHeader);D.style.borderLeft="solid 1px #CCCCCC";D.className="floatL";D.style.backgroundColor="#FFFFFF";D.style.height="100%";D.style.width="150px";Browser.SetPng(D,"images/wereldbol.jpg");Qport.GUI().Fancy.SetTooltip(D,L()("trialPageSubscribe"));var C=this.CreateElement("div",D);C.style.width="117px";C.style.height="35px";Browser.SetPng(C,"images/aanmelden_button.png");C.style.marginLeft="30px";C.style.marginTop="15px";this.CreateElement("clearFloat",this.__trialHeader);Browser.SetHandCursor(F);Browser.SetHandCursor(D);eh.Add(F,"click",new Delegate(this,this.__divAlreadyMemberClickEventHandler));eh.Add(D,"click",new Delegate(this,this.__divDoSubscribeClickEventHandler));eh.Add(C,"mouseover",new Delegate(this,this.__imgDoSubscribeMouseOverEventHandler,C));eh.Add(C,"mouseout",new Delegate(this,this.__imgDoSubscribeMouseOutEventHandler,C))};GUI.prototype.__imgDoSubscribeMouseOverEventHandler=function(A){Browser.SetPng(A,"images/aanmelden_button_over.png")};GUI.prototype.__imgDoSubscribeMouseOutEventHandler=function(A){Browser.SetPng(A,"images/aanmelden_button.png")};GUI.prototype.__divAlreadyMemberClickEventHandler=function(){Qport.Security.ShowLoginForm(true,true)};GUI.prototype.__divMoreInfoClickEventHandler=function(){var A=new Popup();A.Title=productName;A.Modal=true;A.Draggable=true;A.Width=500;A.Height=400;A.OnLoad=new Delegate(this,this.__moreInfoPopupOnLoad);A.HasCloseButton=true;A.Show()};GUI.prototype.__moreInfoPopupOnLoad=function(A){A.ClientArea.innerHTML=L("trial")("moreInfo")};GUI.prototype.__divDoSubscribeClickEventHandler=function(){this.__loadSubscribeControl()};GUI.prototype.__loadSubscribeControl=function(){Qport.ScriptManager.Add("SubscribeControl","js/SubscribeControl.js",new Delegate(this,this.__subscribeControlLoaded))};GUI.prototype.__subscribeControlLoaded=function(){var A=new SubscribeControl();A.Show()};GUI.prototype.__renderTrialButton=function(B,A){B.className="floatR";B.innerHTML=A;B.style.borderLeft="solid 1px #CCCCCC";B.style.paddingLeft="10px";B.style.height="100%"};GUI.prototype.GetHeight=function(){var D=0;for(var C=0;C<this.ColumnArea.length;C++){var B=this.ColumnArea[C].offsetHeight+Browser.GetAbsoluteTop(this.ColumnArea[C]);if(D<B){D=B}}var A=Browser.GetWindowHeight();if(D<A){D=A}return D};GUI.prototype.ReRender=function(B){if(moduleBeingDragged&&!B){return }Qport.SortModHosts();if(this.ColumnCount>this.ColumnArea.length){for(var A=this.ColumnArea.length;A<this.ColumnCount;A++){this.__addColumn()}}for(var A=0;A<Qport.CurrentPage.ModHosts.length;A++){Qport.CurrentPage.ModHosts[A].Template.ReRender(this.ColumnArea[Qport.CurrentPage.ModHosts[A].Column])}while(this.ColumnCount<this.ColumnArea.length){this.__removeColumn(this.ColumnArea.length-1)}};GUI.prototype.__resetColumnsWidth=function(){if(!this.ModuleArea){return }this.TotalQportWidth=0;for(var A=0;A<this.ColumnArea.length;A++){var B=this.__getColumnWidth(A);this.ColumnArea[A].style.width=B+"px";this.TotalQportWidth+=B}this.TotalQportWidth+=(this.ColumnArea.length-1)*this.SpacingColWidth;this.__rerenderModuleAreaWidth()};GUI.prototype.__addColumn=function(){var B=this.ColumnArea.length;if(B>0){var D=this.CreateElement("div",this.ModuleArea);D.style.width=this.SpacingColWidth+"px";D.style.height="100%";D.className="floatL";D.innerHTML="&nbsp;";this.ColumnSpacers[B]=D;this.TotalQportWidth+=this.SpacingColWidth}var C=this.__getColumnWidth(B);var A=this.CreateElement("div",this.ModuleArea);A.style.width=C+"px";A.style.height="100%";A.className="floatL";A.style.minHeight="1px";this.ColumnArea[B]=A;this.ColumnArea[B].wasEmpty=true;this.TotalQportWidth+=C;this.__rerenderModuleAreaWidth();this.__reRender()};GUI.prototype.__removeColumn=function(A){this.TotalQportWidth-=this.SpacingColWidth;this.TotalQportWidth-=this.__getColumnWidth(A);Browser.RemoveNode(this.ColumnArea[A]);Browser.RemoveNode(this.ColumnSpacers[A]);this.ColumnSpacers.splice(A,1);this.ColumnArea.splice(A,1);this.__rerenderModuleAreaWidth();this.__reRender()};GUI.prototype.__rerenderModuleAreaWidth=function(){this.ModuleArea.Outer.style.width=this.TotalQportWidth+(this.__moduleAreaPadding*2)+10+"px"};GUI.prototype.__getColumnWidth=function(A){if(Qport.CurrentPage.ColsWidth){for(var B=0;B<Qport.CurrentPage.ColsWidth.length;B++){if(Qport.CurrentPage.ColsWidth[B][0]==A){return Qport.CurrentPage.ColsWidth[B][1]}}}return 253};GUI.prototype.__renderFooter=function(){var A=false;if(footerRightsReserved){var G=this.CreateElement("a",this.Footer.Main);G.innerHTML=L()("copyright");G.href=Qport.GetSiteUrl();G.target="_blank";Qport.GUI().Fancy.SetTooltip(G,L()("copyright"));A=true}if(footerPrivacy){if(A){this.CreateElement("textnode",this.Footer.Main).data=" | "}var B=this.CreateElement("div",this.Footer.Main);Browser.SetHandCursor(B);Qport.GUI().Fancy.SetTooltip(B,L()("privacy"));B.style.display="inline";B.innerHTML=L()("privacy");eh.Add(B,"click",new Delegate(Qport,Qport.PrivacyClickEventHandler));A=true}if(footerTerms){if(A){this.CreateElement("textnode",this.Footer.Main).data=" | "}var E=this.CreateElement("div",this.Footer.Main);Browser.SetHandCursor(E);Qport.GUI().Fancy.SetTooltip(E,L()("av"));E.style.display="inline";E.innerHTML=L()("av");eh.Add(E,"click",new Delegate(Qport,Qport.AVClickEventHandler));A=true}if(footerAbout){if(A){this.CreateElement("textnode",this.Footer.Main).data=" | "}var D=this.CreateElement("a",this.Footer.Main);D.innerHTML=L()("aboutqport");Qport.GUI().Fancy.SetTooltip(D,L()("aboutqport"));D.href=Qport.GetSiteUrl();D.target="_blank";A=true}if(footerSupportContact){if(A){this.CreateElement("textnode",this.Footer.Main).data=" | "}var C=this.CreateElement("a",this.Footer.Main);C.innerHTML=L()("support");Qport.GUI().Fancy.SetTooltip(C,L()("support"));C.href="mailto:"+helpdeskMail;A=true}if(footerStartpage){if(A){this.CreateElement("textnode",this.Footer.Main).data=" | "}var F=this.CreateElement("div",this.Footer.Main);F.style.display="inline";Browser.SetHandCursor(F);F.innerHTML=L()("btnStartpage");Qport.GUI().Fancy.SetTooltip(F,L()("btnStartpage"));eh.Add(F,"click",new Delegate(Qport,Qport.StartpageClickEventHandler,F));A=true}if(footerByQport){if(A){this.CreateElement("textnode",this.Footer.Main).data=" | "}var D=this.CreateElement("a",this.Footer.Main);D.innerHTML=L()("byqport");Qport.GUI().Fancy.SetTooltip(D,L()("byqportTT"));D.href=L()("byqporturl");D.target="_blank"}};GUI.prototype.__qportScrollEventHandler=function(A){this.__reRender()};GUI.prototype.__qportResizeEventHandler=function(A){this.Header.scrollIntoView(true);this.__reRender()};GUI.prototype.__reRender=function(){this.CalculateQportDimensions();this.__renderFooterLocation();this.RenderWatermarkLocation();this.RenderWatermarkRepeat();this.__renderHeaderAndFooterWidth();qTimeout.setTimeout(150,new Delegate(this,this.__renderFooterLocation));qTimeout.setTimeout(150,new Delegate(this,this.RenderWatermarkLocation))};GUI.prototype.CalculateQportDimensions=function(){this.ActualHeight=this.GetHeight()+"px";if(this.ModuleArea){var C=this.ModuleArea.Outer.offsetWidth;var A=Browser.GetWindowWidth();if(C>=A){this.ActualWidth=C+"px"}var B=(this.HeadButtons.offsetWidth+this.__div_logo_topname.offsetWidth)+90;if(B>=C){this.ActualWidth=B+"px"}if(A>C&&A>B){this.ActualWidth=A+"px"}}else{this.ActualWidth="100%"}};GUI.prototype.__renderHeaderAndFooterWidth=function(){if(this.Footer){this.Footer.style.width=this.ActualWidth}if(this.Header){this.Header.style.width=this.ActualWidth}};GUI.prototype.__renderFooterLocation=function(){if(this.Footer){this.Footer.style.top=(Browser.GetWindowHeight()-this.FooterHeight)+Browser.GetScrolltop()+"px"}};GUI.prototype.RenderHeadButtons=function(){if(Qport.Halt){return }if(Qport.Pages==null){Qport.DoHalt();return }for(var G=0;G<Qport.Pages.length;G++){this.AddPage(Qport.Pages[G])}if(Qport.Security.SecurityGroup==SecurityGroup.Admin){var B=this.AddTab("+");B.SetTooltip(L()("addPage"));eh.Add(B,"click",new Delegate(Qport,Qport.TabAddClickEventHandler));eh.Add(B,"mouseover",function(){this.Select()});eh.Add(B,"mouseout",function(){this.Deselect()});var C=this.AddTopButton(L()("addModule"),L()("addModDesc"));eh.Add(C,"click",new Delegate(Qport,Qport.AddModuleClickEventHandler));if(rssEnabled){var D=this.AddTopButton(L()("addRss"),L()("addRssDesc"));eh.Add(D,"click",new Delegate(Qport,Qport.AddRssClickEventHandler))}var K=this.AddTopButton(L()("settings"),L()("settDesc"));eh.Add(K,"click",new Delegate(Qport,Qport.BtnSettingsClickEventHandler));if(showShareButton){var E=this.AddTopButton(L()("tellafriend"),L()("tellafriendtt"));eh.Add(E,"click",new Delegate(Qport,Qport.BtnTellAFriendClickEventHandler))}}if(Qport.Security.GenericHelpAllowed()){var A=this.AddTopButton(L()("help"),L()("hlpDesc"));eh.Add(A,"click",new Delegate(Qport,Qport.HelpClickEventHandler))}if(!isTrial&&!DO_URL_AND_IP_AUTHENTICATION&&!USE_ACTIVE_DIRECTORY_LOGIN){if(Qport.Security.SecurityGroup==SecurityGroup.Public){var I=this.AddTopButton(L()("login"),L()("loginDesc"));eh.Add(I,"click",new Delegate(Qport,Qport.LoginClickEventHandler));if(ShowLoginNotifier&&!Qport.IsVisiting()){this.LoginNotifier=this.CreateElement("div",this.Header);this.LoginNotifier.className="loginNotifier";var J=this.CreateElement("div",this.LoginNotifier);Qport.AddCssClass(J,"SecondaryBack");J.className="loginNotifierImg";Browser.SetPng(J,"Images/transparentloginnotifier.png");var F=this.CreateElement("div",J);F.className="loginNotifierText";F.innerHTML=QString.Format(L()("loginNotifier"),[fullName])}}else{var H=this.AddTopButton(L()("logout"),L()("logoutDesc"));eh.Add(H,"click",new Delegate(Qport,Qport.LogoutClickEventHandler))}}this.CreateElement("clearFloat",this.Header);this.__reRender()};GUI.prototype.AddPage=function(page,callback,insertIndex){var tab=eval("new "+layoutTemplate+"TabPageTemplate();");tab.Init(page,this.HeadButtons,insertIndex);tab.Render();this.HeadButtons.style.marginTop=(this.HeaderHeight-26)+"px";if(typeof (callback)=="function"){callback()}};GUI.prototype.AddTab=function(title){var tab=eval("new "+layoutTemplate+"TabTemplate();");tab.Init(this.HeadButtons);tab.Render();tab.SetTitle(title);return tab};GUI.prototype.AddTopButton=function(E,D){var C=false;if(!this.TopActionButtons){this.TopActionButtons=this.CreateElement("div",this.HeadButtons);this.TopActionButtons.className="topActionButtons";C=true}if(!C){var A=this.CreateElement("img",this.TopActionButtons);A.src="Images/dotsm.jpg";A.className="topActionButtonSeparator"}var B=this.CreateElement("span",this.TopActionButtons);Browser.SetHandCursor(B);B.className="topActionButton";B.innerHTML=E;this.Fancy.SetTooltip(B,D);this.TopActionButtons.style.marginTop=(this.HeadButtons.offsetHeight-this.TopActionButtons.offsetHeight)+"px";return B};GUI.prototype.AddModhost=function(modHost){if(Qport.Halt){return }var mod=eval("new "+layoutTemplate+"ModuleTemplate();");mod.Init(modHost,this.ColumnArea[modHost.Column]);mod.Render();this.CheckIfUseMods()};GUI.prototype.ModHostCompletelyLoaded=function(C){if(C!=null){this.modHostDoneCount++}if(!this.IsLoaded&&Qport.CurrentPage.ModHosts&&Qport.CurrentPage.ModHosts.length>=0&&this.modHostDoneCount>=Qport.CurrentPage.ModHosts.length&&Qport.CurrentPage.LoadedCols>=Qport.UserSettings.Columns){this.IsLoaded=true;this.modHostDoneCount=0;Qport.OnColorChange(true);if(Qport.CurrentPage.ModHosts.length>0){var A=new SyncASyncQueue();for(var B=0;B<Qport.CurrentPage.ModHosts.length;B++){var C=Qport.CurrentPage.ModHosts[B];if(!C.IsExpanded){A.AddQueueItem(new Delegate(C,C.InitScript,true))}}A.OnComplete=function(){var F=Qport.CurrentPage.ModHosts;for(var E=0,D=F.length;E<D;E++){if(F[E].IsEditable&&Qport.Security.SecurityGroup==SecurityGroup.Admin){Qport.ScriptManager.Add(MHJSToEdit(F[E].ClassName),MHJSUriToEdit(F[E].ScriptUri),function(){})}if(!F[E].IsExpanded&&F[E].LangFile.length>0){L(F[E].LangFile.toLowerCase())}}Qport.UserSettingsLoad();Qport.ScriptManager.Add("AddPageLoader","js/AddPage.js",function(){});L("settings")("genericSettings")};A.ExecAll()}this.__reRender()}};GUI.prototype.SetPageStatus=function(B,A){if(this.__pageStatusDiv==null){this.__pageStatusDiv=this.CreateElement("div",this.ClientArea);this.__pageStatusDiv.style.position="absolute";this.__pageStatusDiv.style.left="50px"}if(B){this.__pageStatusDiv.innerHTML=A;this.__pageStatusDiv.style.display="block";Qport.AddCssClass(this.__pageStatusDiv,"SecondaryFore");this.SetDimensions(this.__pageStatusDiv,300,200)}else{this.__pageStatusDiv.style.display="none"}};GUI.prototype.CheckIfUseMods=function(){if(!this.IsLoaded){return }var B=false;if(this.IsLoaded&&Qport.CurrentPage.ModHosts.length==0){B=true}if(moduleBeingDragged){B=false}var A="";if(Qport.Security.SecurityGroup==SecurityGroup.Public){A=L()("noUseModsLoggedout")}else{A=L()("noUseModsLoggedin")}this.SetPageStatus(B,A);return !B};GUI.prototype.RenderWatermarkLocation=function(){if(!this.watermarkDiv){return }var H,G,C,F;if(Qport.UserSettings.Theme){if(!Qport.UserSettings.Theme.Watermark){return }H=Qport.UserSettings.Theme.WatermarkLocation;G=Qport.UserSettings.Theme.HasWhiteBackground;C=Qport.UserSettings.Theme.WatermarkShowOriginal;F=Qport.UserSettings.Theme.Watermark.Height}else{if(!Qport.UserSettings.Watermark){return }H=Qport.UserSettings.WatermarkLocation;G=Qport.UserSettings.HasWhiteBackground;C=Qport.UserSettings.WatermarkShowOriginal;F=Qport.UserSettings.Watermark.Height}this.watermarkDiv.style.display="none";this.watermarkBG.style.display="none";var E,B,D,A;switch(H){default:case"BottomRight":E="";if(this.Footer){D=(parseInt(this.Footer.style.top)-F)+"px";A=""}else{D="";A=this.FooterHeight+"px"}B="0px";break;case"TopRight":E="";B="0px";A="";D=(this.HeaderHeight+2)+"px";break;case"BottomLeft":B="";if(this.Footer){D=(parseInt(this.Footer.style.top)-F)+"px";A=""}else{D="";A=this.FooterHeight+"px"}E="0px";break;case"TopLeft":B="";A="";E="0px";D=(this.HeaderHeight+2)+"px";break}this.watermarkDiv.style.top=D;this.watermarkDiv.style.left=E;this.watermarkDiv.style.right=B;this.watermarkDiv.style.bottom=A;this.watermarkDiv.style.display="block";if(G&&!C){this.watermarkBG.style.display="block"}else{this.watermarkBG.style.display="none"}};GUI.prototype.RenderWatermarkRepeat=function(){var A=Qport.UserSettings.WatermarkRepeat;var B=this.watermarkDiv;switch(A){case"X":this.wmImage.style.backgroundRepeat="repeat-x";B.style.width=Browser.GetWindowWidth()+"px";break;case"Y":this.wmImage.style.backgroundRepeat="repeat-y";B.style.height=this.CalculateQportBackgroundHeight()+"px";break;case"Both":this.wmImage.style.backgroundRepeat="repeat";B.style.width=Browser.GetWindowWidth()+"px";B.style.height=this.CalculateQportBackgroundHeight()+"px";break;case"None":default:this.wmImage.style.backgroundRepeat="no-repeat";break}};GUI.prototype.RenderWatermark=function(A,F,E,C,D){if(A==null||A==""||E=="None"){if(this.watermarkDiv){this.watermarkDiv.style.display="none"}return }this.watermarkDiv.style.display="none";if(A.Width<=Browser.GetWindowWidth()){this.watermarkDiv.style.width=A.Width+"px"}else{this.watermarkDiv.style.width=Browser.GetWindowWidth()+"px"}this.watermarkDiv.style.height=A.Height+"px";var B=this.__getWatermarkUrl(A,D,F);Browser.SetPng(this.wmImage,B);this.RenderWatermarkLocation();this.RenderWatermarkRepeat()};GUI.prototype.__getWatermarkUrl=function(A,D,E){var C=A.Filename;if(!D){if(E){C+="_white"}else{C+="_color"}}var B="watermark";if(A.UserId>0){B+="/users"}C=B+"/"+C+".png";return C};GUI.prototype.RenderTheme=function(A){if(!A){A=Qport.UserSettings.Theme}if(!A){A={HasWhiteBackground:Qport.UserSettings.HasWhiteBackground,Watermark:Qport.UserSettings.Watermark,WatermarkLocation:Qport.UserSettings.WatermarkLocation,WatermarkRepeat:Qport.UserSettings.WatermarkRepeat,WatermarkShowOriginal:Qport.UserSettings.WatermarkShowOriginal,Color:{Hue:Qport.UserSettings.Color.Hue,Saturation:Qport.UserSettings.Color.Saturation,Value:Qport.UserSettings.Color.Value}}}if(!this.watermarkDiv){this.watermarkDiv=this.CreateElement("div",Qport.GUI().ClientArea);this.watermarkDiv.style.position="absolute";this.watermarkDiv.style.display="none";this.watermarkBG=this.CreateElement("div",this.watermarkDiv);this.watermarkBG.style.width="100%";this.watermarkBG.style.height="100%";this.watermarkBG.style.position="absolute";this.watermarkBG.style.zIndex=Qport.ZIndex.Normal;Qport.AddCssClass(this.watermarkBG,"SecondaryBack");this.wmImage=this.CreateElement("div",this.watermarkDiv);this.wmImage.style.width="100%";this.wmImage.style.height="100%";this.wmImage.style.zIndex=Qport.ZIndex.WatermarkImage;this.wmImage.id="wmImage"}this.RenderWatermark(A.Watermark,A.HasWhiteBackground,A.WatermarkLocation,A.WatermarkRepeat,A.WatermarkShowOriginal);Qport.UserSettings.Color.Hue=A.Color.Hue;Qport.UserSettings.Color.Saturation=A.Color.Saturation;Qport.UserSettings.Color.Value=A.Color.Value;Qport.OnColorChange(true)};GUI.prototype.ReloadColors=function(){if(!Qport.UserSettings){return }this.LoadCSSColors();var B=Qport.UserSettings.Color;var A=Utilities.ColorCalc("PrimaryText",B.Hue,B.Saturation,B.Value);if(customPrimaryColor&&(customPrimaryColor!=""&&customPrimaryColor!="-")){this.Colors.PrimaryColor=new QColor(QColor.HEX,customPrimaryColor)}else{this.Colors.PrimaryColor=Utilities.ColorCalc("Primary",B.Hue,B.Saturation,B.Value)}if(customPrimaryTextColor&&(customPrimaryTextColor!=""&&customPrimaryTextColor!="-")){this.Colors.PrimaryTextColor=new QColor(QColor.HEX,customPrimaryTextColor)}else{this.Colors.PrimaryTextColor=new QColor(QColor.RGB,0,0,0)}if(customSecondaryColor&&(customSecondaryColor!=""&&customSecondaryColor!="-")){this.Colors.SecondaryColor=new QColor(QColor.HEX,customSecondaryColor)}else{this.Colors.SecondaryColor=Utilities.ColorCalc("Secondary",B.Hue,B.Saturation,B.Value)}if(customSecondaryTextColor&&(customSecondaryTextColor!=""&&customSecondaryTextColor!="-")){this.Colors.SecondaryTextColor=new QColor(QColor.HEX,customSecondaryTextColor)}else{A=Utilities.ColorCalc("SecondaryText",B.Hue,B.Saturation,B.Value);this.Colors.SecondaryTextColor.SetRGB(A[0],A[1],A[2])}this.Colors.SecondaryDarkColor=Utilities.ColorCalc("SecondaryDark",B.Hue,B.Saturation,B.Value)};GUI.prototype.SetDimensions=function(C,A,B){if(C){C.style.width=A+"px";C.style.height=B+"px"}};GUI.prototype.SetLocation=function(B,A,C){if(B){B.style.left=A+"px";B.style.top=C+"px"}};GUI.prototype.CreateTable=function(G,F,A){var C=Browser.CreateElement("table");var E=Browser.CreateElement("tbody");C.appendChild(E);C.style.width="100%";var H=new QTable(E);H.HTMLTable=C;C.cellSpacing="0px";C.cellPadding="0px";if(G){var I;for(var D=0;D<G;D++){I=H.AddRow();if(F){for(var B=0;B<F;B++){I.AddCell()}}}}if(A){A.appendChild(C)}return H};GUI.prototype.CreateElement=function(I,B,A,C,H){var D=Qport.GUI();if(!D.Colors.SecondaryColor){D.ReloadColors()}if(!C){C=""}var F=I.toLowerCase();var G=null;if(F=="textnode"){G=Browser.CreateTextNode()}else{if(F=="clearfloat"){G=Browser.CreateElement("div");G.style.clear="both"}else{var E=F;switch(F){case"checkbox":case"password":case"button":case"textfield":case"hidden":E="input";break}var G=Browser.CreateElement(E,A);G.lt=F;switch(F){case"input":G.className="qinput";if(C.length==0){G.style.border="solid 1px #000000"}else{G.style.border="solid 1px "+C}break;case"button":G.type="button";G.style.fontFamily="sans-serif";G.style.fontSize="11px";G.style.color="#444444";break;case"checkbox":G.type="checkbox";break;case"textfield":G.type="text";G.className="qinput";if(C.length==0){G.style.border="solid 1px #CCCCCC"}else{G.style.border="solid 1px "+C}break;case"hidden":G.type="hidden";break;case"password":G.type="password";G.className="qinput";if(C.length==0){G.style.border="solid 1px #CCCCCC"}else{G.style.border="solid 1px "+C}break;case"textarea":if(C.length==0){G.style.border="inset 1px #CCCCCC"}else{G.style.border="inset 1px "+C}break;case"select":G.style.backgroundColor="#FFFFFF";break}switch(F){case"input":case"textfield":case"select":case"textarea":case"password":Browser.EnterEventAttach(G);eh.Add(G,"focus",function(){G.style.border="solid 1px "+Qport.GUI().Colors.SecondaryColor.ToCssString()});eh.Add(G,"blur",function(){var J="#CCCCCC";if(C.length==0){G.style.border="solid 1px "+J}else{G.style.border="solid 1px "+C}});break}switch(F){case"fieldset":G.type="fieldset";G.style.padding="4px";G.style.paddingTop="0px";G.style.margin="0px";G.legend=Browser.CreateElement("legend");G.appendChild(G.legend);G.legend.align="left";G.legend.style.fontWeight="bold";G.legend.style.color="#000000"}}}if(B){if(H){B.insertBefore(G,B.firstChild)}else{B.appendChild(G)}}return G};GUI.prototype.AddHR=function(B){var A=this.CreateElement("hr");A.style.height="1px";Qport.AddCssClass(A,"SecondaryFore");B.appendChild(A)};GUI.prototype.ConvertToBoxedElement=function(E){var C=this.CreateElement("div",E.parentNode);var B=this.CreateElement("div",C);C.style.width=E.style.width;C.style.height=E.style.height;E.style.width="100%";E.style.height="100%";if(E.className.length>5&&E.className.substring(0,5).toLowerCase()=="float"){C.className=E.className;E.className=""}if(E.style.padding!=""){B.style.padding=E.style.padding}else{B.style.paddingLeft=E.style.paddingLeft;B.style.paddingRight=E.style.paddingRight;B.style.paddingTop=E.style.paddingTop;B.style.paddingBottom=E.style.paddingBottom}if(E.tagName.toLowerCase()=="input"){var D=B.parentNode;while(D&&D.style.padding==""&&D.style.paddingRight==""){D=D.parentNode}B.style.paddingRight=(D.style.paddingRight!=""?D.style.paddingRight:D.style.padding)}if(E.style.margin!=""){B.style.margin=E.style.margin}else{B.style.marginLeft=E.style.marginLeft;B.style.marginRight=E.style.marginRight;B.style.marginTop=E.style.marginTop;B.style.marginBottom=E.style.marginBottom}E.style.padding="";E.style.margin="";var A=E.tagName.toLowerCase();if(A!="input"&&A!="select"&&A!="textarea"&&A!="fieldset"){if(E.style.borderLeft!=""||E.style.borderRight!=""||E.style.borderTop!=""||E.style.borderBottom!=""){B.style.borderLeft=E.style.borderLeft;B.style.borderRight=E.style.borderRight;B.style.borderTop=E.style.borderTop;B.style.borderBottom=E.style.borderBottom;E.style.borderLeft="";E.style.borderRight="";E.style.borderTop="";E.style.borderBottom=""}else{B.style.border=E.style.border;E.style.border=""}}E.parentNode.insertBefore(C,E);B.appendChild(E);C.Main=E;C.Mid=B;E.Outer=C;return C};GUI.prototype.RenderMultiMediaControl=function(B,C){var D=240;var A=20;if(!this.__multiMediaPlayerArea){this.__multiMediaPlayerArea=this.CreateElement("div",this.Header);this.__multiMediaPlayerArea.style.position="absolute";this.__multiMediaPlayerArea.style.top="5px";this.__multiMediaPlayerArea.style.left=((Browser.GetWindowWidth()/2)-(D/2))+"px";this.__multiMediaPlayerArea.style.zIndex=Qport.ZIndex.Supreme;eh.Add(Qport,"resize",new Delegate(this,this.__browserResizeRerenderMultiMediaControlHandler,D));B.Render(this.__multiMediaPlayerArea,D,A)}B.Play(C)};GUI.prototype.__browserResizeRerenderMultiMediaControlHandler=function(A,B){this.__multiMediaPlayerArea.style.left=((Browser.GetWindowWidth()/2)-(A/2))+"px"};GUI.prototype.CreateExtraHeaderField=function(){var A=this.CreateElement("div",this.__div_top_centerright);A.style.marginTop="10px";return A};GUI.prototype.Dispose=function(){Utilities.DisposeObject(this)};GUI.prototype.CalculateQportBackgroundHeight=function(){var A=0;if(document.body.scrollHeight>Browser.GetWindowHeight()){A=document.body.scrollHeight-this.HeaderHeight-this.FooterHeight}else{A=Browser.GetWindowHeight()-this.HeaderHeight-this.FooterHeight}return A};var QportScriptManager={_scripts:[],_simpleScripts:new Object(),_sameSrc:[],_loadedStack:[],IsLoading:false,_timeout:7500,_timeoutBig:12500,Exists:function(A){return(this._scripts[A]!=null||this._loadedStack[A]!=null)},AddThirdParty:function(src,functionCheck,callback){if(eval("typeof("+functionCheck+")")=="function"){if(typeof (callback)=="function"){callback()}}else{if(!this._simpleScripts[functionCheck]){var scriptElem=document.createElement("script");scriptElem.type="text/javascript";scriptElem.src=src;document.getElementsByTagName("head")[0].appendChild(scriptElem)}var o=this;qTimeout.setTimeout(250,function(){o.AddThirdParty(src,functionCheck,callback)})}},Add:function(D,C,F,E){if(D!=null&&!this.Exists(D)){this._scripts[D]=new Object();var B=document.createElement("script");B.type="text/javascript";if(!Qport.Security.UrlInfo.IsLocal){var A=new RegExp(/^(.+)\.js$/);if(C.match(A)){C=C.replace(A,"$1-"+qportversion+".js")}}B.futureSrc=C;B.srcLoaded=false;B.callback=F;B.isBig=E;this._scripts[D]=B;this.LoadSources()}else{if(this._loadedStack[D]!=null){F()}else{if(!this._sameSrc[D]){this._sameSrc[D]=new Array()}this._sameSrc[D].push(F)}}},Loaded:function(className){if(this._scripts[className]==null){return }this.IsLoading=false;this._scripts[className].srcLoaded=true;this._loadedStack[className]=true;this.LoadSources();if(eval("typeof("+className+")")!="undefined"){this._scripts[className].callback()}else{this._scripts[className].callback(true)}if(this._sameSrc[className]){for(var i=0,len=this._sameSrc[className].length;i<len;i++){if(this._sameSrc[className][i]!=null){this._sameSrc[className][i]();this._sameSrc[className][i]=null}}}this._scripts[className].callback=null;this._scripts[className]=null},CheckTimeout:function(){var B=new Date();for(var A in this._scripts){if(this._scripts[A]==null){continue}var C=this._scripts[A];if(C.tagName!=undefined&&C.tagName.toLowerCase()=="script"&&!this._loadedStack[A]&&!C.srcLoaded&&C.startT!=undefined&&(B.valueOf()-C.startT.valueOf())>=(C.isBig?this._timeoutBig:this._timeout)){this.IsLoading=false;C.srcLoaded=true;C.callback=null;this._scripts[A]=null;this.LoadSources()}}},LoadSources:function(){if(this.IsLoading){return }for(var B in this._scripts){if(this._scripts[B]==null){continue}var C=this._scripts[B];if(!C.srcLoaded&&!this.IsLoading&&C.futureSrc){this.IsLoading=true;C.src=C.futureSrc;C.startT=new Date();document.getElementsByTagName("head")[0].appendChild(C);var A=this._timeout;if(C.isBig){A=this._timeoutBig}qTimeout.setTimeout(A,function(){QportScriptManager.CheckTimeout()});return }}}};var SecurityContext={SessionHash:null,UserId:null,UserName:null,ViewUserName:null,UrlInfo:null,ViewUserId:null,ViewUserName:null,SessionId:0,SessionAcquired:0,IsCompany:false,SecurityGroup:null,ws:"Authenticate.asmx",wsLogin:"DoLogin",wsLoginPublic:"DoLoginPublic",wsLoginCookie:"DoLoginCookie",wsIsAuth:"IsAuthenticated",wsRefresh:"RefreshSession",lsep:"0x23",quqi:"0x07",permQuqi:"0xA2",usernameQuqi:"qun",lastLoginUserId:"lli",HasShownUnAuthMess:false,SessionRefresh:-1,OR:false,ORV:false,SessionLastRefresh:new Date(),GetUserDomain:function(){return"http://"+this.UrlInfo.UserUrl},GetCookieDomain:function(){return Qport.Security.UrlInfo.CookieUrl},GetLastLoginUserId:function(){var A=Browser.Cookie.Get(this.lastLoginUserId);if(A!=null){return parseInt(A)}else{return -1}},RemoveLoginCookie:function(B,A){if(this.IsInLoginCookie(B)){Browser.Cookie.Remove(this.quqi+B,"/",Qport.Security.GetCookieDomain())}if(this.IsInPermLoginCookie(B)&&!A){Browser.Cookie.Remove(this.permQuqi+B,"/",Qport.Security.GetCookieDomain())}if(this.IsInUserNameCookie()&&!A){Browser.Cookie.Remove(this.usernameQuqi,"/",Qport.Security.GetCookieDomain())}},RemoveUserNameCookie:function(){Browser.Cookie.Remove(this.usernameQuqi,"/",Qport.Security.GetCookieDomain())},IsInLoginCookie:function(A){return(Browser.Cookie.Get(this.quqi+A)!=null)},IsInPermLoginCookie:function(A){return(Browser.Cookie.Get(this.permQuqi+A)!=null)},IsInUserNameCookie:function(){return(Browser.Cookie.Get(this.usernameQuqi)!=null)},IsAuthenticated:function(){if(Qport.Security.UserName==siteSubdomain){document.location=("/"+sitePath)}else{if(this.OR){var A=this.ORV;this.OR=false;this.ORV=false;if(A){Qport.Security.RefreshSession();AttachLogEvent("soapclient",Qport.Security.CheckIsLoggedin)}return A}else{return false}}},AcAllowed:function(){return(Qport.Security.UserId>0)},MajorEditAllowed:function(){return Qport.Security.SecurityGroup==SecurityGroup.Admin},GenericHelpAllowed:function(){return Qport.Security.SecurityGroup==SecurityGroup.Admin&&showHelpButton},ModuleHelpAllowed:function(){return Qport.Security.SecurityGroup==SecurityGroup.Admin},PreSelectAllowed:function(A){if(A=="set"){return Qport.Security.SecurityGroup==SecurityGroup.Admin}else{if(A=="get"){return Qport.Security.SecurityGroup!=SecurityGroup.None}else{return false}}},AddModuleAllowed:function(){return Qport.Security.SecurityGroup==SecurityGroup.Admin},ShowLoginForm:function(A,B){if(!Qport.IsLoaded){document.body.style.backgroundColor="#FFFFFF"}var E=new Popup();E.Title=L()("loginTitle");if(!B&&Qport.Security.UserName!=loginFormUserName){E.Title+=" "+Qport.Security.ViewUserName}E.Width=325;E.Height=275;E.Modal=true;E.Draggable=true;E.DisableEscape=true;E.NoClose=true;var D=Qport.GUI().Colors.QportColor;var C=Utilities.ColorCalc("Secondary",D.Hue,D.Saturation,D.Value);E.MasterColor=C.ToCssString();E.OnLoad=function(F){var H=Qport.GUI().CreateTable(4,1,F.ClientArea);H.HTMLTable.style.width="315px";H.HTMLTable.cellSpacing="2px";H.HTMLTable.cellPadding="0px";H.Row(0).AddCell();H.Row(1).AddCell();H.Row(2).Cell(0).colSpan=2;H.Row(3).Cell(0).colSpan=2;H.Row(0).Cell(1).style.textAlign="right";H.Row(1).Cell(1).style.textAlign="right";H.Row(3).Cell(0).style.textAlign="right";H.Row(0).Cell(0).innerHTML=L()("username");H.Row(1).Cell(0).innerHTML=L()("password");var J=F.CreateElement("textfield",H.Row(0).Cell(1));J.style.width="150px";F.txtUsername=J;var O=F.CreateElement("password",H.Row(1).Cell(1));O.style.width="150px";F.txtPassword=O;if(!B&&Qport.Security.ViewUserName!=null&&Qport.Security.ViewUserName!=loginFormUserName){J.value=Qport.Security.ViewUserName}H.Row(2).Cell(0).style.paddingTop="5px";H.Row(2).Cell(0).innerHTML="<input type='checkbox' name='chkAutologin' id='chkAutologin'><label for='chkAutologin'>"+L()("autoLogin")+"</label>";F.chkAutologin=H.Row(2).Cell(0).childNodes[0];F.chkAutologin.checked=DefaultAutoLogin;Browser.EnterEventAttach(F.chkAutologin);F.chkAutologin.Popup=F;var K=F.CreateElement("button",H.Row(3).Cell(0));K.value=L()("login");F.btnLogin=K;K.style.marginTop="10px";if(Qport.IsLoaded||A){var M=F.CreateElement("button",H.Row(3).Cell(0));M.value=L()("cancel");M.Popup=F;M.style.marginTop="10px";M.style.marginLeft="5px";F.btnCancel=M;eh.Add(M,"click",function(){this.Popup.Unload()})}var I=F.CreateElement("div",F.ClientArea);I.style.marginTop="20px";I.style.marginBottom="15px";var G=F.CreateElement("div",I);G.style.display="inline";F.forgotpw=G;G.innerHTML=L()("forgotpw");eh.Add(G,"mouseover",function(){this.style.textDecoration="underline"});eh.Add(G,"mouseout",function(){this.style.textDecoration="none"});Browser.SetHandCursor(G);eh.Add(G,"click",function(){var Q=this;if(tmpInvalUsername.length==0){un=Qport.Security.UserName}else{un=tmpInvalUsername}if(un.toLowerCase()==loginFormUserName){un=this.Popup.txtUsername.value}if(B){un=""}var S=Qport.GUI().Colors.QportColor;var R=Utilities.ColorCalc("Secondary",S.Hue,S.Saturation,S.Value);Qport.GUI().Fancy.Prompt(L()("promptForgotpw"),un,function(V){if(!V||V.length<0){return }var T=new SOAPClientParameters();T.add("str",V);var U=new Object();U.un=V;SOAPClient.invoke("UserService.asmx","SendNewPwd",T,true,function(W){if(W){switch(W){case NewPasswordResult.Success:Qport.Alert(L()("newPassSuccess"));return ;case NewPasswordResult.Invalusername:case NewPasswordResult.InvalEmail:Qport.Alert(L()("invalidUserCredentials"));break;case NewPasswordResult.Failure:Qport.Alert(L()("newPassError"));break;default:Qport.Alert(L()("newPassError"));break}}else{Qport.Alert(L()("newPassError"))}tmpInvalUsername=U.un})},"",R.ToCssString())});var N=F.CreateElement("div",F.ClientArea);N.style.textAlign="center";var P=F.CreateElement("img",N);P.src="Images/fixedcolorlogo.jpg";P.style.marginTop="10px";Browser.SetHandCursor(P);Qport.GUI().Fancy.SetTooltip(P,L()("gotoQport"));eh.Add(P,"click",function(){Browser.OpenWindow(Qport.GetSiteUrl())});eh.Add(K,"click",function(){Qport.Security.DoLogin(this)});eh.Add(J,"PressEnter",function(){Qport.Security.DoLogin(this)});eh.Add(O,"PressEnter",function(){Qport.Security.DoLogin(this)});eh.Add(F.chkAutologin,"PressEnter",function(){Qport.Security.DoLogin(this)});if(F.txtUsername.value.length==0){F.txtUsername.focus()}else{F.txtPassword.focus()}};E.Show()},DoLogin:function(B){Qport.Security.HasShownUnAuthMess=false;if(!B){return }var A=B.Popup;if(A.txtUsername.value.length==0||A.txtPassword.value.length==0){Qport.Alert(L()("emptyError"));return }if(!Utilities.IsValidUserName(A.txtUsername.value)){Qport.Alert(L()("invalidUsername"));return }this.DoActualLogin(A.txtUsername.value,A.txtPassword.value,A.chkAutologin.checked)},DoActualLogin:function(F,B,E){Qport.IsLoaded=false;DetachLogEvent("soapclient",Qport.Security.CheckIsLoggedin);this.UserName=F;this.ViewUserName=this.UserName;var C=new SOAPClientParameters();C.add("username",this.UserName);C.add("password",B);C.add("companyId",0);C.add("isPermanent",E);var D=SOAPClient.invoke(this.ws,this.wsLogin,C,false);if(D&&D.UserId>0&&D.SessionHash.length>0){this.SessionHash=D.SessionHash;this.UserId=D.UserId;this.SessionId=D.SessionId;this.SessionAcquired=D.Acquired;this.ViewUserId=D.UserId;this.SecurityGroup=D.SecurityGroup;var A=new LogArgs("security",Q_ACTION,4);A.Add("WithCookie",E);Qport.Log(this,A);this.RemoveLoginCookie(this.ViewUserName);if(hasFixedSubdomain){Browser.Cookie.Set(this.usernameQuqi,this.ViewUserName,730,"/",Qport.Security.GetCookieDomain(),"")}Browser.Cookie.Set(this.lastLoginUserId,this.UserId,730,"/",(Qport.Security.UrlInfo.IsLocal?"":Qport.Security.UrlInfo.ShortUrl),"");if(E){Browser.Cookie.Set(this.permQuqi+this.ViewUserName,this.UserId+this.lsep+this.ViewUserName+this.lsep+D.CookieHash,730,"/",Qport.Security.GetCookieDomain(),"")}else{Browser.Cookie.Set(this.quqi+this.ViewUserName,this.UserId+this.lsep+this.ViewUserName+this.lsep+this.SessionHash+this.lsep+this.IsCompany+this.lsep+0+this.lsep+this.SessionId+this.lsep+this.SessionAcquired,false,"/",Qport.Security.GetCookieDomain(),"")}AttachLogEvent("soapclient",Qport.Security.CheckIsLoggedin);if(typeof (loginform)!="undefined"){loginform.Unload()}if(hasFixedSubdomain){Qport.ReLoadQport()}else{if(Qport.Security.UrlInfo.IsLocal){if(document.location.href.indexOf("?")==-1){document.location=(document.location.href+"?"+this.ViewUserName)}else{Qport.ReLoadQport()}}else{document.location="http://"+this.ViewUserName+"."+Qport.Security.UrlInfo.ShortUrl}}}else{if(typeof (loginform)!="undefined"){if(loginform.txtUsername.value.length==0){loginform.txtUsername.focus()}else{loginform.txtPassword.focus()}}Qport.Alert(L()("invalidUserCredentials")+" (code 1)")}},CheckIsLoggedin:function(B,A){if(A.Type==Q_ERROR&&Qport.IsLoaded){A.SupressOtherListeners=true;if(Qport.Security.HasShownUnAuthMess){return }Qport.Security.HasShownUnAuthMess=true;switch(A.Code){case 5:Qport.Security.Logout(true);Qport.Alert(L()("unauth"));break;case 6:Qport.Security.Logout(true);Qport.Alert(L()("elsewhere"));break;case 7:Qport.Security.Logout(true);Qport.Alert(L()("toomanyusers"));break}}},DoLoginCallback:function(B,A){if(A.Type==Q_ERROR){Qport.IsLoaded=true;A.SupressOtherListeners=true;Qport.Alert(L()("invalidUserCredentials")+" (code 2)")}},Logout:function(A){Qport.Halt=true;this.RemoveLoginCookie(this.ViewUserName,A);qTimeout.setTimeout(100,Qport.ReLoadQport)},CheckSession:function(){if(!Qport.IsLoaded){return false}var A=new Date();if((A.valueOf()-Qport.Security.SessionLastRefresh.valueOf())>=Qport.Security.SessionRefresh){if(!Qport.Security.IsInPermLoginCookie(this.ViewUserName)){Qport.Alert(L()("sessionExpired")+" ("+A+"; "+Qport.Security.SessionLastRefresh+")")}Qport.Security.Logout(true);return false}return true},RefreshSession:function(B){if(!B){B=0}var C=new SOAPClientParameters();C.add("userId",Qport.Security.UserId);var D=SOAPClient.invoke(Qport.Security.ws,Qport.Security.wsRefresh,C,false);if(D){Qport.Security.SessionHash=D.SessionHash;Qport.Security.UserId=D.UserId;Qport.Security.SessionId=D.SessionId;Qport.Security.SessionAcquired=D.Acquired;Qport.Security.SessionLastRefresh=new Date();if(Qport.Security.IsInLoginCookie(Qport.Security.ViewUserName)){Browser.Cookie.Remove(Qport.Security.quqi+Qport.Security.ViewUserName,"/",Qport.Security.GetCookieDomain());Browser.Cookie.Set(Qport.Security.quqi+Qport.Security.ViewUserName,Qport.Security.UserId+Qport.Security.lsep+Qport.Security.ViewUserName+Qport.Security.lsep+Qport.Security.SessionHash+Qport.Security.lsep+Qport.Security.IsCompany+Qport.Security.lsep+0+Qport.Security.lsep+Qport.Security.SessionId+Qport.Security.lsep+Qport.Security.SessionAcquired,false,"/",Qport.Security.GetCookieDomain(),"")}var A=new LogArgs("security",Q_ACTION,7);Qport.Log(Qport.Security,A)}else{var A=new LogArgs("security",Q_ERROR,6);Qport.Log(Qport.Security,A);if(B<5){B++;Qport.Security.RefreshSession(B);return }else{Qport.Security.CheckSession()}}qTimeout.setTimeout(Qport.Security.SessionRefresh,Qport.Security.RefreshSession)}};var SecurityGroup={None:"None",Admin:"Admin",Contributor:"Contributor",Public:"Public"};var NewPasswordResult={Success:"Success",Invalusername:"Invalusername",InvalEmail:"InvalEmail",Failure:"Failure"};var tmpInvalUsername="";var draggingActive=false;function DragAndDrop(){this.dragObject=null;this.handle;this.onStart;this.onDrag;this.onEnd;this.useStart;this.useDrag;this.useEnd;this.xOffset;this.yOffset;this.isDragged=false;this.ehMU=null;this.ehMM=null;this.hasFixedOffset;this.fixedOffsetX=10;this.fixedOffsetY=10;this.__cancelDragStart=false;this.__busyTimeout=false;DragAndDrop.prototype.RegisterAsDND=function(E,F,I,D,A,C,G,H,B){this.dragObject=E;if(E!=null){this.dragObject.dnd=this}this.onStart=I;this.onDrag=D;this.onEnd=A;this.useStart=C;this.useDrag=G;this.useEnd=H;this.hasFixedOffset=B;this.handle=F;this.handle.style.cursor="move";eh.Add(this.handle,"mousedown",new Delegate(this,this.DoStart),false,true);eh.Add(this.handle,"mouseup",new Delegate(this,this.__handleMouseUpEventHandler))};DragAndDrop.prototype.DoStart=function(A){if(this.__busyTimeout){return }this.__busyTimeout=true;qTimeout.setTimeout(150,new Delegate(this,this.__doStartDblClickTimeout,A))};DragAndDrop.prototype.__doStartDblClickTimeout=function(A){this.__busyTimeout=false;if(!this.__cancelDragStart){this.__actualStart(A)}this.__cancelDragStart=false};DragAndDrop.prototype.__actualStart=function(A){if(A.targetobject!=this.handle&&(typeof (this.handle.AllowDrag)!="function"||!this.handle.AllowDrag(A.targetobject))){return }draggingActive=true;this.isDragged=true;Browser.DisableSelect();if(this.ehMM!=null){eh.Remove(eh.DocumentMouseMove,this.ehMM)}if(this.ehMU!=null){eh.Remove(eh.DocumentMouseUp,this.ehMU)}this.ehMM=eh.Add(false,eh.DocumentMouseMove,new Delegate(this,this.DoDrag),false,true);this.ehMU=eh.Add(false,eh.DocumentMouseUp,new Delegate(this,this.DoEnd));if(this.useStart&&this.dragObject!=null){if(this.hasFixedOffset){this.SetDefaultOffset()}else{this.xOffset=A.x-parseInt(this.dragObject.style.left);this.yOffset=A.y-parseInt(this.dragObject.style.top)}}if(typeof (this.onStart)=="function"){this.onStart(A,this)}};DragAndDrop.prototype.SetDefaultOffset=function(){this.xOffset=this.fixedOffsetX;this.yOffset=this.fixedOffsetY};DragAndDrop.prototype.DoDrag=function(A){if(!this.isDragged){return }A.x=(A.x-this.xOffset)+Browser.GetScrollleft();A.y=(A.y-this.yOffset)+Browser.GetScrolltop();if(this.useDrag&&this.dragObject!=null){Qport.GUI().SetLocation(this.dragObject,A.x,A.y)}if(typeof (this.onDrag)=="function"){this.onDrag(A)}};DragAndDrop.prototype.DoEnd=function(A){Browser.EnableSelect();draggingActive=false;if(typeof (this.onEnd)=="function"){this.onEnd(A)}if(this.ehMM!=null){eh.Remove(eh.DocumentMouseMove,this.ehMM)}if(this.ehMU!=null){eh.Remove(eh.DocumentMouseUp,this.ehMU)}this.ehMM=null;this.ehMU=null;this.isDragged=false;this.__cancelDragStart=false};DragAndDrop.prototype.__handleMouseUpEventHandler=function(A){if(!this.isDragged){this.__cancelDragStart=true}}}var popupStack=new Qollection();var activePopup=null;var activePopupCount=0;function Popup(){this.ClientArea=null;this.Owner=null;this.Id=-1;this.IsLoaded=false;this.IsVisible=false;this.__keyUpEventId=-1;this.__documentClickEventId=-1;this.DisableEscape=false;this.NoClose=false;this.Title="";this.Systemname="";this.Width=300;this.Height=300;this.Modal=false;this.Draggable=true;this.X=-1;this.Y=-1;this.MasterColor="";this.Overflow="auto";this.HasCloseButton=false;this.Maximizable=false;this.IsMaximized=false;this.__oldHeight=-1;this.__oldWidth=-1}Popup.prototype.OnLoad=function(){};Popup.prototype.OnSetVisible=function(){};Popup.prototype.OnResize=function(){};Popup.prototype.OnMove=function(){};Popup.prototype.OnUnload=function(){};Popup.prototype.OnDispose=function(){};Popup.prototype.__init=function(){if(this.Systemname.length>0){this.Id=popupStack.Add(this,this.Systemname)}else{this.Id=popupStack.Add(this)}var tpl=eval("new "+layoutTemplate+"PopupTemplate();");tpl.Init(this,this.Width,this.Height,this.X,this.Y);tpl.SetTitle(this.Title)};Popup.prototype.Init=function(){this.__init();this.__load()};Popup.prototype.Show=function(){if(!this.IsLoaded){this.__init();this.__setVisible(true,new Delegate(this,this.__showPopupCallback))}else{this.__setVisible(true)}};Popup.prototype.__showPopupCallback=function(){this.__load()};Popup.prototype.Hide=function(){this.__setVisible(false)};Popup.prototype.SetVisible=function(A,B){this.__setVisible(A,B)};Popup.prototype.__load=function(){if(this.IsLoaded){return }this.__keyUpEventId=eh.Add(false,eh.KeyUp,new Delegate(this,this.__keyUpEventHandler));this.__documentClickEventId=eh.Add(false,eh.DocumentMouseDown,new Delegate(this,this.__documentClickEventHandler));eh.Add(Qport,"resize",new Delegate(this,this.__qportResizeEventHandler));this.IsLoaded=true;if(typeof (this.OnLoad)=="function"){this.OnLoad(this)}};Popup.prototype.__setVisible=function(A,B){if(A!=this.IsVisible){if(A){activePopupCount++}else{activePopupCount--}}this.IsVisible=A;if(A){activePopup=this}else{if(activePopup&&this.Id==activePopup.Id){activePopup=null}}this.Template.SetVisible(A,B);if(activePopup){activePopup.Focus()}if(typeof (this.OnSetVisible)=="function"){this.OnSetVisible(this)}};Popup.prototype.Resize=function(A,B){this.Width=A;this.Height=B;this.Template.Resize(A,B);if(typeof (this.OnResize)=="function"){this.OnResize(this)}};Popup.prototype.Move=function(A,B){if(A==-1&&B==-1){this.MoveCenter()}else{this.X=A;this.Y=B;this.Template.Move(A,B)}if(typeof (this.OnMove)=="function"){this.OnMove(this)}};Popup.prototype.Unload=function(){if(this.IsLoaded){this.__setVisible(false,new Delegate(this,this.__unloadSetVisibleCallback))}};Popup.prototype.__unloadSetVisibleCallback=function(){if(typeof (this.OnUnload)=="function"){this.OnUnload(this)}eh.Remove(eh.KeyUp,this.__keyUpEventId);eh.Remove(eh.DocumentMouseDown,this.__documentClickEventId);this.Template.Unload(new Delegate(this,this.__templateUnloadCallback))};Popup.prototype.__templateUnloadCallback=function(){this.__dispose()};Popup.prototype.__dispose=function(){if(typeof (this.OnDispose)=="function"){this.OnDispose(this)}try{this.IsLoaded=false;this.ClientArea=null;popupStack.Remove(this.Id)}catch(A){}if(Browser.currentFocussedField){Browser.currentFocussedField.blur();Browser.currentFocussedField=null}this.Template.Dispose()};Popup.prototype.SetTitle=function(A){this.Title=A;this.Template.SetTitle(A)};Popup.prototype.CreateElement=function(C,B){var A=Qport.GUI().CreateElement(C,B,"",this.MasterColor);A.Owner=this.Owner;A.Popup=this;return A};Popup.prototype.MoveCenter=function(){var A=((Browser.GetWindowWidth()/2)-(this.Width/2));var B=((Browser.GetWindowHeight()/2)-(this.Height/2));A+=Browser.GetScrollleft();this.Move(A,B)};Popup.prototype.Focus=function(){if(!this.IsVisible){return }activePopup=this;for(var B in popupStack.List){var A=popupStack.List[B];if(A){A.Template.Blur()}}this.Template.Focus()};Popup.prototype.IsOnlyModal=function(){for(var B in popupStack.List){var A=popupStack.List[B];if(A&&A.Modal&&A.Id!=this.Id){return false}}return true};Popup.prototype.ModalIsPresent=function(){for(var B in popupStack.List){var A=popupStack.List[B];if(A&&A.Modal){return true}}return false};Popup.prototype.FocusPreviousModal=function(){var B=null;for(var C in popupStack.List){var A=popupStack.List[C];if(A&&A.Modal&&A.Id!=this.Id){B=A}}if(B!=null){B.Focus()}};Popup.prototype.__keyUpEventHandler=function(A){if(activePopup!=null&&activePopup.Id==this.Id&&!activePopup.DisableEscape){if(A.keyCode==27){this.Unload()}}};Popup.prototype.__documentClickEventHandler=function(A){if(!this.Template.IsPartOfPopup(A.targetobject)){return }this.Focus()};Popup.prototype.ToggleMaximize=function(){if(!this.Maximizable){return }if(!this.IsMaximized){this.__oldWidth=this.Width;this.__oldHeight=this.Height;this.Resize(Browser.GetWindowWidth()-40,Browser.GetWindowHeight()-40);this.IsMaximized=true}else{this.Resize(this.__oldWidth,this.__oldHeight);this.__oldWidth=-1;this.__oldHeight=-1;this.IsMaximized=false}this.MoveCenter()};Popup.prototype.__qportResizeEventHandler=function(){if(this.Maximizable&&this.IsMaximized&&this.IsVisible){this.Resize(Browser.GetWindowWidth()-20,Browser.GetWindowHeight()-20);this.MoveCenter()}};function AutoComplete(){this.__object=null;this.__uniqueId=-1;this.__keyUpTimeoutId=-1;this.__documentKeyUpEvent=-1;this.__documentClickEvent=-1;this.__cache=null;this.__clientArea=null;this.__selectedIndex=-1;this.__results=new Array();this.__haltDo=false;this.__forceNoClose=false;this.__showTimeout=100;this.__blurTimeout=250;this.__previousFocussedField=null;this.__itemHeight=17;this.__blockedKeys=",37,38,39,40,9,13,17,16,20,18,27,45,33,34,35,36,144,";this.__isVisible=false}AutoComplete.prototype.Init=function(A){this.__object=A;this.__uniqueId=this.__object.UniqueId;eh.Add(this.__object,"keyup",new Delegate(this,this.__objectKeyUpEventHandler));eh.Add(this.__object,"blur",new Delegate(this,this.__objectBlurEventHandler));if(Qport.Cache.ac==undefined){Qport.Cache.ac=new Object()}if(Qport.Cache.ac[this.__uniqueId]==undefined){Qport.Cache.ac[this.__uniqueId]=new AcCache()}this.__cache=Qport.Cache.ac[this.__uniqueId];if(!Qport.GUI().AutoCompleteArea){var B=this.__createElement("div");B.style.border="solid 1px #999999";B.style.overflow="hidden";B.style.backgroundColor="#FFFFFF";B.style.display="none";document.body.appendChild(B);B=Qport.GUI().ConvertToBoxedElement(B);B.style.display="none";B.style.position="absolute";B.style.zIndex=Qport.ZIndex.Supreme;B.Main.style.display="block";eh.Add(B,"mouseover",new Delegate(this,this.__acAreaMouseOverEventHandler));eh.Add(B,"mouseout",new Delegate(this,this.__acAreaMouseOutEventHandler));Qport.GUI().AutoCompleteArea=B}eh.Add(A,"PressEnter",new Delegate(this,this.__objectEnterEventHandler));this.__clientArea=Qport.GUI().AutoCompleteArea.Main;this.__previousFocussedField=this.__object};AutoComplete.prototype.__show=function(A,E,B,C){this.__isVisible=true;var D=this.__clientArea.Outer;D.style.left=A+"px";D.style.top=E+"px";D.style.width=B+"px";D.style.height="0px";D.style.overflow="hidden";D.style.display="block";Qport.GUI().Fancy.ResizeTime=40;Qport.GUI().Fancy.ResizeObject(D,B,0,B,C,new Delegate(this,this.__showFinished));Qport.GUI().Fancy.ResizeTime=80};AutoComplete.prototype.__clearFocusField=function(){Browser.currentFocussedField=null};AutoComplete.prototype.__resetFocusField=function(){Browser.currentFocussedField=this.__previousFocussedField};AutoComplete.prototype.__showFinished=function(){if(!this.__isVisible){this.__hide()}else{this.__clientArea.Outer.style.overflow=""}};AutoComplete.prototype.__hide=function(){this.__clientArea.Outer.style.display="none";if(this.__documentKeyUpEvent!=-1){eh.Remove(eh.KeyUp,this.__documentKeyUpEvent)}if(this.__documentClickEvent!=-1){eh.Remove(eh.DocumentClick,this.__documentClickEvent)}this.__resetFocusField();this.__isVisible=false};AutoComplete.prototype.__render=function(B){if(!B||B.length==0){this.__hide();return }Browser.RemoveAllChilds(this.__clientArea);this.__results=B;this.__selectedIndex=-1;for(var A=0;A<this.__results.length;A++){var C=this.__createElement("div",this.__clientArea);C.style.height=this.__itemHeight+"px";C.style.width="100%";C.style.overflow="hidden";C.innerHTML=this.__results[A];C.Select=function(){this.style.backgroundColor="#3366CC";this.style.color="#FFFFFF"};C.Deselect=function(){this.style.backgroundColor="#FFFFFF";this.style.color="#000000"};Browser.SetHandCursor(C);eh.Add(C,"click",new Delegate(this,this.__itemClickEventHandler,A));eh.Add(C,"mouseover",new Delegate(this,this.__itemMouseOverEventHandler,A));eh.Add(C,"mouseout",new Delegate(this,this.__itemMouseOutEventHandler,A))}if(this.__documentKeyUpEvent!=null){eh.Remove(eh.KeyUp,this.__documentKeyUpEvent)}this.__documentKeyUpEvent=eh.Add(false,eh.KeyUp,new Delegate(this,this.__documentKeyUpEventHandler));if(this.__documentClickEvent!=null){eh.Remove(eh.DocumentClick,this.__documentClickEvent)}this.__documentClickEvent=eh.Add(false,eh.DocumentClick,new Delegate(this,this.__documentClickEventHandler));this.__show(Browser.GetAbsoluteLeft(this.__object),Browser.GetAbsoluteTop(this.__object)+this.__object.offsetHeight+1,this.__object.offsetWidth,this.__itemHeight*this.__results.length)};AutoComplete.prototype.__do=function(B){var D=this.__object.value;var C="http://";if(this.__blockedKeys.indexOf((","+B.keyCode+","))>-1){return }if(!Qport.Security.AcAllowed()||this.__haltDo||D.length==0){this.__hide();return }if(C.indexOf(D)>-1&&D.length<=C.length){this.__hide();return }if(D.length>0){if(!this.__cache.IsIn(D)){var A=new SOAPClientParameters();A.add("uniqueId",this.__uniqueId);A.add("keyword",D);A.add("userId",Qport.Security.UserId);SOAPClient.invoke("AutoCompleteService.asmx","GetAutoComplete",A,true,new Delegate(this,this.__getAutoCompleteCallback))}else{this.__render(this.__cache.Get(D))}}else{this.__hide()}};AutoComplete.prototype.__getAutoCompleteCallback=function(C){var D=this.__object.value;var A=new Array();if(D.length==0||!C||(C.length==1&&C[0].toLowerCase()==D.toLowerCase())){this.__hide();return }for(var B=0;B<C.length;B++){if(C[B]!=null){A.push(Browser.EscapeHtml(C[B]))}}if(!this.__cache.IsIn(D)){this.__cache.Add(D,A)}if(A.length==0){this.__hide();return }this.__render(A)};AutoComplete.prototype.__documentClickEventHandler=function(A){if(A.targetobject!=this.__clientArea.Outer&&!Browser.IsChildNode(this.__clientArea.Outer,A.targetobject)){this.__hide()}};AutoComplete.prototype.__documentKeyUpEventHandler=function(A){switch(A.keyCode){case 38:case 39:case 9:case 37:case 13:case 40:this.__handleKeyEvent(A.keyCode);break}};AutoComplete.prototype.__handleKeyEvent=function(B){var A=this.__selectedIndex;if(B==38){if(this.__selectedIndex<=0){this.__selectedIndex=0}else{this.__selectedIndex--}}else{if(B==40){if(this.__selectedIndex<(this.__results.length-1)){this.__selectedIndex++}else{this.__selectedIndex=(this.__results.length-1)}}}if(this.__selectedIndex>=0){if(B==9||B==13){this.__selectItem(this.__selectedIndex)}else{this.__highlight(A,this.__selectedIndex)}}};AutoComplete.prototype.__highlight=function(B,A){if(B>=0){this.__clientArea.childNodes[B].Deselect()}if(A>=0){this.__clientArea.childNodes[A].Select()}this.__selectedIndex=A;this.__clearFocusField()};AutoComplete.prototype.__itemClickEventHandler=function(A){this.__selectItem(A)};AutoComplete.prototype.__selectItem=function(A){this.__haltDo=true;this.__object.value=Browser.UnEscapeHtml(this.__results[A]);this.__hide();Browser.FocusNextInParent(this.__object)};AutoComplete.prototype.__itemMouseOverEventHandler=function(A){this.__highlight(this.__selectedIndex,A)};AutoComplete.prototype.__itemMouseOutEventHandler=function(A){if(A>=0){this.__clientArea.childNodes[A].Deselect();this.__selectedIndex=-1;this.__resetFocusField()}};AutoComplete.prototype.__objectKeyUpEventHandler=function(A){if(this.__keyUpTimeoutId!=-1){qTimeout.removeTimeout(this.__keyUpTimeoutId)}this.__keyUpTimeoutId=qTimeout.setTimeout(this.__showTimeout,new Delegate(this,this.__objectKeyUpTimeoutEventHandler,A))};AutoComplete.prototype.__objectKeyUpTimeoutEventHandler=function(A){this.__haltDo=false;this.__do(A)};AutoComplete.prototype.__objectBlurEventHandler=function(A){qTimeout.setTimeout(this.__blurTimeout,new Delegate(this,this.__objectBlurTimeoutEventHandler))};AutoComplete.prototype.__objectBlurTimeoutEventHandler=function(){if(!this.__forceNoClose){this.__hide()}};AutoComplete.prototype.__acAreaMouseOverEventHandler=function(){this.__forceNoClose=true};AutoComplete.prototype.__acAreaMouseOutEventHandler=function(){this.__forceNoClose=true};AutoComplete.prototype.__createElement=function(B,A){return Qport.GUI().CreateElement(B,A)};AutoComplete.prototype.__objectEnterEventHandler=function(A){this.__hide()};function attachAutoComplete(A){if(!Qport.Security.AcAllowed()||!A||!A.UniqueId){return }var B=new AutoComplete();B.Init(A)}function setAutoComplete(A,C){if(!A){return }if(A.value.length>0){if(Qport.Security.AcAllowed()){if(Qport.Cache.ac==undefined){Qport.Cache.ac=new Object()}if(Qport.Cache.ac[A.UniqueId]==undefined){Qport.Cache.ac[A.UniqueId]=new AcCache()}Qport.Cache.ac[A.UniqueId].Insert(A.value);var B=new SOAPClientParameters();B.add("uniqueId",A.UniqueId);B.add("keyword",A.value);B.add("userId",Qport.Security.UserId);SOAPClient.invoke("AutoCompleteService.asmx","SetAutoComplete",B,true,function(D){if(A&&C){A.value=""}},true)}else{if(C){A.value=""}}}}function AcCache(){this.Keywords=new Array();this.Results=new Array();AcCache.prototype.IsIn=function(A){for(var B=0;B<this.Keywords.length;B++){if(this.Keywords[B].toLowerCase()==A.toLowerCase()){return true}}return false};AcCache.prototype.Add=function(B,A){if(!this.IsIn(B)){this.Keywords[this.Keywords.length]=B}var F=this.Results.length;for(var D=0;D<A.length;D++){var E=false;for(var C=0;C<this.Results.length;C++){if(this.Results[C]==undefined){continue}if(A[D].toLowerCase()==this.Results[C].toLowerCase()){E=true;break}}if(!E&&A[D]!=undefined&&A[D]!=null&&A[D].length>0){this.Results[F+D]=A[D]}}};AcCache.prototype.Insert=function(A){var C=false;for(var B=0;B<this.Results.length;B++){if(this.Results[B]==undefined){continue}if(this.Results[B].toLowerCase()==A.toLowerCase()){C=true;break}}if(!C){this.Results[this.Results.length]=A}};AcCache.prototype.Get=function(B){var A=new Array();for(var C=0;C<this.Results.length;C++){if(this.Results[C]==undefined){continue}if(this.Results[C].toLowerCase().indexOf(B.toLowerCase())>-1){A[A.length]=this.Results[C]}}return A}}function l(A,B){if(typeof (A)=="undefined"){return Qport.LanguageManager.GetLanguageResource("qport")}else{if(typeof (B)=="undefined"){return Qport.LanguageManager.GetLanguageResource(A)}else{return Qport.LanguageManager.GetLanguageResource(A)(B)}}}function L(A,B){return l(A,B)}var LanguageManager={LanguageContainer:new Object(),LOGNAME:"LanguageManager",Ws:"LanguageService.asmx",WsRetrieve:"Retrieve",Clear:function(){this.LanguageContainer=new Object()},Contains:function(A){if(!A||A.length==0){return false}return(typeof (this.LanguageContainer[A.toLowerCase()])!="undefined"||typeof (this.LanguageContainer[A])!="undefined")},Get:function(B){if(typeof (this.LanguageContainer[B.toLowerCase()])!="undefined"){return this.LanguageContainer[B.toLowerCase()]}else{if(typeof (this.LanguageContainer[B])!="undefined"){return this.LanguageContainer[B]}else{var A=new LogArgs(this.LOGNAME,Q_ERROR,1);A.Add("name",B);Qport.Log(this,A)}}},GetLanguageResource:function(B){if(!this.Contains(B)){if(!this.Retrieve(B)){var A=new LogArgs(this.LOGNAME,Q_ERROR,2);A.Add("Resource",B);Qport.Log(this,A);return function(){return""}}}return this.Get(B)},AddLanguageResource:function(A,B){if(this.Contains(A)){return true}var D=B;for(var C in D){D[C.toLowerCase()]=D[C]}D.LOGNAME=this.LOGNAME;this.LanguageContainer[A]=function(G,H){var E=D[G];if(!E){E=D[G.toLowerCase()]}if(typeof (E)=="object"){E=E.toString()}if(typeof (E)=="undefined"){if(H==null||H==true){var F=new LogArgs(D.LOGNAME,Q_ERROR,5);F.Add("Resource",A);F.Add("Name",G);Qport.Log(this,F)}return""}E=E.replace("{prodhelpdesk}",helpdeskMail);return E};return true},Retrieve:function(A){var B=new SOAPClientParameters();B.add("resourceName",A);B.add("viewUserId",Qport.Security.ViewUserId);B.add("language",this.GetLanguage());var C=SOAPClient.invoke(this.Ws,this.WsRetrieve,B,false);if(C){return this.AddLanguageResource(A,C)}return false},GetLanguage:function(){if(!Qport.Language){Qport.Language=Qport.GetLanguage()}return Qport.Language}};Function.prototype.extend=function(C){var B=function(){};B.prototype=C.prototype;var A=this.prototype;this.prototype=new B();this.prototype.constructor=this;for(var D in A){this.prototype[D]=A[D]}};Date.prototype.oldToLocaleString=Date.prototype.toLocaleString;Date.prototype.toLocaleString=function(){var A=this.oldToLocaleString();return A.substring(0,A.lastIndexOf(":"))};Date.prototype.toShortDateString=function(){var C,A,B;C=this.getFullYear();A=this.getFullMonth();B=this.getDate();return B+"/"+A+"/"+C};Date.prototype.toShortTimeString=function(){var C,A,B;C=this.getHours();A=Utilities.PadInt(this.getMinutes(),2);B=Utilities.PadInt(this.getSeconds(),2);return C+":"+A+":"+B};Date.prototype.getFullMonth=function(){return this.getMonth()+1};Date.prototype.toShorterTimeString=function(){var C,A,B;C=this.getHours();A=Utilities.PadInt(this.getMinutes(),2);return C+":"+A};Date.prototype.toShortDateAndTimeString=function(){var A=this.toShortDateString();var B=this.toShortTimeString();return A+" "+B};Date.prototype.toShortDateTimeString=function(){var A=this.toShortDateString();var B=this.toShorterTimeString();return A+" "+B};Date.prototype.getFixedYear=function(){return this.getFullYear()};Date.prototype.toDOTNETString=function(){var F,H,E,G,C,D;F=Utilities.PadInt(this.getMonth()+1,2);H=Utilities.PadInt(this.getDate(),2);E=Utilities.PadInt(this.getHours(),2);G=Utilities.PadInt(this.getMinutes(),2);C=Utilities.PadInt(this.getSeconds(),2);D=this.getTimezoneOffset()*-1;var B=false;if(D<0){B=true;D*=-1}D=(D-(D%60))/60;D=Utilities.PadInt(D,2);if(B){D*=-1}else{D="+"+D}var A=this.getYear();if(A<1900){A+=1900}return A+"-"+F+"-"+H+"T"+E+":"+G+":"+C+"."+this.getMilliseconds()+D+":00"};Array.prototype.insert=function(D,B){if(D>=0){if(this.length==0){this[0]=B;return this}else{var F=new Array();var E=0;for(var C=0,A=this.length;C<=A;C++){if(C==D){F[C]=B;C++;E++}F[C]=this[C-E]}return F}}};function MathExtension(){}MathExtension.prototype.Round=function(C,B){var A=Math.pow(10,B);C*=A;C=Math.round(C);C/=A;return C};var QMath=new MathExtension();var QString={Format:function(C,B){for(var A=0;A<B.length;A++){while(C.indexOf("{"+A+"}")!=-1){C=C.replace("{"+A+"}",B[A])}}return C},__isWhitespaceChar:function(B){var A=B.charCodeAt(0);if(A<=32){return true}else{return false}},__isDigitChar:function(B){var A=B.charCodeAt(0);if(A>=48&&A<=57){return true}else{return false}},__compareRight:function(E,B){var G=0;var F=0;var D=0;var C;var A;for(;;F++,D++){C=E.charAt(F);A=B.charAt(D);if(!this.__isDigitChar(C)&&!this.__isDigitChar(A)){return G}else{if(!this.__isDigitChar(C)){return -1}else{if(!this.__isDigitChar(A)){return +1}else{if(C<A){if(G==0){G=-1}}else{if(C>A){if(G==0){G=+1}}else{if(C==0&&A==0){return G}}}}}}}},NaturalCompare:function(H,G){var D=0,B=0;var C=0,A=0;var F,E;var I;while(true){C=A=0;F=H.charAt(D);E=G.charAt(B);while(this.__isWhitespaceChar(F)||F=="0"){if(F=="0"){C++}else{C=0}F=H.charAt(++D)}while(this.__isWhitespaceChar(E)||E=="0"){if(E=="0"){A++}else{A=0}E=G.charAt(++B)}if(this.__isDigitChar(F)&&this.__isDigitChar(E)){if((I=this.__compareRight(H.substring(D),G.substring(B)))!=0){return I}}if(F==0&&E==0){return C-A}if(F<E){return -1}else{if(F>E){return +1}}++D;++B}}};function StringBuffer(){this.buffer=[]}StringBuffer.prototype.append=function append(A){this.buffer.push(A);return this};StringBuffer.prototype.toString=function toString(){return this.buffer.join("")};function Delegate(C,D){var B=[];for(var A=2;A<arguments.length;A++){B.push(arguments[A])}return function(){var E=[];for(var F=0;F<B.length;F++){E.push(B[F])}for(var F=0;F<arguments.length;F++){E.push(arguments[F])}return D.apply(C,E)}}var Utilities={PreloadImage:function(B){var A=Browser.CreateElement("img");A.src=B},DisposeObject:function(D,A){if(D){for(var C in D){try{if(D[C]!=null&&D[C].parentNode!=null){if(typeof (D[C].Main)!="undefined"){D[C].Main=null}if(typeof (D[C].Outer)!="undefined"){D[C].Outer=null}D[C]=null}}catch(B){}}}if(A){Browser.RemoveNode(A)}},UrlEncode:function(A){A=escape(A);A=A.replace("+","%2B");return A.replace("/","%2F")},IsValidUserName:function(A){if(!userNameRegex){return false}var B=new RegExp(userNameRegex);return A.match(B)},ValidateUrl:function(A,C){var B=new RegExp("((http|https|ftp|mailto)://)(.+)?");if(!A.match(B)){if(!C){C="http://"}A=C+A}return A},StripHTML:function(A){return A.replace(/(<([^>]+)>)/ig,"")},IsUrl:function(A){var B=new RegExp("([a-z]+://)?(.+).([a-zA-Z]{2,4})/([^ ]+)?");return A.match(B)},StripUrl:function(A){if(A.substr(0,11)=="http://www."){A=A.substr(11)}if(A.length>30){A=A.substr(0,15)+"..."+A.substr(A.length-15)}return A},HTMLEntities:function(A){var C=document.createElement("div");var B=document.createTextNode(A);C.appendChild(B);return C.innerHTML},CheckSizeTextArea:function(C,B){var A=C.value;if((A.length+1)>B){Qport.Alert(L()("maxLengthReached"));C.value=A.substring(0,(B-1))}},LTrim:function(B){if(B!=""){var A=/\s*((\S+\s*)*)/;return B.replace(A,"$1")}else{return B}},RTrim:function(B){if(B!=""){var A=/((\s*\S+)*)\s*/;return B.replace(A,"$1")}else{return B}},Trim:function(A){return this.LTrim(this.RTrim(A))},FahrenheitToCelsius:function(A){return(A-32)/1.8},CelsiusToFahrenheit:function(A){return(A*1.8)+32},MilesToKilometers:function(A){return A*1.6},KilometersToMiles:function(A){return A/1.6},IsInteger:function(A){return A.match(/^(\-)?([0-9]+)$/)},IsUnsignedInteger:function(A){if(typeof (A)=="number"){return A>=0}else{return A.match(/^([0-9]+)$/)}},ConvertSecondsToTime:function(I,B){var C=Math.floor((I/3600));var F=(I%3600);var H=Math.floor(F/60);var D=(F%60);var J=this.PadInt(Math.floor(D),2);H=(C==0?H:this.PadInt(H,2));var G=":";var E=":";var A="";if(B){G="h:";E="m:";A="sec."}C=(C==0?"":C+G);J=(((C==0)&&(H==0)&&(J==0))?"":H+E+J+A);return C+J},AMPMTo24:function(B){var A=B.substring(B.length-2,B.length).toLowerCase();B=B.substring(0,B.length-3);var C=B.substring(0,B.indexOf(":"));if(A=="pm"){C=parseInt(C)+12}return C+B.substring(B.indexOf(":"))},PadInt:function(B,C){var D="";var A=""+B;if(A.substring(0,1)=="-"){D="-";A=A.substring(1)}while(A.length<C){A="0"+A}return D+A},IsJsonString:function(A){return A.match(/^(\{(.+)\})|(\[(.+)\])$/)},IsZipcode:function(A){return A.match(/^[0-9]{4}[a-zA-Z]{2}$/)},IsPhone:function(A){return A.match(/^[0-9]{10}$/)},IsAdvancedPhone:function(A){return A.match(/^((\+([0-9]{1,2}))|([0]{2}([1-9]{1,2})))?(\(0\))?(0)?([0-9]{9,10})$/)},IsEmailAddress:function(A){return A.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/)},IsDutchMobileNumber:function(A){return A.match(/^(06)[0-9]{8}$/)},ColorCalc:function(M,C,O,J){var A=0.3;if(M.toLowerCase().indexOf("secondary")==0){var F=O;var B=0.6;var G=1;var K=0.5;K=1-((1-K)*J);G=1-((1-G)*J);if(F<=K){F=Math.sqrt(F/K)*G}else{F=(G+((G-B)/(1-K)*K))-((G-B)/(1-K)*F)}var D=J;var E=0.5;var N=1;var H=0.5;H=1-((1-H)*(1-O));E=1-((1-E)*(1-O));if(D<=H){D=E+Math.sqrt(D/H)*(N-E)}else{D=(N+((N-E)/(1-H)*H))-((N-E)/(1-H)*D)}}switch(M.toLowerCase()){case"primary":return new QColor(QColor.HSV,C,O,J);case"secondary":return new QColor(QColor.HSV,C,F,D);case"secondarydark":return new QColor(QColor.HSV,C,F,D*0.8);case"primarytext":var I=new Array();if(Math.sqrt(Math.pow(O,2)+Math.pow(1-J,2))<A){I[0]=0;I[1]=0;I[2]=0}else{I[0]=255;I[1]=255;I[2]=255}return I;case"secondarytext":var I=new Array();if(Math.sqrt(Math.pow(F,2)+Math.pow(1-D,2))<A){I[0]=0;I[1]=0;I[2]=0}else{I[0]=255;I[1]=255;I[2]=255}return I}},Countries:{8:"albania",20:"andorra",56:"belgium",70:"bosnia",100:"bulgaria",208:"danmark",276:"germany",233:"estonia",246:"finland",250:"france",292:"gibraltar",300:"grease",826:"greatbritain",348:"hongaria",372:"ireland",380:"italia",191:"croatia",428:"latvia",438:"liechtenstein",440:"litouwen",442:"luxembourg",807:"macedonia",492:"monaco",528:"netherlands",578:"norwegia",40:"austria",616:"poland",620:"portugal",642:"romania",643:"russia",674:"sanmarino",891:"servia",705:"slovenia",703:"slowakia",724:"spain",203:"czech",336:"vatican",826:"uk",752:"swedia",756:"suisse"},GetCountryName:function(A){return L("countries")(this.Countries[A])},FillCountries:function(A){var B=0;for(var C in this.Countries){A.options[B]=new Option(this.GetCountryName(C),C);B++}A.value="528"},YearCombo:function(E,B,H,C){var G=H?H:1901;var A=C?C:new Date().getFixedYear();var F=Browser.CreateElement("select");E.appendChild(F);F.options[0]=new Option(L("settings")("txtBirthYear"),0);for(var D=G;D<=A;D++){F.options[D-G+1]=new Option(D,D)}F.options[((B&&B!=1850&&B!="")?parseInt(B-G+1):0)].selected=true;return F},NewlineToBR:function(A){return A.replace(/\n/g,"<br/>")},BRToNewline:function(A){return A.replace(/\<br(\\)?\>/gi,"\n")},StripBR:function(A){A=A.replace(/\<br (\/)?\>/gi,"");return A.replace(/\<br(\\)?\>/gi,"")},StripMultipleBR:function(C,A){var B=new RegExp("(<br />){2,}","gi");C=C.toString();return C.replace(B,A||"")},NBSP_ParagraphsToBR:function(B){var A=new RegExp("(<p>&nbsp;</p>)","gi");B=B.toString();return B.replace(A,"<br />")},RetreiveHtmlAnchorElementType:function(A){switch(A.toLowerCase().slice(-4)){case".doc":case".dot":case"docx":case"dotx":return"application/msword";case".xls":case".xlt":case"xltx":case"xlsx":return"application/vnd.ms-excel";case".ppt":case".pps":case"pptx":case"ppsx":return"application/vnd.ms-powerpoint";case".png":return"image/png";case".tif":case"tiff":return"image/tiff";case".bmp":return"image/bmp";case".gif":return"image/gif";case".jpg":case".jpe":case"jpeg":return"image/jpeg";case".zip":return"application/zip";case".asx":return"application/asx";default:return"application/octet-stream"}}};function QTable(A){this._table=A;this._rows=new Array();QTable.prototype.Row=function(B){return this._rows[B]};QTable.prototype.AddRow=function(){var B=Browser.CreateElement("tr");this._table.appendChild(B);var C=new QRow(B);this._rows[this._rows.length]=C;return C};QTable.prototype.DeleteRow=function(C){for(var B=0;B<this._rows[C]._cells.length;B++){this._rows[C].RemoveCell(B)}this._rows[C]._row=null;this._rows[C]._cells=null;this._rows.splice(C,1);this._table.deleteRow(C)}}function QRow(A){this._row=A;this._cells=new Array();QRow.prototype.Cell=function(B){return this._cells[B]};QRow.prototype.AddCell=function(B){var C;if(!B||B<0){C=Browser.CreateElement("td");this._row.appendChild(C)}else{C=this._row.insertCell(B)}this._cells[this._cells.length]=C;return C};QRow.prototype.RemoveCell=function(B){this._cells.splice(B,1);this._row.deleteCell(B)}}function QColor(C,B,A,D){switch(C){case QColor.RGB:this.SetRGB(B,A,D);break;case QColor.HSV:this.SetHSV(B,A,D);break;case QColor.HEX:this.SetHex(B);break}}QColor.RGB="rgb";QColor.HSV="hsv";QColor.HEX="hex";QColor.RGB2HSV=function(C,B,A){return[63,127,255]};QColor.HSV2RGB=function(C,B,A){return YAHOO.util.Color.hsv2rgb(C,B,A)};QColor.HSV2HEX=function(D,C,A){var B=this.HSV2RGB(D,C,A);return this.RGB2HEX(B[0],B[1],B[2])};QColor.cutHex=function(A){return(A.charAt(0)=="#")?A.substring(1,7):A};QColor.HexToRed=function(A){return parseInt((QColor.cutHex(A)).substring(0,2),16)};QColor.HexToGreen=function(A){return parseInt((QColor.cutHex(A)).substring(2,4),16)};QColor.HexToBlue=function(A){return parseInt((QColor.cutHex(A)).substring(4,6),16)};QColor.RGB2HEX=function(C,B,A){return YAHOO.util.Color.rgb2hex(C,B,A)};QColor.prototype={Hue:null,Saturation:null,Value:null,Red:null,Green:null,Blue:null,__cssString:"",SetHSV:function(D,C,A){this.Hue=D;this.Saturation=C;this.Value=A;var B=QColor.HSV2RGB(this.Hue,this.Saturation,this.Value);this.Red=B[0];this.Green=B[1];this.Blue=B[2];this.__calcCssString()},SetRGB:function(D,C,A){this.Red=D;this.Green=C;this.Blue=A;var B=QColor.RGB2HSV(this.Red,this.Green,this.Blue);this.Hue=B[0];this.Saturation=B[1];this.Value=B[2];this.__calcCssString()},SetHex:function(B){this.Red=QColor.HexToRed(B);this.Green=QColor.HexToGreen(B);this.Blue=QColor.HexToBlue(B);var A=QColor.RGB2HSV(this.Red,this.Green,this.Blue);this.Hue=A[0];this.Saturation=A[1];this.Value=A[2];this.__calcCssString()},__calcCssString:function(){this.__cssString="rgb("+this.Red+","+this.Green+","+this.Blue+")"},ToCssString:function(){return this.__cssString}};var YAHOO={util:{}};YAHOO.util.Color=new function(){this.hsv2rgb=function(C,K,H){var B,D,G;if(K==0){B=H*255;D=H*255;G=H*255}else{var F=C*6;if(F==6){F=0}var E=Math.floor(F);var A=H*(1-K);var J=H*(1-K*(F-E));var I=H*(1-K*(1-(F-E)));if(E==0){var_r=H;var_g=I;var_b=A}else{if(E==1){var_r=J;var_g=H;var_b=A}else{if(E==2){var_r=A;var_g=H;var_b=I}else{if(E==3){var_r=A;var_g=J;var_b=H}else{if(E==4){var_r=I;var_g=A;var_b=H}else{var_r=H;var_g=A;var_b=J}}}}}B=var_r*255;D=var_g*255;G=var_b*255}return[Math.round(B),Math.round(D),Math.round(G)]};this.rgb2hex=function(C,B,A){return this.toHex(C)+this.toHex(B)+this.toHex(A)};this.hexchars="0123456789ABCDEF";this.toHex=function(A){A=A||0;A=parseInt(A,10);if(isNaN(A)){A=0}A=Math.round(Math.min(Math.max(0,A),255));return this.hexchars.charAt((A-A%16)/16)+this.hexchars.charAt(A%16)};this.toDec=function(A){return this.hexchars.indexOf(A.toUpperCase())};this.hex2rgb=function(B){var A=[];A[0]=(this.toDec(B.substr(0,1))*16)+this.toDec(B.substr(1,1));A[1]=(this.toDec(B.substr(2,1))*16)+this.toDec(B.substr(3,1));A[2]=(this.toDec(B.substr(4,1))*16)+this.toDec(B.substr(5,1));return A};this.isValidRGB=function(A){if((!A[0]&&A[0]!=0)||isNaN(A[0])||A[0]<0||A[0]>255){return false}if((!A[1]&&A[1]!=0)||isNaN(A[1])||A[1]<0||A[1]>255){return false}if((!A[2]&&A[2]!=0)||isNaN(A[2])||A[2]<0||A[2]>255){return false}return true}};function QportEnvironment(){this.Pages;this.CurrentPageId=1;this.CurrentPage;this.LoadQueue=new SyncASyncQueue();this.RenderQueue=new SyncASyncQueue();this.ScriptManager=QportScriptManager;this.Security=SecurityContext;this.IsLoaded=false;this.Language;this.LanguageManager=LanguageManager;this.UserSettings;this.UserProfile;this.wsSettings="UserService.asmx";this.wsGetSettings="GetSettings";this.wsUpdateSettings="UpdateSettings";this.StatsGenericWebServiceUri="StatsGenericService.asmx";this.ModuleList=null;this.Halt=false;this.Cache=new Object();this.ProgressDiv=null;this.MinCols=3;this.SwitchPageAllowed=true;this.CurrentLanguage="";this.IsDebug=false;this.IsLocal=false;this.IsUpdatingModule=false;this.DefaultBrowserTitle="";this.__multiMediaControl=null;this.onresize=null;this.onscroll=null;this.onmodulesloaded=null;this.PageChangeDialog=null;this._gui;this.GUI=function(){return this._gui};QportEnvironment.prototype.DoHalt=function(C,B){this.Halt=true;var E="";if(typeof (productName)=="undefined"){productName=""}if(B){B="Please contact "+B+" for questions."}else{B=""}if(C){try{E=L()("nosupport")}catch(D){}if(E.length==0){E=productName+" is not compatible with your Browser, please open "+productName+" in another browser (Firefox, Camino or Internet Explorer 6.0 up on Linux, Apple or Windows)."+B}}else{E=L()("loadingFailed");if(E.length==0){E="Communication with the "+productName+" server failed. Therefore this message might not be in your language, our sincere apologies for that. Please close your browser and go to "+productName+" again."+B}}alert(E)};QportEnvironment.prototype.IsVisiting=function(){return document.location.href.indexOf("visit=true")>-1};QportEnvironment.prototype.PreLoadModules=function(C){if(Qport.Security.SecurityGroup!=SecurityGroup.Admin){return }if(typeof (C)!="function"){C=Qport.PreLoadModulesCallback}if(Qport.ModuleList==null){var B=new SOAPClientParameters();B.add("userId",Qport.Security.UserId);SOAPClient.invoke("ModuleService.asmx","GetModules",B,true,C)}else{C(Qport.ModuleList)}};QportEnvironment.prototype.PreLoadModulesCallback=function(D){if(D){for(var C=0;C<D.length;C++){for(var B=0;B<D[C].Modules.length;B++){D[C].Modules[B].ScriptUri="Modules/"+D[C].Modules[B].ScriptUri}}Qport.ModuleList=D}};QportEnvironment.prototype.PreLoadProfile=function(C){if(!Qport.UserProfile){var B=new SOAPClientParameters();B.add("userId",Qport.Security.UserId);SOAPClient.invoke("UserService.asmx","GetUserProfile",B,true,function(D){if(D){Qport.UserProfile=D}else{Qport.UserProfile=null}if(typeof (C)=="function"){C()}})}else{if(typeof (C)=="function"){C()}}};QportEnvironment.prototype.ReLoadQport=function(){document.location=document.location.href};QportEnvironment.prototype.Log=function(C,B){Log(C,B)};QportEnvironment.prototype.GetPreSelect=function(E,B,D){if(!Qport.Security.PreSelectAllowed("get")){return }var C=new SOAPClientParameters();C.add("useModId",E);C.add("fieldId",B);SOAPClient.invoke("PreSelectService.asmx","Get",C,true,D)};QportEnvironment.prototype.SetPreSelect=function(F,B,C,E){if(!Qport.Security.PreSelectAllowed("set")){return }var D=new SOAPClientParameters();D.add("useModId",F);D.add("fieldId",B);D.add("selectedId",C);SOAPClient.invoke("PreSelectService.asmx","Set",D,true,E)};QportEnvironment.prototype.LoadUserSettings=function(B){if(Qport.Halt){return }if(B==null||!B){Qport.DoHalt();return }this.UserSettings=B};QportEnvironment.prototype.LoadTemplate=function(){if(Qport.Halt){return }this._gui=new GUI()};QportEnvironment.prototype.OnResizeBrowser=function(){if(Qport.Halt){return }if(Qport.IsLoaded){if(typeof (this.onresize)=="function"){this.onresize()}}};QportEnvironment.prototype.OnScroll=function(){if(Qport.IsLoaded){if(typeof (this.onscroll)=="function"){this.onscroll()}}};QportEnvironment.prototype.SortModHosts=function(){if(Qport.Halt){return }var H=new Array();for(var D=0;D<Qport.GUI().ColumnCount;D++){var C=Qport.GetModHostsByColumn(D);var G=new Array();var F=new Array();var E=new Array();for(var B=0;B<C.length;B++){if(C[B].IsMandatory){if(C[B].MandatoryPos==1){G.push(C[B])}else{if(C[B].MandatoryPos==2){E.push(C[B])}}}else{F.push(C[B])}}G=G.sort(Qport.RowSorter);F=F.sort(Qport.RowSorter);E=E.sort(Qport.RowSorter);for(var B=0;B<G.length;B++){H.push(G[B])}for(var B=0;B<F.length;B++){H.push(F[B])}for(var B=0;B<E.length;B++){H.push(E[B])}}Qport.CurrentPage.ModHosts=H};QportEnvironment.prototype.RowSorter=function(C,B){if(Qport.Halt){return 0}if(parseInt(C.Row)<parseInt(B.Row)){return -1}if(parseInt(C.Row)>parseInt(B.Row)){return 1}return 0};QportEnvironment.prototype.GetModHostsByColumn=function(C){if(Qport.Halt){return }var E=new Array();var F=Qport.CurrentPage.ModHosts;if(F!=null){for(var D=0,B=F.length;D<B;D++){if(!F[D]){Qport.DoHalt();return }if(F[D].Column==C){E.push(F[D])}}}return E};QportEnvironment.prototype.Dispose=function(){Qport.Halt=true;if(typeof (Qport.onunload)=="function"){Qport.onunload()}try{SOAPClient.ProcessPendingPool(true)}catch(G){}if(Qport.Pages){for(var E=0,B=Qport.Pages.length;E<B;E++){Qport.Pages[E].Tab=null;if(Qport.Pages[E].ModHosts&&Qport.Pages[E].ModHosts.length>0){for(var D=0,C=Qport.Pages[E].ModHosts.length;D<C;D++){try{Qport.Pages[E].ModHosts[D].Dispose()}catch(G){}}}}}if(popupStack){for(var F in popupStack.List){try{if(typeof (popupStack.List[F].Dispose)=="function"){popupStack.List[F].Dispose()}}catch(G){}}}if(tabTemplateStack){for(var F in tabTemplateStack.List){try{if(typeof (tabTemplateStack.List[F].Dispose)=="function"){tabTemplateStack.List[F].Dispose()}}catch(G){}}}try{Qport.GUI().Header.HeadButtons.Dispose()}catch(G){}if(typeof (CarousselStack)!="undefined"){for(var F in CarousselStack.List){try{if(typeof (CarousselStack.List[F].Dispose)=="function"){CarousselStack.List[F].Dispose()}}catch(G){}}}Qport.GUI().Dispose();try{Utilities.DisposeObject(Qport)}catch(G){}eh.Dispose();if(typeof (TickerStack)!="undefined"){TickerStack.Dispose()}};QportEnvironment.prototype.__handleTextSelect=function(B){B=Browser.Event(B,true);return Browser.selectEnabled};QportEnvironment.prototype.LoadQport=function(E){if(this.Halt){return }Qport.Security.SessionRefresh=((SessionTimeoutMinutes-1)*60000);var C=document.location.href;this.IsDebug=false;this.IsLocal=(C.indexOf("localhost:")>-1);if(!Browser.Test()){this.DoHalt(true);return }document.body.ondrag=new Delegate(this,this.__handleTextSelect);document.body.onselectstart=new Delegate(this,this.__handleTextSelect);window.onscroll=new Delegate(this,this.OnScroll);if(Browser.Warn()&&Browser.Cookie.Get("BrowserWarning")==null){this.Alert("Your browser is not fully compatible. If you run into problems, please contact the helpdesk.");Browser.Cookie.Set("BrowserWarning","1",7,"/",this.Security.GetCookieDomain(),"")}Browser.InitEnterListener();eh.Add(false,eh.DocumentOnUnload,function(){Qport.Dispose()});eh.Add(document.body,"focus",function(F){Qport.Security.CheckSession();Qport.NoAutoCompleteTimeout=new Date()});this.CurrentLanguage=this.GetLanguage();if(!E&&!Qport.Security.IsAuthenticated()){this._gui=new GUI();Browser.RemoveAllChilds(document.body);Qport.Security.ShowLoginForm();return }AttachLogEvent("soapclient",Qport.WsFail);this.DefaultBrowserTitle=Browser.GetBrowserTitle();if(!isTrial){Browser.SetBrowserTitle(Qport.Security.UserName+"."+this.DefaultBrowserTitle)}else{Browser.SetBrowserTitle(this.DefaultBrowserTitle)}this.InitialLoadDiv=Browser.CreateElement("div");this.InitialLoadDiv.className="initialLoadingDiv";this.InitialLoadDiv.innerHTML=L()("loadingQport");document.body.appendChild(this.InitialLoadDiv);this.LoadQueue.AddQueueItem(function(F){Qport.LoadUserSettings(F)});this.LoadQueue.AddQueueItem(function(){Qport.LoadTemplate()});this.LoadQueue.AddQueueItem(function(F){Qport.PagesLoaded(F)});this.LoadQueue.OnComplete=function(){if(Qport.Halt){return }if(Qport.CurrentLanguage.toLowerCase()!=Qport.GetLanguage().toLowerCase()){Qport.CurrentLanguage=Qport.GetLanguage();Qport.LanguageManager.Clear();Qport.Language=false}if(Qport.Pages!=null&&Qport.Pages.length>0&&Qport.UserSettings!=null){Qport.GUI().ColumnCount=Qport.UserSettings.Columns;Qport.SetActivePageById(Qport.UserSettings.PageId)}setTimeout(' Qport.OnColorChange(); Qport.RenderQueue.Queue[0].Exec(Qport.GUI()); Qport.SetPageStatus(true, "'+L()("loading").replace('"',"'")+'");',1)};this.RenderQueue.AddQueueItem(function(F){F.RenderQport()});this.RenderQueue.OnComplete=function(){if(Qport.Halt){return }setTimeout("Qport.LoadModules();",1);Qport.IsLoaded=true;if(Qport.Security.AddModuleAllowed()&&Qport.Languages==null){var F=new SOAPClientParameters();F.add("userId",Qport.Security.UserId);SOAPClient.invoke("LanguageService.asmx","GetLanguages",F,true,function(G){if(G){Qport.Languages=G}else{Qport.Languages=null}})}Qport.GUI().RenderHeadButtons()};var B=new SOAPClientParameters();B.add("viewUserId",Qport.Security.ViewUserId);SOAPClient.invoke(this.wsSettings,this.wsGetSettings,B,true,function(F){if(Qport.LoadQueue.Queue[0]==undefined){return }Qport.LoadQueue.Queue[0].Exec(F)});setTimeout("Qport.LoadQueue.Queue[1].Exec();",1);var D=new SOAPClientParameters();D.add("viewuserId",Qport.Security.ViewUserId);SOAPClient.invoke("PageService.asmx","GetPages",D,true,function(F){if(Qport.LoadQueue.Queue[2]==undefined){return }Qport.LoadQueue.Queue[2].Exec(F)})};var A=new Array();QportEnvironment.prototype.AddAfterLoadEvent=function(B){A[A.length]=B};QportEnvironment.prototype.LoadingDone=function(){for(var C=0,B=A.length;C<B;C++){if(typeof (A[C])=="function"){qTimeout.setTimeout(25,A[C])}}A=new Array()};QportEnvironment.prototype.WsFail=function(C,B){if(Qport.IsLoaded){Qport.Alert(L()("wsProblem"))}};QportEnvironment.prototype.PagesLoaded=function(C){if(Qport.Halt||this.Pages!=null){return }if(C==null||!C){Qport.DoHalt();return }this.Pages=new Array();for(var E=0,B=C.length;E<B;E++){var F=false;for(var D=0;D<this.Pages.length;D++){if(this.Pages[D].Id==parseInt(C[E].Id)){F=true;break}}if(!F){this.Pages[E]=new Page();this.Pages[E].Id=parseInt(C[E].Id);this.Pages[E].Title=C[E].Title;this.Pages[E].ModHosts=null;this.Pages[E].LoadedCols=0;this.Pages[E].ReadOnly=C[E].ReadOnly;this.Pages[E].ColsWidth=C[E].ColsWidth}}};QportEnvironment.prototype.InfoPopup=function(D,C){var B=new Popup();B.Title=D;B.Modal=true;B.Draggable=true;B.HasCloseButton=true;B.Width=300;B.Height=250;B.OnLoad=new Delegate(this,this.__infoPopupLoaded,C);B.Show()};QportEnvironment.prototype.__infoPopupLoaded=function(C,B){B.ClientArea.innerHTML=C};QportEnvironment.prototype.Alert=function(E,F,B){if(B||typeof (l)!="function"||typeof (L)!="function"){alert(E);if(typeof (F)=="function"){F()}return }var D=Qport.Security.UrlInfo?L()("alert"):"";var C=new Alert(D);C.SetCallback(F);C.SetMessage(E);C.Show()};this.ZIndex={Behind:-1,Normal:0,Supreme:24011983,Module:5,HeadButtons:20,ModuleToggle:9,PageStatusDiv:500,WatermarkImage:1,Header:6,Logo:2,Footer:6,TabSelectedIndicator:20,LoginNotifier:10,Popup:500,ModalPopup:1000,ModalPopupGrayedoutLayover:750,DragModule:600,DragContainer:700,TopRightName:3,PageChangeDialog:20};QportEnvironment.prototype.SetPageStatus=function(C,B){Qport.GUI().SetPageStatus(C,B)};QportEnvironment.prototype.LoadModules=function(){if(Qport.Halt){return }if(this.CurrentPage==null){Qport.SwitchPageAllowed=true}if(this.CurrentPage.ModHosts!=null){Qport.SortModHosts();Qport.GUI().ReRender(true);Qport.SetModHostsVisible(true);if(Qport.CurrentPage.LoadedCols<Qport.UserSettings.Columns){Qport.ModLoader(Qport.CurrentPage.LoadedCols)}else{Qport.SwitchPageAllowed=true;if(Qport.IsLoaded){Qport.GUI().IsLoaded=true}if(typeof (this.onmodulesloaded)=="function"){this.onmodulesloaded()}}}else{Qport.SetPageStatus(true,L()("loading"));Qport.LoadedCols=0;Qport.CurrentPage.ModHosts=new Array();if(preloadedModules){for(var B=0;B<preloadedModules.length;B++){Qport.ModulesLoaded(preloadedModules[B],B,Qport.CurrentPage.Id,true)}Qport.GUI().CheckIfUseMods();preloadedModules=null;if(!Qport.IsDebug){Qport.BulkLoad.Start("MLoad"+Qport.CurrentPage.Id,"m.js.aspx?p="+Qport.CurrentPage.Id+"&u="+escape(Qport.Security.UserName)+"&e="+escape(Qport.Security.UrlInfo.Extension))}}else{Qport.ModLoader(0)}}};QportEnvironment.prototype.ModLoader=function(B){qTimeout.setTimeout(50,function(){var C=new SOAPClientParameters();C.add("pageId",Qport.CurrentPage.Id);C.add("column",B);C.add("viewUserId",Qport.Security.ViewUserId);var D=Qport.CurrentPage;SOAPClient.invoke("ModuleService.asmx","GetUseModsByPageId",C,true,function(E){Qport.ModulesLoaded(E,B,D.Id);if(B==1){if(!Qport.IsDebug){Qport.BulkLoad.Start("MLoad"+Qport.CurrentPage.Id,"m.js.aspx?p="+Qport.CurrentPage.Id+"&u="+escape(Qport.Security.UserName)+"&e="+escape(Qport.Security.UrlInfo.Extension))}}})})};QportEnvironment.prototype.GetMandatoryModuleCount=function(E){var D=0;var C=Qport.GetModHostsByColumn(E);for(var F=0,B=C.length;F<B;F++){if(C[F].IsMandatory){D++}}return D};QportEnvironment.prototype.GetPage=function(D){for(var C=0,B=this.Pages.length;C<B;C++){if(this.Pages[C].Id==D){return this.Pages[C]}}return null};QportEnvironment.prototype.ModulesLoaded=function(C,D,E,G){if(Qport.Halt){return }var B=false;if(D<Qport.UserSettings.Columns){if(!G){qTimeout.setTimeout(1,function(){Qport.ModLoader(D+1)})}}else{Qport.SwitchPageAllowed=true;B=true}if(C&&C.length>0){var J=this.GetPage(E);J.LoadedCols++;var H=J.ModHosts.length;for(var F=H,I=(H+C.length);F<I;F++){if(C[F-H].PageId!=E||(J.Contains(C[F-H].Id)&&C[F-H].IsMandatory.toLowerCase()!="true")){continue}J.ModHosts[F]=Qport.MapUseModResponseToModHost(C[F-H]);J.ModHosts[F].InitModHost()}if(E!=Qport.CurrentPage.Id){if(J.ModHosts==null){return }for(var F=0,I=J.ModHosts.length;F<I;F++){J.ModHosts[F].SetVisible(false)}}}else{Qport.CurrentPage.LoadedCols++;Qport.GUI().modHostDoneCount++;Qport.GUI().ModHostCompletelyLoaded(null)}if(B){if(typeof (this.onmodulesloaded)=="function"){this.onmodulesloaded()}}Qport.SortModHosts();Qport.OnColorChange();Qport.LoadedCols++;Qport.LoadingDone();Qport.SetPageStatus(false,L()("loading"));Qport.GUI().CheckIfUseMods()};QportEnvironment.prototype.SwitchPage=function(B,E){if(Qport.Halt){return }if(Qport.Security.SecurityGroup==SecurityGroup.Admin){Qport.UserSettings.PageId=B;var D=new SOAPClientParameters();D.add("newPageId",B);SOAPClient.invoke("UserService.asmx","SavePageChange",D,true,function(F){if(F){Qport.SwitchPageCallback(B,E)}else{Qport.Alert(L()("tech"))}})}else{Qport.SwitchPageCallback(B,E)}var C=new LogArgs("qport",Q_ACTION,8);C.Add("PageId",B);Qport.Log(this,C)};QportEnvironment.prototype.SwitchPageCallback=function(C,E){Qport.GUI().TotalQportHeight=0;Qport.GUI().IsLoaded=false;Qport.SetModHostsVisible(false);for(var D=0,B=Qport.CurrentPage.ModHosts.length;D<B;D++){Qport.CurrentPage.ModHosts[D].Template.MoveInDom(document.body)}Qport.SetModHostsInstantRefresh();Qport.SetActivePageById(C);Qport.LoadModules();Qport.GUI().CheckIfUseMods();if(typeof (E)=="function"){E()}};QportEnvironment.prototype.SetActivePageById=function(E){if(Qport.Halt){return }for(var D=0,B=this.Pages.length;D<B;D++){if(parseInt(this.Pages[D].Id)==parseInt(E)){this.CurrentPage=this.Pages[D];if(this.CurrentPage.Title.toLowerCase()!=Qport.Security.UserName.toLowerCase()){if(!isTrial){Browser.SetBrowserTitle(this.CurrentPage.Title+" "+Qport.Security.UserName+"."+this.DefaultBrowserTitle)}else{Browser.SetBrowserTitle(this.CurrentPage.Title+" "+this.DefaultBrowserTitle)}}else{if(!isTrial){Browser.SetBrowserTitle(Qport.Security.UserName+"."+this.DefaultBrowserTitle)}else{Browser.SetBrowserTitle(this.DefaultBrowserTitle)}}Qport.GUI().__resetColumnsWidth();return }}var C=new LogArgs("qport",Q_ERROR,1);C.Add("pageId",E);Qport.Log(this,C)};QportEnvironment.prototype.SetModHostsInstantRefresh=function(){if(Qport.Halt){return }if(Qport.CurrentPage.ModHosts==null){return }var D=Qport.CurrentPage.ModHosts;for(var C=0,B=D.length;C<B;C++){if(D[C].RefreshRate>0){D[C].UseMod.IsLoaded=false}}};QportEnvironment.prototype.SetModHostsActive=function(D){if(Qport.Halt){return }if(Qport.CurrentPage.ModHosts==null){return }for(var C=0,B=Qport.CurrentPage.ModHosts.length;C<B;C++){Qport.CurrentPage.ModHosts[C].SetActive(D)}};QportEnvironment.prototype.SetModHostsVisible=function(D){if(Qport.Halt){return }if(Qport.CurrentPage.ModHosts==null){return }for(var C=0,B=Qport.CurrentPage.ModHosts.length;C<B;C++){Qport.CurrentPage.ModHosts[C].SetVisible(D)}};QportEnvironment.prototype.LoadHelp=function(B){Qport.ScriptManager.Add("HelpLoader","js/Help.js",function(){Qport.OpenHelp(B)})};QportEnvironment.prototype.MapUseModResponseToModHost=function(C){if(Qport.Halt){return }var B=new ModHost();B.Id=parseInt(C.Id);B.Title=C.Title;B.OrgTitle=C.OrgTitle;B.IsExpanded=(C.IsExpanded.toLowerCase()=="true");B.IsEditable=(C.IsEditable.toLowerCase()=="true");B.IsEditableOnlyInsideModule=(C.IsEditableOnlyInsideModule.toLowerCase()=="true");B.IsDraggable=(C.IsDraggable.toLowerCase()=="true");B.IsToggleable=(C.IsToggleable.toLowerCase()=="true");B.IsFrontEndOnlyToggleable=(C.IsFrontEndOnlyToggleable.toLowerCase()=="true");B.IsDeleteable=(C.IsDeleteable.toLowerCase()=="true");B.IsTitleEditable=(C.IsTitleEditable.toLowerCase()=="true");B.IsMandatory=(C.IsMandatory.toLowerCase()=="true");B.MandatoryCol=parseInt(C.MandatoryCol);B.MandatoryPos=parseInt(C.MandatoryPos);B.Row=parseInt(C.Row);if(!B.IsMandatory){B.Column=parseInt(C.Column)}else{B.Column=B.MandatoryCol}B.WebServiceUri="Modules/"+C.WebServiceUri;B.ScriptUri="Modules/"+C.ScriptUri;B.ClassName=C.ClassName;B.ScriptUriExtends=C.ScriptUriExtends;B.ClassNameExtends=C.ClassNameExtends;B.LangFile=C.LangFile;B.ModuleId=parseInt(C.ModuleId);B.PageId=parseInt(C.PageId);B.HasHelp=(C.HasHelp.toLowerCase()=="true");B.RefreshRate=parseInt(C.RefreshRate);B.InstantRefresh=false;B.__JavascriptPropertyName=C.__JavascriptPropertyName;B.SettingsFile=C.SettingsFile;return B};QportEnvironment.prototype.AddNewModule=function(C){if(Qport.Halt){return }if(C==null||!C){Qport.Log(this,new LogArgs("qport",Q_ERROR,9))}else{var D=Qport.CurrentPage.ModHosts;var E=D.length;var B=Qport.MapUseModResponseToModHost(C);D[E]=B;B.IsNew=true;Qport.SortModHosts();return B}};QportEnvironment.prototype.GetModHostIndex=function(D,F){var G=0;this.SortModHosts();var C=Qport.GetModHostsByColumn(D.Column);if(C){for(var E=0,B=C.length;E<B;E++){if(C[E].IsMandatory){G++}if(C[E].Id==D.Id&&(!D.IsMandatory||(D.IsMandatory&&D.ModuleId==C[E].ModuleId))){return E-(F?0:G)}}}return -1};QportEnvironment.prototype.ModuleIsInCurrentPage=function(C){for(var B=0;B<this.CurrentPage.ModHosts.length;B++){if(this.CurrentPage.ModHosts[B].ModuleId==C){return true}}return false};QportEnvironment.prototype.OnColorChange=function(D){if(Qport.Halt){return }Qport.GUI().ReloadColors();var B=["PrimaryBack","PrimaryBackFlex","PrimaryFore","PrimaryBorder","SecondaryBack","SecondaryDarkBack","SecondaryDarkBack","SecondaryDarkBorder","SecondaryFore","SecondaryBorder","SecondaryBorderOnlyColor","3DBorder","PrimaryTextBack","PrimaryTextFore","PrimaryTextBorder","SecondaryTextBack","SecondaryTextFore","SecondaryTextBorder"];for(var C=0;C<B.length;C++){Qport.ParseCssClass(B[C],Qport.UpdateCssClass,D)}};QportEnvironment.prototype.GetPrimaryFlexColor=function(){if((Qport.UserSettings.Theme&&Qport.UserSettings.Theme.HasWhiteBackground)||(Qport.UserSettings.Theme==null&&Qport.UserSettings.HasWhiteBackground)){return"#FFFFFF"}else{return Qport.GUI().Colors.PrimaryColor.ToCssString()}};QportEnvironment.prototype.UpdateCssClass=function(C,B,D){if(!C||!C.style){return }var E=Qport.GUI().Colors;switch(B){case"PrimaryBack":C.style.backgroundColor=E.PrimaryColor.ToCssString();break;case"PrimaryBackFlex":C.style.backgroundColor=Qport.GetPrimaryFlexColor();break;case"PrimaryFore":C.style.color=E.PrimaryColor.ToCssString();break;case"PrimaryBorder":C.style.borderColor=E.PrimaryColor.ToCssString();C.style.borderStyle="solid";break;case"SecondaryBack":C.style.backgroundColor=E.SecondaryColor.ToCssString();break;case"SecondaryDarkBack":C.style.backgroundColor=E.SecondaryDarkColor.ToCssString();break;case"SecondaryDarkBorder":C.style.borderColor=E.SecondaryDarkColor.ToCssString();break;case"SecondaryDarkBack":C.style.backgroundColor=E.SecondaryDarkColor.ToCssString();break;case"SecondaryFore":C.style.color=E.SecondaryColor.ToCssString();break;case"3DBorder":C.style.borderColor=E.SecondaryColor.ToCssString();C.style.borderStyle="outset";C.style.borderWidth="2px";break;case"SecondaryBorder":C.style.borderColor=E.SecondaryColor.ToCssString();C.style.borderStyle="solid";C.style.borderWidth="1px";break;case"SecondaryBorderOnlyColor":C.style.borderColor=E.SecondaryColor.ToCssString();break;case"PrimaryTextBack":C.style.backgroundColor=E.PrimaryTextColor.ToCssString();break;case"PrimaryTextFore":C.style.color=E.PrimaryTextColor.ToCssString();break;case"PrimaryTextBorder":C.style.borderColor=E.PrimaryTextColor.ToCssString();C.style.borderStyle="solid";C.style.borderWidth="1px";break;case"SecondaryTextBack":C.style.backgroundColor=E.SecondaryTextColor.ToCssString();break;case"SecondaryTextFore":C.style.color=E.SecondaryTextColor.ToCssString();break;case"SecondaryTextBorder":C.style.borderColor=E.SecondaryTextColor.ToCssString();C.style.borderStyle="solid";C.style.borderWidth="1px";break}};QportEnvironment.prototype.__hasCssClass=function(C,B){return(C.CssClassIds&&C.CssClassIds[B])};QportEnvironment.prototype.AddCssClass=function(C,B){if(!this.__hasCssClass(C,B)){Qport.GetCssClass(B).push(C);if(C.CssClassIds==undefined){C.CssClassIds=new Object()}C.CssClassIds[B]=true;Qport.UpdateCssClass(C,B)}};QportEnvironment.prototype.RemoveCssClass=function(E,C){if(this.__hasCssClass(E,C)){var B=Qport.GetCssClass(C);for(var D=0;D<B.length;D++){if(B[D]==E){B.splice(D,1);break}}E.CssClassIds[C]=null}};QportEnvironment.prototype.GetCssClass=function(B){if(Qport.Cache.CssClass==undefined){Qport.Cache.CssClass=new Object()}var C=Qport.Cache.CssClass;if(C[B]==undefined){C[B]=new Array()}return C[B]};QportEnvironment.prototype.ParseCssClass=function(C,G,F){if(typeof (G)!="function"){return }var E=Qport.GetCssClass(C);for(var D=0,B=E.length;D<B;D++){G(E[D],C,F)}};QportEnvironment.prototype.GetUseModByObject=function(B){if(B==null){return false}while((B.parentNode.Owner==null||typeof (B.parentNode.Owner)!="object"||(typeof (B.parentNode.Owner)=="object"&&B.parentNode.Owner.Id==undefined))&&B.tagName.toLowerCase()!="body"){B=B.parentNode}if(typeof (B.parentNode.Owner)=="object"&&B.parentNode.Owner.Id!=undefined){return B.parentNode.Owner}else{return false}};QportEnvironment.prototype.UserSettingsLoad=function(B){Qport.ScriptManager.Add("UserSettingsLoader","js/UserSettings.js",function(){if(typeof (Qport.SaveUserSettings)=="function"){Qport.SaveUserSettings(B)}})};QportEnvironment.prototype.DeleteModHost=function(B){if(Qport.Halt||Qport.Security.SecurityGroup!=SecurityGroup.Admin||B==null||typeof (B)!="object"){return }if(confirm(L()("deleteConfirmation").replace("{0}",L()("module").toLowerCase()))){B.Template.Disable();var C=new SOAPClientParameters();C.add("UseMod",B);SOAPClient.invoke("ModuleService.asmx","Delete",C,true,new Delegate(this,this.DeleteModHostCallback,B))}};QportEnvironment.prototype.DeleteModHostCallback=function(C,D){if(Qport.Halt){return }if(D){C.Template.Remove(new Delegate(this,this.RemoveFromModHosts,C,true));var B=new LogArgs("qport",Q_ACTION,9);B.Add("UseMod",C.Id);Qport.Log(this,B)}else{var B=new LogArgs("qport",Q_ERROR,4);B.Add("UseMod",C.Id);Qport.Log(this,B)}};QportEnvironment.prototype.RemoveFromModHosts=function(D,G){for(var E=0,B=Qport.CurrentPage.ModHosts.length;E<B;E++){var F=Qport.CurrentPage.ModHosts[E];if((!D.IsMandatory&&F.Id==D.Id)||(D.IsMandatory&&F.ModuleId==D.ModuleId)){var C=D.Column;if(G){F.Dispose()}Qport.CurrentPage.ModHosts.splice(E,1);Qport.GUI().CheckIfUseMods();return }}};QportEnvironment.prototype.UpdateModHost=function(C,B){if(Qport.Halt){return }if(!Qport.Security.MajorEditAllowed()){B(false);return }if(C==null||typeof (C)!="object"){return }Qport.SwitchPageAllowed=false;var D=new SOAPClientParameters();if(C.Id>0){D.add("UseMod",C);SOAPClient.invoke("ModuleService.asmx","Update",D,true,function(E){Qport.SwitchPageAllowed=true;B(E)})}else{D.add("moduleId",C.ModuleId);D.add("column",C.Column);D.add("row",C.Row);D.add("pageId",C.PageId);SOAPClient.invoke("ModuleService.asmx","Add",D,true,function(E){Qport.SwitchPageAllowed=true;B(E)})}};QportEnvironment.prototype.GetLanguage=function(){if(Qport.Halt){return }if(!this.UserSettings){return Qport.Security.UrlInfo.Language}else{return this.UserSettings.LanguageName}};QportEnvironment.prototype.LogoClickEventHandler=function(B){Browser.OpenWindow(this.GetSiteUrl())};QportEnvironment.prototype.SaveQuote=function(B,D){var C=new SOAPClientParameters();C.add("userId",Qport.Security.UserId);C.add("quote",B);SOAPClient.invoke("UserService.asmx","SetQuote",C,true,D)};QportEnvironment.prototype.SetQuoteCallbackHandler=function(B){if(!B){alert(L()("tech"))}};QportEnvironment.prototype.GetSiteUrl=function(){return"http://"+siteSubdomain+"."+this.Security.UrlInfo.ShortUrl};QportEnvironment.prototype.GetAnonymousUrl=function(){return"http://anonymous."+this.Security.UrlInfo.ShortUrl};QportEnvironment.prototype.PrivacyClickEventHandler=function(C){if(pvLink.length==""){var B=new Popup();B.Title=L()("privacy");B.Width=350;B.Height=400;B.Modal=true;B.Draggable=true;B.OnLoad=function(D){D.ClientArea.innerHTML=L("Privacy"+(pvname.length>0?("-"+pvname):""))("privacy")};B.Show()}else{Browser.OpenWindow(pvLink,"")}};QportEnvironment.prototype.AVClickEventHandler=function(C){if(avLink.length==""){var B=new Popup();B.Title=L()("av");B.Width=300;B.Height=400;B.Modal=true;B.Draggable=true;B.OnLoad=function(D){D.ClientArea.innerHTML=L("av")("av")};B.Show()}else{Browser.OpenWindow(avLink,"")}};QportEnvironment.prototype.StartpageClickEventHandler=function(B,C){Browser.SetMyHomepage(this.Security.GetUserDomain(),B)};QportEnvironment.prototype.TabClickEventHandler=function(B,C){if(!this.SwitchPageAllowed){return }if(B.Page.Id==this.CurrentPage.Id){this.SwitchPageAllowed=true;return }this.SwitchPageAllowed=false;Qport.SwitchPage(B.Page.Id,C);Qport.WriteStat("tab","switch")};QportEnvironment.prototype.ShowPageChangeDialog=function(B){if(Qport.Security.UserId>0){this.ScriptManager.Add("PageChangeDialogLoader","js/PageChangeDialog.js",function(){Qport.GUI().RenderPageChangeDialog(B,(B.Page.Id==Qport.Pages[0].Id))})}};QportEnvironment.prototype.TabMouseOutEventHandler=function(B,C){if(!Browser.IsChildNode(B,C.targetobject)){qTimeout.removeTimeout(this.__tabMouseOverTimeoutId)}};QportEnvironment.prototype.TabAddClickEventHandler=function(B){this.ScriptManager.Add("AddPageLoader","js/AddPage.js",function(){Qport.AddPage()});Qport.WriteStat("tab","add")};QportEnvironment.prototype.AddModuleClickEventHandler=function(B){this.ScriptManager.Add("AddModuleLoader2","js/AddModule2.js",function(){var C=new AddModuleDialog2();C.Show();Qport.WriteStat("action","add_modules_clicked")})};QportEnvironment.prototype.AddRssClickEventHandler=function(B){this.ScriptManager.Add("AddRssLoader","js/AddRss.js",function(){var C=new AddRssDialog();C.Show();Qport.WriteStat("action","add_rss_clicked")})};QportEnvironment.prototype.BtnSettingsClickEventHandler=function(B){this.ScriptManager.Add("SettingsDialog2","js/SettingsDialog2.js",function(){var C=new SettingsDialog2();C.Open();Qport.WriteStat("action","change_settings_clicked")})};QportEnvironment.prototype.BtnTellAFriendClickEventHandler=function(B){this.ScriptManager.Add("TaF","js/TellAFriend.js",function(){if(typeof (TaF)=="function"){var C=new TaF();var D=L("tellafriend"+tellafriendname)("message").replace("{0}",emailOpeningName);C.Open(L()("tellafriendtitle"),D);Qport.WriteStat("action","tellAfriend_clicked")}})};QportEnvironment.prototype.HelpClickEventHandler=function(B){this.LoadHelp(null);Qport.WriteStat("action","help_clicked")};QportEnvironment.prototype.LoginClickEventHandler=function(B){this.Security.ShowLoginForm()};QportEnvironment.prototype.LogoutClickEventHandler=function(B){this.Security.Logout();Qport.WriteStat("action","logout_clicked")};QportEnvironment.prototype.SaveModHostTitle=function(E,D,C){var B=new SOAPClientParameters();B.add("useModId",E.Id);B.add("title",D);SOAPClient.invoke("ModuleService.asmx","SetTitle",B,true,function(G){if(G){var F=new LogArgs("gui",Q_ACTION,15);F.Add("Title",D);Qport.Log(E,F)}if(typeof (C)=="function"){C(G)}})};QportEnvironment.prototype.PlayMultiMedia=function(B){if(!this.__multiMediaControl){Qport.ScriptManager.Add("MultiMediaControl","js/MultimediaPlayerControl.js",new Delegate(this,this.__multiMediaControlLoadedHandler,B))}else{this.__multiMediaControl.Play(B)}};QportEnvironment.prototype.__multiMediaControlLoadedHandler=function(B){this.__multiMediaControl=new MultiMediaControl();this.__multiMediaControl.Init();this.GUI().RenderMultiMediaControl(this.__multiMediaControl,B)};QportEnvironment.prototype.CallHttpProxy=function(D,C,E){var B=new SOAPClientParameters();B.add("viewUserId",Qport.Security.ViewUserId);B.add("urlId",D);B.add("parameters",C,"string");SOAPClient.invoke("XmlHttpProxyService.asmx","Call",B,true,E)};QportEnvironment.prototype.ConstructUserUrl=function(D){var C="";var B="";if(Qport.Security.UrlInfo.IsLocal){B=document.location.href.replace("?"+Qport.Security.ViewUserName,"?"+D)}else{if(hasFixedSubdomain){B=document.location.href}else{B="http://"+D+"."+Qport.Security.UrlInfo.ShortUrl}}return C+B}}QportEnvironment.prototype.BulkLoad={IsActive:false,__queue:new Array(),Register:function(modHost,callback){if(!Qport.BulkLoad.IsActive){modHost.InitScript();return }if(eval("typeof("+modHost.ClassName+")")!="undefined"){callback.call(modhost);return }var callbackObj={ModHost:modHost,CallBack:callback};Qport.BulkLoad.__queue.push(callbackObj)},Start:function(B,A){Qport.BulkLoad.IsActive=true;Qport.ScriptManager.Add(B,A,Qport.BulkLoad.Complete,true)},Complete:function(){Qport.BulkLoad.IsActive=false;for(var i=0,len=Qport.BulkLoad.__queue.length;i<len;i++){var qi=Qport.BulkLoad.__queue[i];if(eval("typeof("+qi.ModHost.ClassName+")")!="undefined"){qi.CallBack.call(qi.ModHost)}else{qi.ModHost.InitScript(true)}}Qport.BulkLoad.__queue=new Array()}};QportEnvironment.prototype.WriteStat=function(C,A){if(C.length>40){alert("Stat action > 40 chars! (action:'"+C+"', itemTitle: '"+A+"')");return }var B=new SOAPClientParameters();B.add("userId",(Qport.Security.UserId>0?Qport.Security.UserId:null));B.add("action",C);B.add("itemTitle",A);SOAPClient.invoke(this.StatsGenericWebServiceUri,"LogQportAction",B,true)};QportEnvironment.prototype.ImageLib={_IMAGES_PATH:"images/",_ICON_PATH:"images/icons/",_IMAGE_DICT:{error:"error.png",add:"add2.png","delete":"delete2.png",edit:"pencil2.png",save:"disk_blue.png",folder:"folder.png",folder_closed:"folder_closed.png",document:"document.png",expand:"navigate_plus.png",collapse:"navigate_minus.png",cancel:"undo.png",bg_list_alternatingrow:"gradGray.png",bg_listmenu_hoverrow:"gradGrayRev2.png",bg_listmenu_selectedrow:"gradLightGrayRev2.png",message_add:"message_add.png",message_edit:"message_edit.png",message_delete:"message_delete.png",order_up:"arrow_up_blue.png",order_down:"arrow_down_blue.png",order_priority:"flag_blue.png",order_priority_add:"flag_add_blue.png",order_priority_delete:"flag_delete_blue.png"},getSrc:function(B,A){var C;if(A){C=this._ICON_PATH+A+"x"+A+"/"}else{C=this._IMAGES_PATH}if(this._IMAGE_DICT[B]){return C+this._IMAGE_DICT[B]}else{return C+this._IMAGE_DICT.error}},createButton:function(D,C,A,E,F){var B=Qport.GUI().CreateElement("div",A);if(F){B.title=F}else{F=L()(D,false);if(F){B.title=F}}Browser.SetPng(B,this.getSrc(D,C));B.className="icon"+C+"x"+C;if(E){B.className+=" "+E}Browser.SetHandCursor(B);return B}};function Alert(A){Popup.apply(this,arguments);this.Width=300;this.Height=175;this.Title=A;this.HasCloseButton=true;this.Systemname="alert"+Math.random();this.Modal=true;this.Overflow="hidden";this.Draggable=true;this.DisableEscape=true;this.HasCloseButton=true}Alert.prototype={__callback:null,__message:null,SetCallback:function(A){this.__callback=A},SetMessage:function(A){this.__message=A},OnLoad:function(){this.ClientArea.style.textAlign="right";var A=this.CreateElement("div",this.ClientArea);A.style.textAlign="left";A.style.width="100%";A.style.height="115px";A.style.marginBottom="5px";A.style.overflow="auto";A.innerHTML=this.__message.replace("\n","<br/>")},OnUnload:function(){if(typeof (this.__callback)=="function"){this.__callback()}}};Alert.extend(Popup);var UPDATING=false;function SOAPClientParameters(){var A=new Object();this.add=function(B,D,C){A[B]=D;if(C&&C.length>0){A[B].__ContentType=C}return this};this.toXml=function(){return this.varToString(A)};this.varToString=function(D,B){var C=new StringBuffer();for(var E in D){var F=D[E];if(F==null||typeof (F)=="function"||E=="__JavascriptPropertyName"||E=="__ContentType"){continue}if(typeof (F)=="object"&&(typeof (F.style)=="object"||typeof (F.constructor)!="function"||(typeof (D.IsNonSerializeableField)=="function"&&D.IsNonSerializeableField(E)))){continue}else{if(typeof (D.IsNonSerializeableField)=="function"&&D.IsNonSerializeableField(E)){continue}if(F.__JavascriptPropertyName!=undefined&&F.__JavascriptPropertyName!=null&&(D.length&&D.length>0)){C.append("<"+F.__JavascriptPropertyName+">")}else{if(D.__ContentType!=undefined&&D.__ContentType!=null&&D.__ContentType.length>0){C.append("<"+D.__ContentType+">")}else{C.append("<"+E+">")}}switch(typeof (F)){case"string":case"boolean":case"number":C.append(Browser.EscapeHtml(F.toString()));break;default:if(F!=null&&typeof (F.getDate)=="function"){C.append(F.toDOTNETString())}else{C.append(this.varToString(F))}break}if(F.__JavascriptPropertyName!=undefined&&F.__JavascriptPropertyName!=null&&(D.length&&D.length>0)){C.append("</"+F.__JavascriptPropertyName+">")}else{if(D.__ContentType!=undefined&&D.__ContentType!=null&&D.__ContentType.length>0){C.append("</"+D.__ContentType+">")}else{C.append("</"+E+">")}}}}return C.toString()}}function SOAPClient(){}SOAPClient.ActiveConnections=0;SOAPClient.PendingPool=new Array();SOAPClient.Conn=new Array();SOAPClient.ConnBusy=false;SOAPClient.NewRequestSend=function(A){this.ActiveConnections++;if(!this.ProcessingDiv){this.ProcessingDiv=document.createElement("div");this.ProcessingDiv.style.display="none";this.ProcessingDiv.style.position="absolute";this.ProcessingDiv.style.top="0px";this.ProcessingDiv.style.left="0px";this.ProcessingDiv.style.zIndex=19831977;this.ProcessingDiv.style.width="2px";this.ProcessingDiv.style.height="2px";this.ProcessingDiv.style.fontSize="0px";this.ProcessingDiv.style.backgroundColor="#555555";document.body.appendChild(this.ProcessingDiv)}this.ProcessingDiv.style.display="block"};SOAPClient.RequestEnded=function(A){this.ActiveConnections--;this.ProcessingDiv.style.display="none"};SOAPClient.ProcessItem=function(A){if(A.async){SOAPClient._sendSoapRequest(A.url,A.method,A.parameters,A.async,A.callback)}else{return SOAPClient._sendSoapRequest(A.url,A.method,A.parameters,A.async,A.callback)}};SOAPClient.ProcessPendingPool=function(B){if(SOAPClient.PendingPool.length>0){if(SOAPClient.ActiveConnections<2&&!B){SOAPClient.ConnBusy=true;SOAPClient.ProcessItem(SOAPClient.PendingPool[0]);SOAPClient.PendingPool.splice(0,1);qTimeout.setTimeout(25,SOAPClient.ProcessPendingPool)}else{if(B){for(var A=0;A<SOAPClient.PendingPool.length;A++){SOAPClient.ProcessItem(SOAPClient.PendingPool[A]);SOAPClient.PendingPool.splice(A,1);A--}}else{qTimeout.setTimeout(25,SOAPClient.ProcessPendingPool)}}}};SOAPClient.AddPP=function(E,F){if(F==0){SOAPClient.PendingPool[SOAPClient.PendingPool.length]=E}else{var C=false;var D=false;for(var B=0;B<SOAPClient.PendingPool.length;B++){var A=SOAPClient.PendingPool[B];if(A.prio==F){C=true}if(C&&A.prio!=F){D=true;C=false}if(D){SOAPClient.PendingPool=SOAPClient.PendingPool.insert(B,E);return }}SOAPClient.PendingPool=SOAPClient.PendingPool.insert(0,E)}};SOAPClient.invoke=function(A,H,C,B,G,D){if(this.ActiveConnections>100){Qport.DoHalt();return }var F=5;if(D){F=0}var E=new Object();E.url=A;E.method=H;E.parameters=C;E.async=B;E.callback=G;E.prio=F;if(!B){SOAPClient.ConnBusy=true;return SOAPClient.ProcessItem(E)}else{SOAPClient.AddPP(E,F);SOAPClient.ProcessPendingPool()}};SOAPClient._sendSoapRequest=function(E,A,K,F,J){if(E==undefined||E.length==0||(typeof (Qport)!="undefined"&&Qport.Halt)){return }var I="http://tempuri.org/";var D=new StringBuffer();D.append('<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body>');D.append("<");D.append(A);D.append(' xmlns="');D.append(I);D.append('">');D.append(K.toXml());D.append("</");D.append(A);D.append("></soap:Body></soap:Envelope>");var B=D.toString();var G=SOAPClient._getXmlHttp(F);G.open("POST",E,F);var M=((I.lastIndexOf("/")!=I.length-1)?I+"/":I)+A;G.setRequestHeader("SOAPAction",M);G.setRequestHeader("Content-Type","text/xml; charset=utf-8");if(typeof (Qport)=="object"&&Qport.Security!=null){G.setRequestHeader("qUserId",Qport.Security.UserId==null?0:Qport.Security.UserId);G.setRequestHeader("qUniqueId",Qport.Security.SessionId==null?0:Qport.Security.SessionId);G.setRequestHeader("qAcquired",Qport.Security.SessionAcquired==null?0:Qport.Security.SessionAcquired.toString());G.setRequestHeader("qValidationHash",(Qport.Security.SessionHash==null||Qport.Security.SessionHash.length<1)?" ":Qport.Security.SessionHash)}if(F){var C=new XmlHttpWatcher(A,F,J,G,E);C.Watch()}try{G.send(B)}catch(H){}this.NewRequestSend(E+"-"+A);if(!F){return SOAPClient._onSendSoapRequest(A,F,J,G,E)}};SOAPClient._onSendSoapRequest=function(method,async,callback,req,url){var r=req.responseText.replace(/^(.+)?\r\n$/,"$1");var o=null;SOAPClient.RequestEnded(method);SOAPClient.ConnBusy=false;if(req.status==500&&req.responseXML){if(req.responseXML.getElementsByTagName("faultcode").length>0){if(typeof (LogArgs)=="function"){var args=new LogArgs("soapclient",Q_ERROR,2);var res=req.responseXML.getElementsByTagName("faultstring")[0].childNodes[0].nodeValue;res=res.replace("System.Web.Services.Protocols.SoapException: ","");try{args.Code=parseInt(res)}catch(e){args.Code=2;args.Add("Exception",res)}if(args.Code==8){if(UPDATING){return }UPDATING=true;var mess="We are updating our servers, therefore you can't use your page at this moment. We'll keep the duration of this all limited to as little times as possible. Sorry for the inconvenience.";if(typeof (L)=="function"){mess=L()("updatingMessage")}if(typeof (Qport)!="undefined"){Qport.Alert(mess)}else{alert(mess)}return }Qport.Log(this,args)}isError=true;o=null}}else{if(r.length>0){try{if(Utilities.IsJsonString(r)){eval("o = "+r+";")}else{if(r=="[]"){r=new Array()}else{if(r=="{}"){r=new Object()}else{if(r=="false"||r=="true"){r=eval(r)}else{if(Utilities.IsInteger(r)){r=parseInt(r)}else{if(r.substring(r.length-2)=="\r\n"){r=r.substring(0,r.length-2)}}}}}o=r}}catch(e){o=null}}else{if(r==""){o=""}}}req=null;if(callback&&async){callback(o)}else{if(!async){return o}}};SOAPClient._getXmlHttp=function(B){var C=null;try{if(window.XMLHttpRequest){C=new XMLHttpRequest();if(C.readyState==null){C.readyState=1;C.addEventListener("load",function(){C.readyState=4},false)}}else{if(window.ActiveXObject){C=new ActiveXObject(SOAPClient._getXmlHttpProgID())}}}catch(A){}return C};SOAPClient._getXmlHttpProgID=function(){if(SOAPClient._getXmlHttpProgID.progid){return SOAPClient._getXmlHttpProgID.progid}var D=["MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];var E;for(var C=0,A=D.length;C<A;C++){try{E=new ActiveXObject(D[C]);return SOAPClient._getXmlHttpProgID.progid=D[C]}catch(B){}}};function XmlHttpWatcher(F,D,E,B,C,A){this.Method=F;this.ASync=D;this.Callback=E;this.XmlHttp=B;this.Url=C;this.Elapsed=0;XmlHttpWatcher.prototype.Watch=function(){if(this.XmlHttp.readyState==4){SOAPClient._onSendSoapRequest(this.Method,this.ASync,this.Callback,this.XmlHttp,this.Url);this.Callback=null}else{if(this.Elapsed>=30000){this.XmlHttp.abort();this.Callback(null);this.Callback=null}else{var G=this;qTimeout.setTimeout(10,function(){G.Watch()});this.Elapsed+=10}}}}var ButtonSet={OkCancel:0,SaveCancel:1};var FancyGUI={MoveTime:200,MoveInterval:25,ResizeTime:80,ResizeInterval:10,FadeMax:100,FadeTime:50,FadeInterval:12,TooltipRef:new Array(),TtEvId:-1,RemoveTooltip:function(A){if(typeof (A.RemoveTooltip)=="function"){A.RemoveTooltip()}},SetTooltip:function(B,D,A){if(!B||D==""){return }var C=new Tooltip();C.Init(B,D,A)},Prompt:function(C,D,E,B,A){Qport.ScriptManager.Add("PromptLoader","js/Prompt.js",function(){Qport.GUI().Fancy.Prompt(C,D,E,B,A)})},GetMoveDelta:function(D,A,B,C){if(D==A){return 0}if(C>0){return(A-D)/(C/this.MoveInterval)}else{return(A-D)/(this.MoveTime/this.MoveInterval)}},GetResizeDelta:function(C,A,B){if(C==A){return 0}return(A-C)/(this.ResizeTime/this.ResizeInterval)},GetFadeDelta:function(C,A,B){if(C==A){return 0}return(A-C)/(this.FadeTime/this.FadeInterval)},FadeObject:function(E,I,J,K,G){var B,F;var H;var A;if(I=="in"){B=0;F=this.FadeMax}else{if(I=="out"){B=100;F=0}}if(animation){if(!K){K=0;if(I=="in"){G=0}else{if(I=="out"){G=100}}}K++;var D=this.GetFadeDelta(B,F,K);A=G+D;H=(this.FadeInterval*K>=this.FadeTime);if(I=="out"){if(A<F){A=F}}else{if(I=="in"){if(A>F){A=F}}}}else{H=true;A=F}Browser.SetOpacity(E,parseInt(A));if(!H){var C=this;qTimeout.setTimeout(this.FadeInterval,function(){C.FadeObject(E,I,J,K,A)})}else{if(typeof (J)=="function"){J()}}},MoveObject:function(E,B,A,F,D,N,J,P,K,I){if(!P){P=0;K=B;I=A}P++;var Q=this.GetMoveDelta(B,F,P,J);var O=this.GetMoveDelta(A,D,P,J);var H=K+Q;var G=I+O;var M;if(J){M=(this.MoveInterval*P>=J)}else{M=(this.MoveInterval*P>=this.MoveTime)}if(M){H=F;G=D}if(typeof (E)=="function"){E(H,G)}else{Qport.GUI().SetLocation(E,H,G)}if(!M){var C=this;qTimeout.setTimeout(this.MoveInterval,function(){C.MoveObject(E,B,A,F,D,N,J,P,H,G)})}else{if(typeof (N)=="function"){N()}}},ResizeObject:function(G,B,K,H,D,O,P,N,F){if(!P){P=0;N=B;F=K}P++;var A=this.GetResizeDelta(B,H,P);var J=this.GetResizeDelta(K,D,P);var I=N+A;var E=F+J;var M=(this.ResizeInterval*P>=this.ResizeTime);if(M){I=H;E=D}if(typeof (G)=="function"){G(I,E)}else{Qport.GUI().SetDimensions(G,I,E)}if(!M){var C=this;qTimeout.setTimeout(this.ResizeInterval,function(){C.ResizeObject(G,B,K,H,D,O,P,I,E)})}else{if(typeof (O)=="function"){O()}}},SetOnFocusBlurHandler:function(A,B){A.value=B;A.style.color="#999999";this.RemoveTextOnFocus(A,B);this.RegainTextOnBlur(A,B)},RemoveTextOnFocus:function(A,B){eh.Add(A,"focus",new Delegate(A,this.RemoveTextOnFocusEventHandler,A,B))},RegainTextOnBlur:function(A,B){eh.Add(A,"blur",new Delegate(A,this.RegainTextOnBlurEventHandler,A,B))},RemoveTextOnFocusEventHandler:function(A,B,C){if(A.value==B){A.value="";A.style.color="black"}},RegainTextOnBlurEventHandler:function(A,B,C){if(A.value==""){A.value=B;A.style.color="#999999"}},SetListRowStyle:function(B,A){B.style.borderBottom="1px dotted #ddd";if(A){Browser.SetPng(B,Qport.ImageLib.getSrc("bg_list_alternatingrow"));B.style.backgroundRepeat="repeat-x"}else{B.style.background=""}},__fadeAwayTimeoutId:null,objectFadeAwayTimer:function(D,B,C,A){if(typeof D=="object"){D.innerHTML=B;__fadeAwayTimeoutId=qTimeout.setTimeout(C,function(){if(A){D.innerHTML=""}else{D.innerHTML=".";D.style.color="#FFFFFF"}})}},Confirm:function(A,D,C,B){Qport.ScriptManager.Add("ConfirmLoader","js/Confirm.js",function(){Qport.GUI().Fancy.Confirm(A,D,C,B)})}};function Tooltip(){this.__object=null;this.__value="";this.__useNative=false;this.__clientArea=null;this.__iframe=null;this.__mouseOverTimeout=400;this.__mouseOverTimeoutId=-1;this.__documentClickEvent=-1;this.__objectClickEvent=-1;this.__objectMouseOverEvent=-1;this.__objectMouseOutEvent=-1;this.__mouseMoveEventId=-1;this.__currentX=-1;this.__currentY=-1;this.__isVisible=false}Tooltip.prototype.Init=function(C,D,A){this.__object=C;this.__value=D;this.__useNative=A;this.__isVisible=false;if(this.__useNative){this.__object.title=D}else{if(!Qport.GUI().TooltipArea){var B=Qport.GUI().CreateElement("span");B.style.padding="3px";B.style.border="solid 1px #999999";B.style.display="none";document.body.appendChild(B);B.style.backgroundColor="#FFFFE1";B.style.display="none";B.style.position="absolute";B.style.zIndex=Qport.ZIndex.Supreme;eh.Add(B,"mouseover",new Delegate(this,this.__ttAreaMouseOver));Browser.SetOpacity(B,95);Qport.GUI().TooltipArea=B}if(!Qport.GUI().TooltipIFrame){var E=Qport.GUI().CreateElement("iframe");E.id="ttIFrame";E.style.display="none";E.style.position="absolute";E.style.zIndex=(Qport.ZIndex.Supreme-1);E.style.border="0px";Browser.SetOpacity(E,0);document.body.appendChild(E);Qport.GUI().TooltipIFrame=E}this.__clientArea=Qport.GUI().TooltipArea;this.__iframe=Qport.GUI().TooltipIFrame;this.__objectMouseOverEvent=eh.Add(C,"mouseover",new Delegate(this,this.__objectMouseOverEventHandler));this.__objectMouseOutEvent=eh.Add(C,"mouseout",new Delegate(this,this.__objectMouseOutEventHandler));this.__objectClickEvent=eh.Add(C,"mousedown",new Delegate(this,this.__objectClickEventHandler));if(this.__documentClickEvent!=-1){eh.Remove(eh.DocumentClick,this.__documentClickEvent)}this.__documentClickEvent=eh.Add(false,eh.DocumentClick,new Delegate(this,this.__documentClickEventHandler))}this.__object.RemoveTooltip=new Delegate(this,this.__removeTooltip)};Tooltip.prototype.__show=function(A,C){if(this.__useNative){return }if(this.__isVisible){return }if(moduleBeingDragged){return }this.__isVisible=true;this.__clientArea.innerHTML=Utilities.NewlineToBR(Utilities.StripHTML(this.__value));A+=10;C+=10;var B=this.__clientArea;B.style.left="0px";B.style.top="0px";B.style.width="";B.style.visibility="hidden";B.style.display="";B.style.overflow="hidden";if(B.offsetWidth>200){B.style.width="200px"}if((A+B.offsetWidth)>Browser.GetWindowWidth()){A=(Browser.GetWindowWidth()-B.offsetWidth-5)}if((C+B.offsetHeight)>Qport.GUI().GetHeight()){C=(Qport.GUI().GetHeight()-B.offsetHeight-20)}B.style.left=A+"px";B.style.top=C+"px";this.__iframe.style.left=B.style.left;this.__iframe.style.top=B.style.top;this.__iframe.style.width=B.offsetWidth+"px";this.__iframe.style.height=B.offsetHeight+"px";B.style.visibility="";this.__iframe.style.display="block"};Tooltip.prototype.__hide=function(){this.__iframe.style.display="none";this.__clientArea.style.display="none";this.__isVisible=false;if(this.__mouseOverTimeoutId){qTimeout.removeTimeout(this.__mouseOverTimeoutId)}if(this.__mouseMoveEventId){eh.Remove(eh.DocumentMouseMove,this.__mouseMoveEventId)}};Tooltip.prototype.__objectMouseOverEventHandler=function(A){if(this.__mouseOverTimeoutId){qTimeout.removeTimeout(this.__mouseOverTimeoutId)}if(this.__mouseMoveEventId){eh.Remove(eh.DocumentMouseMove,this.__mouseMoveEventId)}this.__mouseMoveEventId=eh.Add(false,eh.DocumentMouseMove,new Delegate(this,this.__mouseMoveEventHandler));this.__mouseOverTimeoutId=qTimeout.setTimeout(this.__mouseOverTimeout,new Delegate(this,this.__objectMouseOverTimeout,A))};Tooltip.prototype.__mouseMoveEventHandler=function(A){this.__currentX=A.x;this.__currentY=A.y};Tooltip.prototype.__objectMouseOverTimeout=function(B){if(this.__mouseMoveEventId){eh.Remove(eh.DocumentMouseMove,this.__mouseMoveEventId)}var A=B.x,C=B.y;if(this.__currentX>-1){A=this.__currentX}if(this.__currentY>-1){C=this.__currentY}this.__show(A,C+Browser.GetScrolltop())};Tooltip.prototype.__objectMouseOutEventHandler=function(A){if(this.__mouseOverTimeoutId){qTimeout.removeTimeout(this.__mouseOverTimeoutId)}this.__hide()};Tooltip.prototype.__objectClickEventHandler=function(A){this.__hide()};Tooltip.prototype.__documentClickEventHandler=function(A){this.__hide()};Tooltip.prototype.__removeTooltip=function(){if(this.__useNative){this.__object.title=""}else{if(this.__documentClickEvent!=-1){eh.Remove(eh.DocumentClick,this.__documentClickEvent)}if(this.__objectMouseOverEvent!=-1){eh.Remove(this.__object,this.__objectMouseOverEvent)}if(this.__objectMouseOutEvent!=-1){eh.Remove(this.__object,this.__objectMouseOutEvent)}if(this.__objectClickEvent!=-1){eh.Remove(this.__object,this.__objectClickEvent)}this.__object=null}};Tooltip.prototype.__ttAreaMouseOver=function(A){this.__hide()};function IModuleTemplate(){this.__modHost=null;this.__parent=null;this.__isEnabled=true}IModuleTemplate.prototype.Init=function(B,A){this.__modHost=B;this.__modHost.Template=this;this.__parent=A};IModuleTemplate.prototype.Render=function(){};IModuleTemplate.prototype.ReRender=function(){};IModuleTemplate.prototype.SetTitle=function(B,A){};IModuleTemplate.prototype.SetVisible=function(A){};IModuleTemplate.prototype.Expand=function(){};IModuleTemplate.prototype.Collapse=function(){};IModuleTemplate.prototype.RenderEdit=function(A){};IModuleTemplate.prototype.Remove=function(A){};IModuleTemplate.prototype.Disable=function(){this.__isEnabled=false};IModuleTemplate.prototype.Enable=function(){this.__isEnabled=true};IModuleTemplate.prototype.CreateElement=function(B,A){return Qport.GUI().CreateElement(B,A)};IModuleTemplate.prototype.GetAbsoluteX=function(){};IModuleTemplate.prototype.GetAbsoluteY=function(){};IModuleTemplate.prototype.GetWidth=function(){};IModuleTemplate.prototype.GetHeight=function(){};IModuleTemplate.prototype.Dispose=function(){Utilities.DisposeObject(this)};IModuleTemplate.prototype.GetDragObject=function(){};IModuleTemplate.prototype.GetDragHandle=function(){};IModuleTemplate.prototype.RenderDropArea=function(A){};IModuleTemplate.prototype.MoveInDom=function(A){};var previousSelectedTabPage=null;var tabTemplateStack=new Qollection();function ITabTemplate(){this.__parent=null;this.__insertIndex=null;this.onclick=null;this.onmouseover=null;this.onmouseout=null}ITabTemplate.prototype.Init=function(B,A){this.__parent=B;this.__insertIndex=A;tabTemplateStack.Add(this)};ITabTemplate.prototype.Render=function(){};ITabTemplate.prototype.SetTitle=function(){};ITabTemplate.prototype.SetTooltip=function(){};ITabTemplate.prototype.Select=function(A){};ITabTemplate.prototype.Deselect=function(A){};ITabTemplate.prototype.Remove=function(){};ITabTemplate.prototype.CreateElement=function(B,A){return Qport.GUI().CreateElement(B,A)};ITabTemplate.prototype.GetAbsoluteX=function(){};ITabTemplate.prototype.GetAbsoluteXY=function(){};ITabTemplate.prototype.GetWidth=function(){};ITabTemplate.prototype.GetHeight=function(){};ITabTemplate.prototype.Dispose=function(){Utilities.DisposeObject(this)};ITabTemplate.prototype.IsInTab=function(A){};function IPopupTemplate(){this.__popup=null}IPopupTemplate.prototype.Init=function(C,B,D,A,E){this.__popup=C};IPopupTemplate.prototype.SetVisible=function(A,B){};IPopupTemplate.prototype.Resize=function(A,B){};IPopupTemplate.prototype.Move=function(A,B){};IPopupTemplate.prototype.Unload=function(A){};IPopupTemplate.prototype.Dispose=function(){};IPopupTemplate.prototype.SetTitle=function(A){};IPopupTemplate.prototype.CreateElement=function(A,B){return Qport.GUI().CreateElement(A,B)};IPopupTemplate.prototype.Focus=function(){};IPopupTemplate.prototype.Blur=function(){};IPopupTemplate.prototype.RenderModal=function(){};IPopupTemplate.prototype.IsPartOfPopup=function(A){};var moduleBeingDragged=false;function DragAndDropModule(){this.__modHost=null;this.__dragAndDrop=null;this.__dragObject=null;this.__dragHandle=null;this.__dropArea=null;this.__dropAreaIndex=-1;this.__isNewModule=false;this.__currentColumn=-1;this.__currentRow=-1;this.__previousColumn=-1;this.__previousRow=-1;this.__currentPage=null;this.__switchingPage=false;this.__pageMouseOverTimeoutId=-1;this.__modulesLoadedEventId=-1;this.__currentMouseOverPageId=-1;this.__headerTop=0;this.__startX=-1;this.__startY=-1;this.__columnOrientation=new Array();this.__columnModHosts=new Array();this.onstartdrag=null;this.onenddrag=null;DragAndDropModule.prototype.Init=function(F,B,E){if(F.IsMandatory){Qport.Alert("Foei! Je mag geen mandatory object slepen van de oebiedoebie!");return }this.__modHost=F;this.__isNewModule=(F.Id==-1);if(this.__isNewModule){this.__dragObject=Qport.GUI().CreateElement("div");if(typeof (E)=="function"){E(this.__dragObject)}else{this.__dragObject.innerHTML=this.__modHost.Title}this.__dragObject.className="newModuleDragObject";this.__resetDragObject();this.__dragHandle=B}else{this.__dragObject=F.Template.GetDragObject();this.__dragHandle=F.Template.GetDragHandle()}if(!Qport.GUI().ModuleDropArea){Qport.GUI().ModuleDropArea=Qport.GUI().CreateElement("div",document.body);Qport.GUI().ModuleDropArea.className="moduleDropArea";Qport.GUI().ModuleDropArea.style.display="none";Browser.SetOpacity(Qport.GUI().ModuleDropArea,80)}this.__dropArea=Qport.GUI().ModuleDropArea;var D=new Delegate(this,this.__startModuleDragEventHandler);var A=new Delegate(this,this.__doModuleDragEventHandler);var C=new Delegate(this,this.__endModuleDragEventHandler);this.__dragAndDrop=new DragAndDrop();this.__dragAndDrop.RegisterAsDND(this.__dragObject,this.__dragHandle,D,A,C,false,true,false)};DragAndDropModule.prototype.__setDropAreaText=function(A){Qport.GUI().ModuleDropArea.innerHTML="<b>"+A+"</b><br/><br/>"+L()("dropAreaDescription")};DragAndDropModule.prototype.__startModuleDragEventHandler=function(B){if(Qport.IsUpdatingModule){return }moduleBeingDragged=true;this.__modHost.IsBeingDragged=true;Qport.GUI().CheckIfUseMods();if(typeof (this.onstartdrag)=="function"){this.onstartdrag()}this.__currentColumn=-1;this.__currentRow=-1;this.__previousColumn=-1;this.__previousRow=-1;this.__currentPage=Qport.CurrentPage;this.__currentMouseOverPageId=-1;this.__loadColumnOrientation();this.__loadColumnModHosts();this.__setPopupsVisibility(false);if(this.__isNewModule){this.__resetDragObject();this.__dragObject.style.display="block";this.__dragAndDrop.hasFixedOffset=true;this.__dragAndDrop.SetDefaultOffset();Qport.ScriptManager.Add(this.__modHost.ClassName,this.__modHost.ScriptUri,function(){});if(this.__modHost.IsEditable){Qport.ScriptManager.Add(MHJSToEdit(this.__modHost.ClassName),MHJSUriToEdit(this.__modHost.ScriptUri),function(){})}}else{this.__dragAndDrop.xOffset=B.x-Browser.GetAbsoluteLeft(this.__dragHandle)+Browser.GetScrollleft();this.__dragAndDrop.yOffset=B.y-Browser.GetAbsoluteTop(this.__dragHandle)+Browser.GetScrolltop();this.__dragObject.style.width=this.__dragObject.offsetWidth+"px";this.__dragObject.style.position="absolute";document.body.appendChild(this.__dragObject)}this.__dragObject.style.zIndex=Qport.ZIndex.DragModule;Browser.SetOpacity(this.__dragObject,70);B.x+=Browser.GetScrollleft();B.x-=this.__dragAndDrop.xOffset;B.y+=Browser.GetScrolltop();B.y-=this.__dragAndDrop.yOffset;this.__dragObject.style.left=B.x+"px";this.__dragObject.style.top=B.y+"px";this.__startX=parseInt(this.__dragObject.style.left);this.__startY=parseInt(this.__dragObject.style.top);this.__headerTop=Browser.GetAbsoluteTop(Qport.GUI().Header);this.__checkPosition(B);this.__updateScrollPosition();if(this.__isNewModule){var A=new LogArgs("gui",Q_ACTION,5);A.Add("ModuleId",this.__modHost.ModuleId);Qport.Log(this,A)}else{var A=new LogArgs("gui",Q_ACTION,6);A.Add("UseMod",this.__modHost.Id);Qport.Log(this,A)}};DragAndDropModule.prototype.__doModuleDragEventHandler=function(A){this.__checkPosition(A)};DragAndDropModule.prototype.__endModuleDragEventHandler=function(C){moduleBeingDragged=false;this.__modHost.IsBeingDragged=false;if(typeof (this.onenddrag)=="function"){this.onenddrag()}Browser.SetOpacity(this.__dragObject,100);this.__setPopupsVisibility(true);if(this.__currentColumn==-1||this.__currentRow==-1){if(this.__isNewModule){this.__hideDropArea();Qport.GUI().Fancy.FadeObject(this.__dragObject,"out",new Delegate(this,this.__resetDragObject))}else{if(this.__currentPage.Id==this.__modHost.PageId){this.__dropModule(this.__modHost.Column,Qport.GetModHostIndex(this.__modHost,true),this.__startX,this.__startY)}else{this.__dragObject.style.position="";if(!this.__isNewModule){this.__modHost.SetVisible(false)}}}}else{if(this.__isNewModule){this.__dragObject.className="newModuleDragObjectDropped";Qport.GUI().ColumnArea[this.__currentColumn].insertBefore(this.__dragObject,this.__dropArea);this.__hideDropArea()}else{var B=this.__dropAreaIndex;if(this.__currentColumn==this.__modHost.Column&&this.__currentRow>this.__modHost.Row){B--}this.__dropModule(this.__currentColumn,B,Browser.GetAbsoluteLeft(this.__dropArea),Browser.GetAbsoluteTop(this.__dropArea),50)}if(this.__currentPage.Id!=this.__modHost.PageId||this.__currentColumn!=this.__modHost.Column||this.__currentRow!=this.__modHost.Row){var A={Column:this.__modHost.Column,Row:this.__modHost.Row,PageId:this.__modHost.PageId};this.__modHost.Column=this.__currentColumn;this.__modHost.Row=this.__currentRow;this.__modHost.PageId=this.__currentPage.Id;Qport.AddOrMoveModHost(this.__modHost,A,new Delegate(this,this.__updateSuccess),new Delegate(this,this.__updateFailure))}}};DragAndDropModule.prototype.__updateSuccess=function(B,A){if(this.__isNewModule){this.__resetDragObject()}if(typeof (this.onsuccess)=="function"){this.onsuccess(null,B,A)}};DragAndDropModule.prototype.__updateFailure=function(){if(this.__isNewModule){this.__resetDragObject()}else{this.__dropModuleInsertInPage(this.__modHost.Column,Qport.GetModHostIndex(this.__modHost,true))}if(typeof (this.onfailure)=="function"){this.onfailure()}};DragAndDropModule.prototype.__dropModule=function(B,A,D,C,E){Qport.GUI().Fancy.MoveObject(this.__dragObject,parseInt(this.__dragObject.style.left),parseInt(this.__dragObject.style.top),D,C,new Delegate(this,this.__dropModuleInsertInPage,B,A),E)};DragAndDropModule.prototype.__dropModuleInsertInPage=function(B,A){this.__hideDropArea();this.__dragObject.style.position="";this.__dragObject.style.top="";this.__dragObject.style.left="";this.__dragObject.style.width="";this.__dragObject.style.zIndex="";this.__insertObject(this.__dragObject,B,A)};DragAndDropModule.prototype.__checkPosition=function(J){if(this.__switchingPage){return }this.__previousColumn=this.__currentColumn;this.__currentColumn=-1;this.__previousRow=this.__currentRow;this.__currentRow=-1;this.__currentMouseOverPageId=-1;if(this.__currentPage.Id!=Qport.CurrentPage.Id){this.__currentPage.Template.Deselect();this.__currentPage=Qport.CurrentPage}J.x+=this.__dragAndDrop.xOffset;if(J.y<(this.__headerTop+Qport.GUI().Header.offsetHeight)){var D=(J.y+this.__dragAndDrop.yOffset);for(var H=0,G=Qport.Pages.length;H<G;H++){var B=Qport.Pages[H];var C=B.Template.GetAbsoluteX();if(D>=B.Template.GetAbsoluteY()&&J.x>=C&&J.x<(C+B.Template.GetWidth())){if(B.Id!=Qport.CurrentPage.Id){this.__currentMouseOverPageId=B.Id;B.Template.Select();if(this.__pageMouseOverTimeoutId>-1){qTimeout.removeTimeout(this.__pageMouseOverTimeoutId)}this.__pageMouseOverTimeoutId=qTimeout.setTimeout(550,new Delegate(this,this.__pageDragOverTimeout,B))}this.__hideDropArea();return }}return }for(var H=0;H<this.__columnOrientation.length;H++){if(J.x>=this.__columnOrientation[H].startX&&J.x<=this.__columnOrientation[H].endX){this.__currentColumn=H;break}}if(this.__currentColumn==-1){this.__hideDropArea();return }var A=this.__columnModHosts[this.__currentColumn];if(A.length==0){this.__currentRow=0;this.__showDropArea(this.__currentColumn,0);return }if((!A[0].IsMandatory||(A[0].IsMandatory&&A[0].MandatoryPos==2))&&J.y<(A[0].Template.GetAbsoluteY()+(A[0].Template.GetHeight()/2))){this.__currentRow=0;this.__showDropArea(this.__currentColumn,0);return }var P=A.length-1;if((!A[P].IsMandatory||(A[P].IsMandatory&&A[P].MandatoryPos==1))&&J.y>=(A[P].Template.GetAbsoluteY()+(A[P].Template.GetHeight()/2))){this.__currentRow=(A[P].Row+1);this.__showDropArea(this.__currentColumn,P+1);return }if(A.length>1){for(var H=0,I=(A.length-1);H<I;H++){var F=A[H];var E=A[H+1];if(F.IsMandatory){if(F.MandatoryPos==1&&E.MandatoryPos==2){this.__currentRow=0;this.__showDropArea(this.__currentColumn,(H+1));return }else{continue}}else{var M=F.Template.GetHeight();var O=F.Template.GetAbsoluteY();var K=E.Template.GetHeight();var N=E.Template.GetAbsoluteY();if(J.y>=(O+(M/2))&&J.y<(N+(K/2))){this.__currentRow=(F.Row+1);this.__showDropArea(this.__currentColumn,(H+1));return }}}}this.__hideDropArea()};DragAndDropModule.prototype.__pageDragOverTimeout=function(A){this.__pageMouseOverTimeoutId=-1;if(moduleBeingDragged&&!this.__switchingPage&&A.Id!=Qport.CurrentPage.Id&&this.__currentMouseOverPageId==A.Id){this.__currentPage=A;this.__switchingPage=true;this.__modulesLoadedEventId=eh.Add(Qport,"modulesloaded",new Delegate(this,this.__pageSwitchedCallback));Qport.CurrentPage.Template.Deselect();Qport.SwitchPage(this.__currentPage.Id)}else{A.Template.Deselect()}};DragAndDropModule.prototype.__pageSwitchedCallback=function(){eh.Remove(Qport,this.__modulesLoadedEventId);this.__modulesLoadedEventId=-1;if(!this.__isNewModule){this.__modHost.SetVisible(true)}Qport.GUI().CheckIfUseMods();this.__loadColumnOrientation();this.__loadColumnModHosts();Qport.CurrentPage.Template.Select();this.__switchingPage=false};DragAndDropModule.prototype.__resetDragObject=function(){this.__dragObject.style.display="none";document.body.appendChild(this.__dragObject);if(this.__isNewModule){this.__dragObject.className="newModuleDragObject"}};DragAndDropModule.prototype.__hideDropArea=function(){this.__dropArea.style.display="none";document.body.appendChild(this.__dropArea)};DragAndDropModule.prototype.__showDropArea=function(B,A){if(this.__previousColumn==this.__currentColumn&&this.__previousRow==this.__currentRow){return }if((this.__previousColumn==this.__currentColumn&&this.__previousRow<this.__currentRow)||(this.__previousColumn==-1&&this.__modHost.Column==this.__currentColumn&&this.__previousRow==-1&&this.__modHost.Row<this.__currentRow)){A++}this.__insertObject(this.__dropArea,B,A);this.__dropAreaIndex=A;if(this.__isNewModule){this.__dropArea.style.height=""}else{this.__modHost.Template.RenderDropArea(this.__dropArea);if(!this.__modHost.IsExpanded){this.__dropArea.style.height=""}}this.__setDropAreaText(this.__modHost.Title);this.__dropArea.style.display="block"};DragAndDropModule.prototype.__insertObject=function(D,C,B){var A=Qport.GUI().ColumnArea[C].childNodes[B];if(A){Qport.GUI().ColumnArea[C].insertBefore(D,A)}else{Qport.GUI().ColumnArea[C].appendChild(D)}};DragAndDropModule.prototype.__loadColumnOrientation=function(){this.__columnOrientation=new Array();for(var A=0;A<Qport.GUI().ColumnCount;A++){var B=Qport.GUI().ColumnArea[A];this.__columnOrientation[A]={startX:Browser.GetAbsoluteLeft(B),endX:(Browser.GetAbsoluteLeft(B)+B.offsetWidth)}}};DragAndDropModule.prototype.__loadColumnModHosts=function(){this.__columnModHosts=new Array();for(var A=0;A<Qport.GUI().ColumnCount;A++){this.__columnModHosts[A]=Qport.GetModHostsByColumn(A)}if(this.__modHost.Id>0){for(var A=0;A<this.__columnModHosts[this.__modHost.Column].length;A++){if(this.__columnModHosts[this.__modHost.Column][A].Id==this.__modHost.Id){this.__columnModHosts[this.__modHost.Column].splice(A,1);break}}}};DragAndDropModule.prototype.__setPopupsVisibility=function(C){var B=popupStack.List.addmodule;if(B!=null){B.SetVisible(C)}var A=popupStack.List.addRss;if(A!=null){A.SetVisible(C)}};DragAndDropModule.prototype.__updateScrollPosition=function(F){if(draggingActive){var I,H,J,D,G,B,E;I=parseInt(this.__dragObject.style.left)-Browser.GetScrollleft();H=parseInt(this.__dragObject.style.top)-Browser.GetScrolltop();J=this.__dragObject.offsetWidth;D=this.__dragObject.offsetHeight;B=Browser.GetWindowHeight();var K=100,C=100,A=8;if(H>(B-C)&&((H+Browser.GetScrolltop())<Qport.GUI().GetHeight())){E=A}else{if(H<K&&Browser.GetScrolltop()>0){E=A*-1}else{E=0}}if(E!=0){Browser.SetScrolltop(Browser.GetScrolltop()+E)}qTimeout.setTimeout(30,new Delegate(this,this.__updateScrollPosition))}}}QportEnvironment.prototype.AddOrMoveModHost=function(D,C,B,A){Qport.IsUpdatingModule=true;Qport.UpdateModHost(D,new Delegate(Qport,Qport.AddOrMoveModHostCallback,D,C,B,A))};QportEnvironment.prototype.AddOrMoveModHostCallback=function(J,B,M,C,A){if(Qport.Halt||!Qport.IsLoaded){return }Qport.IsUpdatingModule=false;if(A){var H=null;var E=-1;var O=-1;if(J.Id==-1){H=new LogArgs("gui",Q_ACTION,1);H.Add("ModuleId",J.ModuleId)}else{E=B.Column;O=B.Row;H=new LogArgs("gui",Q_ACTION,3);H.Add("UseMod",J.Id);H.Add("OldCol",E);H.Add("OldRow",O)}H.Add("ToCol",J.Column);H.Add("ToRow",J.Row);Qport.Log(J,H);var K=null;if(J.Id==-1){K=Qport.AddNewModule(A)}else{if(J.Id>0&&J.PageId!=B.PageId){Qport.CurrentPage.ModHosts.push(J);Qport.SortModHosts();Qport.GUI().CheckIfUseMods()}}if(typeof (M)=="function"){M((J.Id==-1?K:J),(J.PageId==Qport.CurrentPage.Id))}var G=Qport.GetModHostsByColumn(J.Column);if(J.Id==-1||E!=J.Column||B.PageId!=J.PageId){for(var D=0;D<G.length;D++){if(G[D].Row>=J.Row&&G[D].Id!=J.Id){if(G[D].IsNew){G[D].IsNew=false}else{G[D].Row++}}}if(J.Id==-1){if(K){K.InitModHost();Qport.LoadingDone()}}else{var F=null;if(J.PageId!=B.PageId){for(var D=0;D<Qport.Pages.length;D++){if(Qport.Pages[D].Id==B.PageId){F=Qport.Pages[D];break}}for(var D=0;D<F.ModHosts.length;D++){if(F.ModHosts[D].Id==J.Id){F.ModHosts.splice(D,1);break}}}else{F=Qport.CurrentPage}for(var D=0;D<F.ModHosts.length;D++){if(F.ModHosts[D].Column==B.Column){if(F.ModHosts[D].Row>O){F.ModHosts[D].Row--}}}Qport.GUI().ReRender()}}else{for(var D=0;D<G.length;D++){if(J.Row>O){if(G[D].Row>O&&G[D].Row<J.Row&&G[D].Id!=J.Id){G[D].Row--}}else{if(J.Row<O){if(G[D].Row>=J.Row&&G[D].Row<O&&G[D].Id!=J.Id){G[D].Row++}}}}if(J.Row>O){J.Row--}Qport.GUI().ReRender()}}else{var I=null;var N="";if(J.Id==-1){I=new LogArgs("gui",Q_ERROR,4);I.Add("ModuleId",J.ModuleId);N="addFailed"}else{I=new LogArgs("gui",Q_ERROR,2);I.Add("UseMod",J.Id);I.Add("ToCol",J.Column);I.Add("ToRow",J.Row);N="updateFailed";J.Row=B.Row;J.Column=B.Column;J.PageId=B.PageId}I.Add("FromCol",J.Column);I.Add("FromRow",J.Row);Qport.Log(J,I);Qport.Alert(L()(N).replace("{0}",L()("module").toLowerCase()));if(typeof (C)=="function"){C()}}};

