function ThePortRegisterNS(d){var b=false;var a=d.split(".");var e=window;for(var c=0;c<a.length;c++){if(typeof e[a[c]]=="undefined"){e[a[c]]=new Object();b=true}e=e[a[c]]}return b}if(ThePortRegisterNS("ThePort")){ThePort={Initialize:function(){if(ThePortRegisterNS("ThePort.Initialized")){ThePort.Debug.Log("Framework Initializing.");ThePort.Debug.Log("Initializing any triggers.");ThePort.XSL.CallAllModuleFunction("StartVisibilityInterval");var b=ThePort.Tabs.Array;if((b!=null)&&(b.length>0)){ThePort.Debug.Log("Initializing "+b.length+" tab sets.");for(var a=0;a<b.length;a++){b[a].Initialize()}}}}}}if(ThePortRegisterNS("ThePort.Module")){ThePort.Module.Array=new Array()}if(ThePortRegisterNS("ThePort.Common")){ThePort.Common={CONST_EMPTY_STRING:"",CONST_UNDEFINED:"undefined",CONST_TYPE_FUNCTION:"function",CONST_ERROR_MESSAGE:"Error",CONST_OPERATION_MORE:"More",CONST_OPERATION_REFRESH:"Refresh",CONST_AJAXDEBUG:"false",CONST_OBJECT_TYPE:"object",CONST_NUMBER_TYPE:"number",CONST_STRING_TYPE:"string",CONST_FORM_POST:"POST",CONST_FORM_GET:"GET",CONST_FORM_DELETE:"DELETE",CONST_FORM_PUT:"PUT",CONST_FORMAT_XML:"xml",CONST_FORMAT_JSON:"json",CONST_CONTENTTYPE_JSON1:"application/javascript",CONST_CONTENTTYPE_JSON2:"application/json",CONST_CONTENTTYPE_JSON3:"text/json",CONST_CONTENTTYPE_XML:"text/xml",CONST_CONTENTTYPE:"Content-type",CONST_CONTENTTYPE_TXTJS:"text/javascript",CONST_FORM_POST_URLENC:"application/x-www-form-urlencoded",CONST_CONTENTLENGTH:"Content-length",CONST_HEADER_CONNECTION:"Connection",CONST_HEADER_CONN_CLOSE:"close",CONST_ACTIVEX1_AJAX_OBJ:"Msxml2.XMLHTTP",CONST_ACTIVEX2_AJAX_OBJ:"Microsoft.XMLHTTP",CONST_ACTIVEX_XML_OBJ:"Microsoft.XMLDOM",QS_NAME:"sName",QS_MODULEID:"sModuleID",QS_CACHE_RESET:"SYS_CACHE_RESET",QS_OBJECTID:"sObjectID",QS_DATA:"sData",QS_DATAFORMAT:"sFormat",QS_CALLBACKFN:"CallBack",QS_HASH:"sHash",QS_COMMENT:"sComment",QS_CONTEXTID:"sContextID",QS_RESULTSTART:"iResultStart",QS_NUMRESULTS:"iNumResults",QS_OPERATION:"SYS_Operation",QS_POPUP:"SYS_PopUp",QS_IFRAMEURL:"sIFrameURL",CONST_COMMA:",",CONST_EQUALS:"=",CONST_QUESTION_MARK:"?",CONST_AMPERSAND:"&",CONST_SINGLE_QUOTE:"'",CONST_DBL_QUOTE:'"',CONST_GREATER_THAN:">",CONST_LESS_THAN:"<",CONST_ENC_AMPERSAND:"&amp;",CONST_ENC_SINGLE_QUOTE:"&apos;",CONST_ENC_DBL_QUOTE:"&quot;",CONST_ENC_GREATER_THAN:"&gt;",CONST_ENC_LESS_THAN:"&lt;",CONST_WIDGET_TYPE_STD:1,CONST_WIDGET_TYPE_IFRAME:2,CONST_WIDGET_ID:"WidgetID",CONST_WIDGET_TITLE_TEXT:"WidgetTitle",CONST_WIDGET_TYPE:"WidgetType",CONST_WIDGET_COLUMN:"WidgetColumn",CONST_WIDGET_MINMAX:"WidgetMinMax",CONST_WIDGET_WEIGHT:"WidgetWeight",CONST_WIDGET_LOCKED:"WidgetLocked",CONST_WIDGET_TITLEHIDDEN:"WidgetTitleHidden",CONST_WIDGET_EXPORTABLE:"WidgetExportable",CONST_WIDGET_REMOVABLE:"WidgetRemovable",CONST_WIDGET_TITLE_CLASS:"WidgetTitleClassName",CONST_HTTP_READYSTATE_UNINITIALIZED:0,CONST_HTTP_READYSTATE_LOADING:1,CONST_HTTP_READYSTATE_LOADED:2,CONST_HTTP_READYSTATE_INTERACTIVE:3,CONST_HTTP_READYSTATE_COMPLETED:4,CONST_STYLE_DISPLAY_ON:"",CONST_STYLE_DISPLAY_OFF:"none",CONST_AJAX_URL:"/apis/Rest/RestService.ashx"}}if(ThePortRegisterNS("ThePort.Utils")){ThePort.Utils={Ajax:function(d,a,n,h){try{var c=location.search.substring(1).split(ThePort.Common.CONST_AMPERSAND);var b=new Array();for(var g=0;g<c.length;g++){t=c[g].split(ThePort.Common.CONST_EQUALS);b[unescape(t[0])]=unescape(t[1])}for(key in b){if((typeof b[key]!=ThePort.Common.CONST_TYPE_FUNCTION)&&(key!=ThePort.Common.CONST_EMPTY_STRING)&&(b[key]!=ThePort.Common.CONST_UNDEFINED)){a=ThePort.Utils.AddQueryStringParam(a,key,b[key])}}}catch(j){}var f=null;if((d==null)||(d==ThePort.Common.CONST_EMPTY_STRING)){d=ThePort.Common.CONST_FORM_GET}if(typeof XMLHttpRequest!=ThePort.Common.CONST_UNDEFINED){f=new XMLHttpRequest()}else{if(typeof ActiveXObject!=ThePort.Common.CONST_UNDEFINED){try{f=new ActiveXObject(ThePort.Common.CONST_ACTIVEX1_AJAX_OBJ)}catch(j){try{f=new ActiveXObject(ThePort.Common.CONST_ACTIVEX2_AJAX_OBJ)}catch(j){}}}}if(f!=null){f.open(d,a,true);var m=function(){if(f.readyState==ThePort.Common.CONST_HTTP_READYSTATE_COMPLETED){n(f)}};f.onreadystatechange=m;if(h!=null){f.setRequestHeader(ThePort.Common.CONST_CONTENTTYPE,ThePort.Common.CONST_FORM_POST_URLENC);f.setRequestHeader(ThePort.Common.CONST_CONTENTLENGTH,h.length);f.setRequestHeader(ThePort.Common.CONST_HEADER_CONNECTION,ThePort.Common.CONST_HEADER_CONN_CLOSE)}}f.send(h)},AddQueryStringParam:function(c,a,d){if(ThePort.Utils.GetQueryVariable(c,a)==ThePort.Common.CONST_EMPTY_STRING){var b=c.indexOf(ThePort.Common.CONST_QUESTION_MARK,0);c+=(b<0?ThePort.Common.CONST_QUESTION_MARK:ThePort.Common.CONST_AMPERSAND)+a+ThePort.Common.CONST_EQUALS+d}return c},GetQueryVariable:function(f,b){try{var a=f.indexOf(ThePort.Common.CONST_QUESTION_MARK);if(a>0){var d=f.substring(a+1);var h=d.split(ThePort.Common.CONST_AMPERSAND);for(var c=0;c<h.length;c++){var j=h[c].split(ThePort.Common.CONST_EQUALS);if(j[0].toLowerCase()==b.toLowerCase()){return j[1]}}}}catch(g){}return ThePort.Common.CONST_EMPTY_STRING},Bind:function(a,b){return function(c){return a[b](c)}},Binder:function(b,c){var a=ThePort.XSL.Shift2Args.apply(null,arguments);return function(d){if(typeof d!=ThePort.Common.CONST_UNDEFINED){[].unshift.call(a,d)}return b[c].apply(b,a)}},BinderNP:function(b,c){var a=ThePort.XSL.Shift2Args.apply(null,arguments);return function(){return b[c].apply(b,a)}},AjaxBind:function(b,c){var a=ThePort.XSL.Shift2Args.apply(null,arguments);return function(d){if(ThePort.Debug.window){ThePort.Utils.LogServerException(d)}if(typeof d!=ThePort.Common.CONST_UNDEFINED){[].unshift.call(a,d)}return b[c].apply(b,a)}},findPosX:function(a){var b=0;if(a.offsetParent){while(a.offsetParent){b+=a.offsetLeft;a=a.offsetParent}}else{if(a.x){b+=a.x}}return b},findPosY:function(b){var a=0;if(b.offsetParent){while(b.offsetParent){a+=b.offsetTop;b=b.offsetParent}}else{if(b.y){a+=b.y}}return a},LogServerException:function(b){try{var a=ThePort.Utils.GetReplyObject(b);if(typeof a==ThePort.Common.CONST_UNDEFINED){return}if(a.ReturnCode<0){ThePort.Debug.Log("          ****************************************************\n          ** Server ERROR or Exception returned inside Ajax callback **\n          ****************************************************\nException Message: '"+a.Message+"'\nDetails:\n"+a.Data)}}catch(c){}},RegisterModule:function(d){var e=false;var a=d.split(".");var f=window;for(var c=0;c<a.length;c++){if(typeof f[a[c]]!=ThePort.Common.CONST_UNDEFINED){if(c==(a.length-1)){delete f[a[c]];e=true;break}f=f[a[c]]}}if(e){if(typeof ThePort.Module.Array==ThePort.Common.CONST_UNDEFINED){return}for(var b=0;b<ThePort.Module.Array.length;b++){if(ThePort.Module.Array[b].m_sModuleName==d){ThePort.Module.Array[b].CleanUp();delete ThePort.Module.Array[b];ThePort.Module.Array.splice(b,1);break}}}ThePortRegisterNS(d)},GetTagValue:function(a,b){try{if(a){var c=a.getElementsByTagName(b);return ThePort.Utils.GetValueFromNode(c[0])}}catch(d){}return null},GetVariablePair:function(b,c){var a=ThePort.Common.CONST_EMPTY_STRING;a+=b;a+=ThePort.Common.CONST_EQUALS;a+=encodeURIComponent(c);return a},AddDictionaryPair:function(b,c){var a=ThePort.Common.CONST_AMPERSAND;a+=ThePort.Utils.GetVariablePair(b,c);return a},AddVariablePair:function(b,c){var a=ThePort.Common.CONST_AMPERSAND;a+=ThePort.Utils.GetVariablePair(b,c);return a},GetTagAttributeValue:function(a,b,d){if(a){var c=a.getElementsByTagName(tagName);return this.getAttrValueFromNode(c[0],d)}return null},GetValueFromNode:function(b){if(typeof b.text!=ThePort.Common.CONST_UNDEFINED){return b.text}else{if(typeof b.textContent!=ThePort.Common.CONST_UNDEFINED){return b.textContent}else{if(typeof b.innerText!=ThePort.Common.CONST_UNDEFINED){return b.innerText}else{switch(b.nodeType){case 3:case 4:return b.nodeValue;break;case 1:case 11:var c=new String();for(var a=0;a<b.childNodes.length;a++){c+=GetNodeValue(b.childNodes[a])}return c;default:return ThePort.Common.CONST_EMPTY_STRING}}}}},GetAttrValueFromNode:function(b,a){try{for(l=0;l<b.attributes.length;l++){if(b.attributes[l].nodeName==a){return(b.attributes[l].nodeValue)}}}catch(c){return null}return null},Parm:function(a){this.value=a},GetObj:function(a){if((a==null)||(a.length<=0)){return null}return document.getElementById(a)},GotoURL:function(a){if(a!=null&&a.length>0){window.location.href=a}},OpenWindow:function(a){if(a!=null&&a.length>0){var b=window.open(a)}},StopEvent:function(a){if(a.stopPropagation){a.stopPropagation()}else{a.cancelBubble=true}},Show:function(a){if(typeof a==ThePort.Common.CONST_OBJECT_TYPE){ThePort.Utils.ShowNode(a)}else{ThePort.Utils.ShowNode(ThePort.Utils.GetObj(a))}},ShowNode:function(a){if(a){a.style.display=ThePort.Common.CONST_STYLE_DISPLAY_ON}},Hide:function(a){if(typeof a==ThePort.Common.CONST_OBJECT_TYPE){ThePort.Utils.HideNode(a)}else{ThePort.Utils.HideNode(ThePort.Utils.GetObj(a))}},HideNode:function(a){if(a){a.style.display=ThePort.Common.CONST_STYLE_DISPLAY_OFF}},Toggle:function(a){if(typeof a==ThePort.Common.CONST_OBJECT_TYPE){ThePort.Utils.ToggleNode(a)}else{ThePort.Utils.ToggleNode(ThePort.Utils.GetObj(a))}},ToggleNode:function(a){if(a){if(ThePort.Utils.IsVisible(a)){ThePort.Utils.HideNode(a)}else{ThePort.Utils.ShowNode(a)}}},SetClassName:function(b,a){if(typeof b==ThePort.Common.CONST_OBJECT_TYPE){ThePort.Utils.SetNodeClassName(b,a)}else{ThePort.Utils.SetNodeClassName(ThePort.Utils.GetObj(b),a)}},SetNodeClassName:function(b,a){if(b){b.className=a}},GetClassName:function(a){if(typeof a==ThePort.Common.CONST_OBJECT_TYPE){return ThePort.Utils.GetNodeClassName(a)}else{return ThePort.Utils.GetNodeClassName(ThePort.Utils.GetObj(a))}},GetNodeClassName:function(a){if(a){return a.className}return ThePort.Common.CONST_EMPTY_STRING},SetInnerHTML:function(b,c){var a=ThePort.Utils.GetObj(b);if(a){a.innerHTML=c}},ScrollPageToNodeTop:function(a){var e=ThePort.Utils.GetObj(a);if(!e){ThePort.Debug.Log("Unable to scroll to top of Node with ID="+a);return}ThePort.Debug.Log("Scrolling to top of Node with ID="+a);var d=0;while(e.offsetParent){d+=e.offsetTop;e=e.offsetParent}var b=new ThePort.Utils.Parm(0);var c=new ThePort.Utils.Parm(0);ThePort.Utils.GetScrollPos(b,c);if(c.value>d){window.scrollTo(0,d)}},GetScrollPos:function(a,d){var c=0,b=0;if(typeof(window.pageYOffset)==ThePort.Common.CONST_NUMBER_TYPE){b=window.pageYOffset;c=window.pageXOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){b=document.body.scrollTop;c=document.body.scrollLeft}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){b=document.documentElement.scrollTop;c=document.documentElement.scrollLeft}}}a.value=c;d.value=b},AddScriptTag:function(b,f){var g=document.getElementById(b);g.innerHTML=f;var a=g.getElementsByTagName("script");var e=document.getElementsByTagName("head")[0];for(var c=0;c<a.length;c++){var d=document.createElement("script");d.type=ThePort.Common.CONST_CONTENTTYPE_TXTJS;e.appendChild(d);d.text=a[c].text}},AddHeadScriptTag:function(c){var b=document.getElementsByTagName("head")[0];var a=document.createElement("script");a.type=ThePort.Common.CONST_CONTENTTYPE_TXTJS;a.text=c;b.appendChild(a)},IsVisible:function(b){if(b==document){return true}if(!b){return false}if(!b.parentNode){return false}if(b.style){if(b.style.display=="none"){return false}if(b.style.visibility=="hidden"){return false}}if(window.getComputedStyle){var a=window.getComputedStyle(b,"");if(a.display=="none"){return false}if(a.visibility=="hidden"){return false}}var a=b.currentStyle;if(a){if(a.display=="none"){return false}if(a.visibility=="hidden"){return false}}return ThePort.Utils.IsVisible(b.parentNode)},Obj2Json:function(a){var f=[];var b=(Object.prototype.toString.apply(a)==="[object Array]");for(var d in a){var e=a[d];if(typeof e==ThePort.Common.CONST_OBJECT_TYPE){if(b){f.push(obj2json(e))}else{f[d]=obj2json(e)}}else{var g="";if(!b){g='"'+d+'":'}if(typeof e==ThePort.Common.CONST_NUMBER_TYPE){g+=e}else{if(e===false){g+="false"}else{if(e===true){g+="true"}else{g+='"'+e+'"'}}}f.push(g)}}var c=f.join(",");if(b){return"["+c+"]"}return"{"+c+"}"},GetReplyObject:function(oResponse){try{var sContentType=oResponse.getResponseHeader(ThePort.Common.CONST_CONTENTTYPE);if((sContentType.indexOf(ThePort.Common.CONST_CONTENTTYPE_JSON1)>=0)||(sContentType.indexOf(ThePort.Common.CONST_CONTENTTYPE_JSON2)>=0)||(sContentType.indexOf(ThePort.Common.CONST_CONTENTTYPE_JSON3)>=0)){eval(" var oReply = "+oResponse.responseText);return oReply}return new ThePort.ReplyObject(oResponse.responseXML)}catch(e){ThePort.Debug.Log("Error creating a ReplyObject from the Ajax return data.\nPayload-Data::"+oResponse.responseText)}},ReplaceQSVariable:function(b,c,d){var a=new RegExp("([?|&])"+c+"=.*?(&|$)","i");if(b.match(a)){return b.replace(a,"$1"+c+ThePort.Common.CONST_EQUALS+d+"$2")}else{return b+ThePort.Common.CONST_AMPERSAND+c+ThePort.Common.CONST_EQUALS+d}},GetQSVariable:function(d,f){try{f=f.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var a="[\\?&]"+f+"=([^&#]*)";var c=new RegExp(a);var b=c.exec(d);if(b==null){return ThePort.Common.CONST_EMPTY_STRING}else{return b[1]}}catch(g){return ThePort.Common.CONST_EMPTY_STRING}},KeyDownHandler:function(a,b){var c=a||window.event;if(ThePort.Event.GetEventKeyCode(c)==13){c.returnValue=false;ThePort.Utils.StopEvent(c);ThePort.Utils.GetObj(b).click();return false}return true},Decode64:function(d){var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var a=ThePort.Common.CONST_EMPTY_STRING;var n,j,g=ThePort.Common.CONST_EMPTY_STRING;var m,h,f,e=ThePort.Common.CONST_EMPTY_STRING;var c=0;do{m=b.indexOf(d.charAt(c++));h=b.indexOf(d.charAt(c++));f=b.indexOf(d.charAt(c++));e=b.indexOf(d.charAt(c++));n=(m<<2)|(h>>4);j=((h&15)<<4)|(f>>2);g=((f&3)<<6)|e;a=a+String.fromCharCode(n);if(f!=64){a=a+String.fromCharCode(j)}if(e!=64){a=a+String.fromCharCode(g)}}while(c<d.length);return unescape(a)},InitHandler:function(c){if(document.addEventListener){document.addEventListener("DOMContentLoaded",c,false);return}if(document.getElementById){var a=document.getElementById("_port_xsl_script_");if(a){a.onreadystatechange=function(){if(this.readyState=="complete"){c()}};a.onreadystatechange();a=null}return}if(/WebKit/i.test(navigator.userAgent)){var b=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(b);c()}},10);return}window.onload=c},PopWindow:function(a,o,d){try{if(window.ThePortPopupWindow){window.ThePortPopupWindow.close();window.ThePortPopupWindow=null}}catch(m){}try{var f=d;var p=o;var n=(p/2);var b=(f/2);var c=(screen.width/2);var j=(screen.height/2);var g=(c-n);var q=(j-b);ThePortPopupWindow=window.open(a,"popwindow","location=1,toolbar=1,scrollbars=1,status=1,menubar=1,resizable=1,width="+p+",height="+f)}catch(m){}},PopWindow2:function(b,a,c){win=window.open(b,"PopWindow","scrollbars=1,status=1,resizable=1,menubar=1,width="+a+"height="+c);win.focus()},GetObjByClassName:function(c,b){var a=arguments[2]||new Array();var e=new RegExp("\\b"+c+"\\b","g");if(e.test(b.className)){a.push(b)}for(var d=0;d<b.childNodes.length;d++){GetObjByClassName(c,b.childNodes[d],a);return a}},AddScriptTags:function(c){var a=c;while(script=a.match(/(<script(.*?)>\s*(<!--)?)/i)){a=a.substr(a.indexOf(RegExp.$1)+RegExp.$1.length);if(!(endscript=a.match(/((-->)?\s*<\/script>)/))){break}block=a.substr(0,a.indexOf(RegExp.$1));a=a.substring(block.length+RegExp.$1.length);var b=document.createElement("script");b.text=block;document.getElementsByTagName("head").item(0).appendChild(b)}},GenerateRandomID:function(a){var b="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";sOutput=a;for(i=0;i<=8;i++){sOutput+=b.charAt(Math.random()*b.length)}return sOutput},UpdateNode:function(f,c,e){var b=c;var a;if(!f){return}if(e==true){f.innerHTML+=c}else{f.innerHTML=c}while(a=b.match(/(<script(.*?)>\s*(<!--)?)/i)){b=b.substr(b.indexOf(RegExp.$1)+RegExp.$1.length);if(!(endscript=b.match(/((-->)?\s*<\/script>)/))){break}block=b.substr(0,b.indexOf(RegExp.$1));b=b.substring(block.length+RegExp.$1.length);if(block.length>0){var d=document.createElement("script");d.text=block;document.getElementsByTagName("head").item(0).appendChild(d)}}ThePort.XSL.CallAllModuleFunction("StartVisibilityInterval")},LoadHTMLIntoNode:function(oNode,sContent){try{ThePort.Debug.LogModuleMsg("Replacing innerHTML & Executing ajax payload scripts.");if(ThePort.Utils.StringToBoolean(ThePort.Common.CONST_AJAXDEBUG,false)){oNode.innerHTML=sContent;var oScripts=oNode.getElementsByTagName("script");for(var i=0;i<oScripts.length;i++){if(oScripts[i].text.length==0){var oScript=document.createElement("script");oScript.src=oScripts[i].src;document.getElementsByTagName("head").item(0).appendChild(oScript)}else{eval(oScripts[i].text)}}}else{ThePort.Utils.UpdateNode(oNode,sContent,false)}}catch(e){ThePort.Debug.Log("Exception occured while processing ajax scripts.");ThePort.Debug.LogExx(e)}},AddHTMLIntoNode:function(oNode,sContent){try{ThePort.Debug.LogModuleMsg("Adding to innerHTML & Executing ajax payload scripts.");if(ThePort.Utils.StringToBoolean(ThePort.Common.CONST_AJAXDEBUG,false)){var sValue=oNode.innerHTML;oNode.innerHTML=sValue+sContent;var oScripts=oNode.getElementsByTagName("script");for(var i=0;i<oScripts.length;i++){if(oScripts[i].text.length==0){var oScript=document.createElement("script");oScript.src=oScripts[i].src;document.getElementsByTagName("head").item(0).appendChild(oScript)}else{eval(oScripts[i].text)}}}else{ThePort.Utils.UpdateNode(oNode,sContent,true)}}catch(e){ThePort.Debug.Log("Exception occured while processing ajax scripts.");ThePort.Debug.LogExx(e)}},LoadJavaScriptOrCSSFile:function(c,b){var a=null;if(c=="js"){a=document.createElement("script");a.setAttribute("type",ThePort.Common.CONST_CONTENTTYPE_TXTJS);a.setAttribute("src",b)}else{if(c=="css"){a=document.createElement("link");a.setAttribute("rel","stylesheet");a.setAttribute("type","text/css");a.setAttribute("href",filename)}}if(a!=null){document.getElementsByTagName("head")[0].appendChild(a)}},AddCSSWithCallback:function(d,a){var c=document.getElementsByTagName("head")[0];oNode=document.createElement("link");oNode.setAttribute("rel","stylesheet");oNode.setAttribute("type","text/css");oNode.setAttribute("href",d);c.appendChild(oNode);oNode.onload=a;var b=function(){if(oNode.readyState=="complete"||oNode.readyState=="loaded"){a()}};oNode.onreadystatechange=b},RedirectToLoginPage:function(){sCurrentURL=location.href;location.href="/login.aspx?rd="+sCurrentURL},ClassSwapper:function(b,c,a){if(b){b.className=b.className.replace(c,a)}},IsIE:function(){return/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent)},GetInt:function(b,a){if(typeof b==ThePort.Common.CONST_STRING_TYPE){if(b==ThePort.Common.CONST_EMPTY_STRING){if((typeof a==ThePort.Common.CONST_UNDEFINED)){return 0}else{return a}}return parseInt(b,10)}return b},BooleanToString:function(a){if(a==true){return"true"}return"false"},StringToBoolean:function(b,a){if(typeof a==ThePort.Common.CONST_UNDEFINED){a=false}switch(b.toLowerCase()){case"true":case"yes":case"1":return true;case"false":case"no":case"0":return false;case null:return a;default:return Boolean(a)}},LimitText:function(c,b,a){if(c.value.length>=a){c.value=c.value.substring(0,a)}else{b.value=a-c.value.length}},PopTextIntoWindow:function(b){var a=window.open("");a.document.write(b);a.document.close()}}}if(ThePortRegisterNS("ThePort.XMLProcessor")){ThePort.XMLProcessor=function(){this.m_sXml=null;this.m_oXml=null;this.m_xsltProcessor=null;this.m_xsl=null;this.m_xslOriginal=null;this.m_sTree=ThePort.Common.CONST_EMPTY_STRING;this.m_callback=null;this.m_ajaxBusy=false};ThePort.XMLProcessor.prototype.transform=function(){var d=this.m_oXml;var g=this.m_xsl;try{if(typeof XSLTProcessor!=ThePort.Common.CONST_UNDEFINED){if(!this.m_xsltProcessor){this.m_xsltProcessor=new XSLTProcessor();this.m_xsltProcessor.importStylesheet(g)}try{try{var c=this.m_xsltProcessor.transformToDocument(d)}catch(f){}var a=new XMLSerializer();var b=a.serializeToString(c);return b}catch(f){}}else{return(d.transformNode(g))}}catch(f){}return ThePort.Common.CONST_EMPTY_STRING};ThePort.XMLProcessor.prototype.loadXMLText=function(a){this.m_sXml=a;this.m_oXml=ThePort.XSL.LoadDocument(a)};ThePort.XMLProcessor.prototype.revert=function(a){this.loadXMLText(this.m_sXml)};ThePort.XMLProcessor.prototype.setNodeEventValue=function(a,c){var b=a.value;this.setNodeValue(c,b)};ThePort.XMLProcessor.prototype.loadXSLText=function(a){this.m_xsl=ThePort.XSL.LoadDocument(a);if(typeof XSLTProcessor!=ThePort.Common.CONST_UNDEFINED){this.m_xsltProcessor=null;this.m_xsltProcessor=new XSLTProcessor();this.m_xsltProcessor.importStylesheet(this.m_xsl)}};ThePort.XMLProcessor.prototype.SetNodeEventValue=function(a,c){var b=a.value;this.setNodeValue(c,b)};ThePort.XMLProcessor.prototype.SetNodeChild=function(e,d){if(window.ActiveXObject){var c=this.m_oXml.selectNodes(e);if((c!=null)&&(c.length>0)){if(c[0].hasChildNodes()){while(c[0].childNodes.length>=1){c[0].removeChild(c[0].firstChild)}}}c[0].appendChild(d.m_oXml.firstChild)}else{var b=this.m_oXml.evaluate(e,this.m_oXml,null,XPathResult.ANY_TYPE,null);var a=b.iterateNext();if(a){if(a.hasChildNodes()){while(a.childNodes.length>=1){a.removeChild(a.firstChild)}}}if((navigator.userAgent.toLowerCase().indexOf("safari"))||(navigator.userAgent.toLowerCase().indexOf("chrome"))){var c=d.m_oXml.firstChild.cloneNode(true);a.appendChild(c);return}else{a.appendChild(d.m_oXml.firstChild)}}};ThePort.XMLProcessor.prototype.SetNodeValue=function(e,d){if(window.ActiveXObject){var c=this.m_oXml.selectNodes(e);if((c!=null)&&(c.length>0)){c[0].text=d}}else{var b=this.m_oXml.evaluate(e,this.m_oXml,null,XPathResult.ANY_TYPE,null);var a=b.iterateNext();if(a){if(a.childNodes.length>0){a.childNodes[0].nodeValue=d}else{a.textContent=d}}}};ThePort.XMLProcessor.prototype.getNodeValue=function(e){var b;if(window.ActiveXObject){var d=this.m_oXml.selectNodes(e);if(d!=null){return d[0].text}}else{var c=this.m_oXml.evaluate(e,this.m_oXml,null,XPathResult.ANY_TYPE,null);var a=c.iterateNext();if(a){return a.childNodes[0].nodeValue}}return null};ThePort.XMLProcessor.prototype.parse=function(a){if(typeof a.tagName!="undefined"){this.m_sTree+="<ul><li>";this.m_sTree+="&lt;<b>"+a.tagName+"</b>";if(a.attributes){for(var d=0;d<a.attributes.length;d++){var c=a.attributes[d].name;var e=ThePort.Utils.GetAttrValueFromNode(a,c);this.m_sTree+=" "+c+"='"+e+"'"}}this.m_sTree+="&gt; : ";if(a.hasChildNodes()){for(var b=0;b<a.childNodes.length;b++){this.parse(a.childNodes[b])}}this.m_sTree+="</li></ul>"}else{this.m_sTree+=ThePort.Utils.GetValueFromNode(a)}};ThePort.XMLProcessor.prototype.getTagValue=function(a){return ThePort.Utils.GetTagValue(this.m_oXml,a)};ThePort.XMLProcessor.prototype.debug=function(){if(this.m_oXml!=null){if((parent!=null)&&(typeof parent.xmlframe!=ThePort.Common.CONST_UNDEFINED)&&(parent.xmlframe!=null)){win=parent.xmlframe}else{win=window.open("")}this.displayXML(win,this.m_oXml);win.document.close()}};ThePort.XMLProcessor.prototype.XmlToText=function(){var b=this.m_oXml;var a=b.documentElement;this.m_sTree=ThePort.Common.CONST_EMPTY_STRING;this.parse(a);return this.m_sTree};ThePort.XMLProcessor.prototype.displayXML=function(b,c){var a=c.documentElement;this.m_sTree=ThePort.Common.CONST_EMPTY_STRING;this.parse(a);b.document.write(this.m_sTree);this.m_sTree=ThePort.Common.CONST_EMPTY_STRING};ThePort.XMLProcessor.prototype.Delete=function(c,b){if(this.m_ajaxBusy){return}else{this.m_ajaxBusy=true}if(typeof b!=ThePort.Common.CONST_UNDEFINED){this.m_callback=b}else{this.m_callback=null}var a=ThePort.Common.CONST_EMPTY_STRING;a+=ThePort.Utils.GetVariablePair(ThePort.Common.QS_DATA,ThePort.XSL.EscapeXML(ThePort.XSL.SerializeToXML(this.m_oXml)));if(typeof c!=ThePort.Common.CONST_UNDEFINED){a+=ThePort.Utils.AddVariablePair(ThePort.Common.QS_CACHE_RESET,c)}a+=ThePort.Utils.AddVariablePair(ThePort.Common.QS_DATAFORMAT,ThePort.Common.CONST_FORMAT_JSON);ThePort.Utils.Ajax(ThePort.Common.CONST_FORM_DELETE,ThePort.Common.CONST_AJAX_URL,ThePort.Utils.Bind(this,"Response"),a)};ThePort.XMLProcessor.prototype.Save=function(c,b){if(this.m_ajaxBusy){return}else{this.m_ajaxBusy=true}if(typeof b!=ThePort.Common.CONST_UNDEFINED){this.m_callback=b}else{this.m_callback=null}var a=ThePort.Common.CONST_EMPTY_STRING;a+=ThePort.Utils.GetVariablePair(ThePort.Common.QS_DATA,ThePort.XSL.EscapeXML(ThePort.XSL.SerializeToXML(this.m_oXml)));if(typeof c!=ThePort.Common.CONST_UNDEFINED){a+=ThePort.Utils.AddVariablePair(ThePort.Common.QS_CACHE_RESET,c)}a+=ThePort.Utils.AddVariablePair(ThePort.Common.QS_DATAFORMAT,ThePort.Common.CONST_FORMAT_JSON);ThePort.Utils.Ajax(ThePort.Common.CONST_FORM_POST,ThePort.Common.CONST_AJAX_URL,ThePort.Utils.Bind(this,"Response"),a)};ThePort.XMLProcessor.prototype.Response=function(b){if(ThePort.Debug.window){ThePort.Utils.LogServerException(b)}var a=ThePort.Utils.GetReplyObject(b);if((a.Obj!=null)&&(a.Obj.length>0)){this.loadXMLText(a.Obj)}this.m_ajaxBusy=false;if(this.m_callback){this.m_callback(a)}else{try{ThePortReply.Event_Response(a)}catch(c){}}return}}if(ThePortRegisterNS("ThePort.XSL")){ThePort.XSL={Instantiate:function(a){var c=a;if(c.substr(0,4)=="&lt;"){c=ThePort.XSL.Decoder(a)}var b=new ThePort.XMLProcessor();b.loadXMLText(c);return b},Instantiate64:function(b){var a=new ThePort.XMLProcessor();return ThePort.XSL.Instantiate(ThePort.Utils.Decode64(b))},RenderXML:function(b){var a=new ThePort.XMLProcessor();a.m_oXml=b;a.debug()},ParseAndRenderXML:function(a,c){var b=new ThePort.XMLProcessor();b.displayXML(a,ThePort.XSL.LoadDocument(c))},FormatXmlToString:function(a){var b=new ThePort.XMLProcessor();b.m_sTree=ThePort.Common.CONST_EMPTY_STRING;b.parse(a.documentElement);return b.m_sTree},Decoder:function(b){try{if((typeof b==ThePort.Common.CONST_UNDEFINED)||(b==null)){return null}b=b.replace(/&apos;/g,ThePort.Common.CONST_SINGLE_QUOTE);b=b.replace(/&quot;/g,ThePort.Common.CONST_DBL_QUOTE);b=b.replace(/&lt;/g,ThePort.Common.CONST_LESS_THAN);b=b.replace(/&gt;/g,ThePort.Common.CONST_GREATER_THAN);b=b.replace(/&amp;/g,ThePort.Common.CONST_AMPERSAND);return b}catch(a){return null}},LoadDocument:function(a){var b;if(window.ActiveXObject){b=new ActiveXObject(ThePort.Common.CONST_ACTIVEX_XML_OBJ);b.async=false;b.loadXML(a)}else{var c=new DOMParser();b=c.parseFromString(a,ThePort.Common.CONST_CONTENTTYPE_XML)}return(b)},EscapeXML:function(b){var a=b;a=a.replace(/&/g,ThePort.Common.CONST_ENC_AMPERSAND);a=a.replace(/'/g,ThePort.Common.CONST_ENC_SINGLE_QUOTE);a=a.replace(/\"/g,ThePort.Common.CONST_ENC_DBL_QUOTE);a=a.replace(/</g,ThePort.Common.CONST_ENC_LESS_THAN);a=a.replace(/>/g,ThePort.Common.CONST_ENC_GREATER_THAN);return a},EscapeToHTML:function(b){var a=b;a=a.replace(/&/g,ThePort.Common.CONST_ENC_AMPERSAND);a=a.replace(/'/g,"&#39;");a=a.replace(/\"/g,ThePort.Common.CONST_ENC_DBL_QUOTE);a=a.replace(/</g,ThePort.Common.CONST_ENC_LESS_THAN);a=a.replace(/>/g,ThePort.Common.CONST_ENC_GREATER_THAN);return a},SerializeToXML:function(b){var a=ThePort.Common.CONST_EMPTY_STRING;if(window.ActiveXObject){a=b.xml}else{a=(new XMLSerializer()).serializeToString(b)}return(a)},Save:function(a,c,b){if(typeof a!=ThePort.Common.CONST_UNDEFINED){a.Save(c,b)}else{alert("Unable to save object to server.")}},Delete:function(a,c,b){if(typeof a!=ThePort.Common.CONST_UNDEFINED){ThePort.Debug.Log("AJAX Rest object delete called.");a.Delete(c,b)}else{alert("Unable to delete object from server.")}},AjaxPost:function(c,a,b){if(a.length<=0){return}eUrl=encodeURI(c);ThePort.Utils.Ajax(ThePort.Common.CONST_FORM_POST,eUrl,b,a)},AjaxDelete:function(c,a,b){if(a.length<=0){return}eUrl=encodeURI(c);ThePort.Utils.Ajax(ThePort.Common.CONST_FORM_DELETE,eUrl,b,a)},AjaxGet:function(b,a){eUrl=encodeURI(b);ThePort.Utils.Ajax(ThePort.Common.CONST_FORM_GET,eUrl,a,ThePort.Common.CONST_EMPTY_STRING)},GetModulePointer:function(b){if(typeof ThePort.Module.Array==ThePort.Common.CONST_UNDEFINED){return null}for(var a=0;a<ThePort.Module.Array.length;a++){if((ThePort.Module.Array[a].m_sName==b)||(ThePort.Module.Array[a].m_sModuleName==b)){return ThePort.Module.Array[a]}}ThePort.Debug.Log("ERROR::GetModulePointer('"+b+"') Unable to find Module.");return null},ShiftArgs:function(){try{[].shift.call(arguments)}catch(a){}return arguments},Shift2Args:function(){try{[].shift.call(arguments);[].shift.call(arguments)}catch(a){}return arguments},CallAllModuleFunction:function(a){if(typeof ThePort.Module.Array==ThePort.Common.CONST_UNDEFINED){return false}var c=this["ShiftArgs"].apply(null,arguments);for(var b=0;b<ThePort.Module.Array.length;b++){try{value=ThePort.Module.Array[b][a].apply(ThePort.Module.Array[b],c)}catch(d){}}},CallModuleFunction:function(f,a){if(typeof ThePort.Module.Array==ThePort.Common.CONST_UNDEFINED){return false}var c=this["Shift2Args"].apply(null,arguments);for(var b=0;b<ThePort.Module.Array.length;b++){if((ThePort.Module.Array[b].m_sName==f)||(ThePort.Module.Array[b].m_sModuleName==f)){try{value=ThePort.Module.Array[b][a].apply(ThePort.Module.Array[b],c)}catch(d){}}}}}}if(ThePortRegisterNS("ThePort.Tabs")){if(typeof ThePort.Tabs.Array==ThePort.Common.CONST_UNDEFINED){ThePort.Tabs.Array=new Array()}}if(ThePortRegisterNS("ThePort.UI.Tabs")){ThePort.UI.Tabs=function(b,c,d,a){this.m_sTabName=b;this.m_sTabAreaName=c;this.m_iTabStart=a;this.m_iActiveTab=a;this.m_sTabIDs=new Array();ThePort.Tabs.Array.push(this);if(d){for(i=0;i<d;i++){this.m_sTabIDs.push(i+1)}}};ThePort.UI.Tabs.prototype.AddTab=function(){if(this.m_sTabIDs.length==0){this.m_iTabStart=1;this.m_iActiveTab=0}this.m_sTabIDs.push(this.m_sTabIDs.length++)};ThePort.UI.Tabs.prototype.AddTab=function(a){if(this.m_sTabIDs.length==0){this.m_iTabStart=a;this.m_iActiveTab=a}this.m_sTabIDs.push(a)};ThePort.UI.Tabs.prototype.SetLastTabAsStart=function(){this.SetStart(this.m_sTabIDs.length)};ThePort.UI.Tabs.prototype.SetStart=function(a){this.m_iTabStart=a;this.m_iActiveTab=this.m_iTabStart};ThePort.UI.Tabs.prototype.Render=function(c){try{var a;for(i=0;i<this.m_sTabIDs.length;i++){if(this.m_sTabIDs[i]==c){a=i}}this.m_iActiveTabIdx=a;for(i=0;i<this.m_sTabIDs.length;i++){try{document.getElementById(this.m_sTabName+this.m_sTabIDs[i]).className="tab"+this.m_sTabIDs[i]}catch(b){}try{document.getElementById(this.m_sTabAreaName+this.m_sTabIDs[i]).style.display="none"}catch(b){}}try{document.getElementById(this.m_sTabName+this.m_sTabIDs[this.m_iActiveTabIdx]).className="tab"+this.m_sTabIDs[this.m_iActiveTabIdx]+" tabactive"}catch(b){}try{document.getElementById(this.m_sTabAreaName+this.m_sTabIDs[this.m_iActiveTabIdx]).style.display="block"}catch(b){}}catch(b){}};ThePort.UI.Tabs.prototype.Hilight=function(b){try{return;for(i=1;i<=this.m_iTabCount;i++){document.getElementById(this.m_sTabName+this.m_sTabIDs[i]).className="tab"+this.m_sTabIDs[i]}document.getElementById(this.m_sTabName+b).className="tab"+b+" tabactive"}catch(a){}};ThePort.UI.Tabs.prototype.UnHilight=function(){return;this.Hilight(this.m_iActiveTab)};ThePort.UI.Tabs.prototype.Initialize=function(){this.Render(this.m_iTabStart)}}if(ThePortRegisterNS("ThePort.ReplyObject")){ThePort.ReplyObject=function(a){this.ID=ThePort.Common.CONST_EMPTY_STRING;this.Response=ThePort.Common.CONST_EMPTY_STRING;this.ReturnCode=0;this.Action=ThePort.Common.CONST_EMPTY_STRING;this.ObjectName=ThePort.Common.CONST_EMPTY_STRING;this.Message=ThePort.Common.CONST_EMPTY_STRING;this.Data=ThePort.Common.CONST_EMPTY_STRING;this.Hash=ThePort.Common.CONST_EMPTY_STRING;this.Obj=ThePort.Common.CONST_EMPTY_STRING;this.loadReply(a)};ThePort.ReplyObject.prototype.getProcessedXML=function(){try{oProcessor=new ThePort.XMLProcessor();oProcessor.loadXMLText(this.getDataText());oProcessor.loadXSLText(this.getStyleText());return(oProcessor.transform())}catch(a){return ThePort.Common.CONST_ERROR_MESSAGE}};ThePort.ReplyObject.prototype.loadReply=function(a){try{this.ID=ThePort.Utils.GetTagValue(a,"ID");this.Response=ThePort.Utils.GetTagValue(a,"Response");this.ReturnCode=ThePort.Utils.GetTagValue(a,"ReturnCode");this.Action=ThePort.Utils.GetTagValue(a,"Action");this.ObjectName=ThePort.Utils.GetTagValue(a,"ObjectName");this.Message=ThePort.Utils.GetTagValue(a,"Message");this.Data=ThePort.Utils.GetTagValue(a,"Data");this.Hash=ThePort.Utils.GetTagValue(a,"Hash");this.Obj=ThePort.Utils.GetTagValue(a,"Obj")}catch(b){return false}return true}}if(ThePortRegisterNS("ThePort.UI.Paging")){ThePort.UI.Paging=function(d,e,a,b,f,g,c){this.m_iCurrentPage=0;this.m_iStartPage=0;this.m_iEndPage=0;this.m_iNumResults=f;this.m_iTotalPages=0;this.m_iResultStart=b;this.m_iTotalItems=a;this.m_sPagingID=e;this.m_sModuleID=d;this.m_sInactiveClassName=g;this.m_sSelectedClassName=c};ThePort.UI.Paging.prototype.GetNumPageIndexes=function(b){var a=1;while(ThePort.Utils.GetObj(b+"Elem"+a)!=null){a++}return a-1};ThePort.UI.Paging.prototype.Render=function(){var d;var b=ThePort.XSL.GetModulePointer(this.m_sModuleID);var c=b.oDict.GetDictionaryKey("sName");this.m_iNumPageIndexes=this.GetNumPageIndexes(this.m_sPagingID);this.m_iTotalPages=Math.ceil(this.m_iTotalItems/this.m_iNumResults);this.m_iCurrentPage=Math.max(Math.ceil(this.m_iResultStart/this.m_iNumResults),1);this.m_iStartPage=Math.max(1,Math.ceil(this.m_iCurrentPage-(this.m_iNumPageIndexes/2)));this.m_iEndPage=Math.min(this.m_iTotalPages,this.m_iStartPage+this.m_iNumPageIndexes-1);if(this.m_iEndPage<this.m_iStartPage+this.m_iNumPageIndexes-1){this.m_iStartPage=Math.max(1,this.m_iEndPage-(this.m_iNumPageIndexes)+1)}if(this.m_iTotalPages<=this.m_iNumPageIndexes){ThePort.Utils.Hide(this.m_sPagingID+"Start");ThePort.Utils.Hide(this.m_sPagingID+"Prev");ThePort.Utils.Hide(this.m_sPagingID+"Next");ThePort.Utils.Hide(this.m_sPagingID+"End")}if(this.m_iCurrentPage<=1){ThePort.Utils.SetClassName(this.m_sPagingID+"Start",this.m_sInactiveClassName);ThePort.Utils.SetClassName(this.m_sPagingID+"Prev",this.m_sInactiveClassName);this.RenderElement(c,this.m_sPagingID+"Start",this.m_sModuleID,"",(this.m_iCurrentPage-1)*this.m_iNumResults+1,"ExecutePaging");this.RenderElement(c,this.m_sPagingID+"Prev",this.m_sModuleID,"",(this.m_iCurrentPage-1)*this.m_iNumResults+1,"ExecutePaging")}else{this.RenderElement(c,this.m_sPagingID+"Start",this.m_sModuleID,"",1,"ExecutePaging");this.RenderElement(c,this.m_sPagingID+"Prev",this.m_sModuleID,"",(this.m_iCurrentPage-1)*this.m_iNumResults,"ExecutePaging")}i=this.m_iStartPage;for(var a=1;a<=this.m_iNumPageIndexes;a=a+1){if((i>=this.m_iStartPage)&&(i<=this.m_iEndPage)){if(i==this.m_iCurrentPage){ThePort.Utils.SetClassName(this.m_sPagingID+"Elem"+a,this.m_sSelectedClassName)}this.RenderElement(c,this.m_sPagingID+"Elem"+a,this.m_sModuleID,i+"",(i-1)*this.m_iNumResults+1,"ExecutePaging")}else{ThePort.Utils.Hide(this.m_sPagingID+"Elem"+a)}i+=1}if(this.m_iTotalPages>this.m_iNumPageIndexes){this.RenderElement(c,this.m_sPagingID+"Next",this.m_sModuleID,"",(this.m_iCurrentPage+1)*this.m_iNumResults,"ExecutePaging");this.RenderElement(c,this.m_sPagingID+"End",this.m_sModuleID,"",((this.m_iTotalPages-1)*this.m_iNumResults)+1,"ExecutePaging")}if(this.m_iCurrentPage>=this.m_iTotalPages){ThePort.Utils.SetClassName(this.m_sPagingID+"Next",this.m_sInactiveClassName);ThePort.Utils.SetClassName(this.m_sPagingID+"End",this.m_sInactiveClassName);this.RenderElement(c,this.m_sPagingID+"Next",this.m_sModuleID,"",(this.m_iCurrentPage-1)*this.m_iNumResults+1,"ExecutePaging");this.RenderElement(c,this.m_sPagingID+"End",this.m_sModuleID,"",(this.m_iCurrentPage-1)*this.m_iNumResults+1,"ExecutePaging")}if(this.m_iCurrentPage>=this.m_iTotalPages){ThePort.Utils.SetClassName(this.m_sPagingID+"Next",this.m_sInactiveClassName)}ThePort.Utils.SetInnerHTML(this.m_sPagingID+"CurrentPage"," "+this.m_iCurrentPage+" ");ThePort.Utils.SetInnerHTML(this.m_sPagingID+"TotalPages"," "+this.m_iTotalPages+" ")};ThePort.UI.Paging.prototype.More=function(){var a=ThePort.XSL.GetModulePointer(this.m_sModuleID);var b=a.oDict.GetDictionaryKey("sName");this.m_iTotalPages=Math.ceil(this.m_iTotalItems/this.m_iNumResults);this.m_iCurrentPage=Math.max(Math.ceil(this.m_iResultStart/this.m_iNumResults),1);if(this.m_iTotalPages<this.m_iCurrentPage){ThePort.Utils.Hide(this.m_sPagingID+"More");return}this.RenderElement(b,this.m_sPagingID+"More",this.m_sModuleID,"",this.m_iResultStart+this.m_iNumResults,"ExecuteMore");if(!a){return false}ThePort.Utils.SetInnerHTML(this.m_sPagingID+"CurrentShown"," "+(this.m_iResultStart+this.m_iNumResults-1)+" ");ThePort.Utils.SetInnerHTML(this.m_sPagingID+"TotalItems"," "+this.m_iTotalItems+" ")};ThePort.UI.Paging.prototype.RenderElement=function(j,h,c,f,b,a){var d="";oNode=ThePort.Utils.GetObj(h);if(!oNode){return}oNode.onclick=ThePort.Utils.BinderNP(this,a,b);try{oNode.href=ThePort.Utils.ReplaceQSVariable(window.location.href,j,ThePort.Common.QS_RESULTSTART+"="+b)}catch(g){}if(f.length>0){oNode.innerHTML=f}return};ThePort.UI.Paging.prototype.GotoPage=function(b){var a=(b-1)*this.m_iNumResults+1;if(a>this.m_iTotalItems){return}else{this.ExecutePaging(a)}};ThePort.UI.Paging.prototype.ExecutePaging=function(a){oModule=ThePort.XSL.GetModulePointer(this.m_sModuleID);if(!oModule){return false}oModule.oDict.PutDictionaryKey(ThePort.Common.QS_OPERATION,ThePort.Common.CONST_OPERATION_REFRESH);return this.Execute(a)};ThePort.UI.Paging.prototype.ExecuteMore=function(a){oModule=ThePort.XSL.GetModulePointer(this.m_sModuleID);if(!oModule){return false}oModule.oDict.PutDictionaryKey(ThePort.Common.QS_OPERATION,ThePort.Common.CONST_OPERATION_MORE);return this.Execute(a)};ThePort.UI.Paging.prototype.Execute=function(a){var b=this.m_sModuleID;oModule=ThePort.XSL.GetModulePointer(b);if(!oModule){return false}if((a==oModule.oDict.GetDictionaryKey(ThePort.Common.QS_RESULTSTART))||(a>this.m_iTotalItems)){a=((this.m_iTotalPages-1)*this.m_iNumResults)+1}oModule.oDict.PutDictionaryKey(ThePort.Common.QS_RESULTSTART,a+"");ThePort.Debug.Log("Module::"+oModule.m_sName+" is changing the current index in viewing to iResultStart="+a);if(oModule.oDict.GetDictionaryKey(ThePort.Common.QS_OPERATION)!=ThePort.Common.CONST_OPERATION_MORE){ThePort.Utils.ScrollPageToNodeTop(oModule.oDict.GetDictionaryKey("sParentID"))}oModule.GoBusy(this.m_sPagingID);oModule.Update();return false}}if(ThePortRegisterNS("ThePort.Event")){ThePort.Event={GetEventTarget:function(a){if(a.target){oEventTarget=a.target}else{if(a.srcElement){oEventTarget=a.srcElement}}if(targ.nodeType==3){oEventTarget=oEventTarget.parentNode}return oEventTarget},GetEventKeyCode:function(b){if(b.keyCode){iKeyCode=b.keyCode}else{if(b.which){iKeyCode=b.which}}var a=String.fromCharCode(iKeyCode);return iKeyCode},IsEventRightMouseClick:function(a){if(a.which){bRightclick=(a.which==3)}else{if(a.button){bRightclick=(a.button==2)}}return bRightclick},GetEventMouseX:function(a){var b=0;if(a.pageX||a.pageY){b=a.pageX}else{if(a.clientX||a.clientY){b=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft}}return b},GetEventMouseY:function(a){var b=0;if(a.pageX||a.pageY){b=a.pageY}else{if(a.clientX||a.clientY){b=a.clientY+document.body.scrollTop+document.documentElement.scrollTop}}return b},StopEvent:function(a){if(a.stopPropagation){a.stopPropagation()}else{a.cancelBubble=true}},AddHandler:function(c,b,a){if(!c){return}if(c.addEventListener){c.addEventListener(b,a,false)}else{if(c.attachEvent){c["e"+b+a]=a;c.attachEvent("on"+b,function(){c["e"+b+a]()})}}},RemoveHandler:function(c,b,a){if(c.removeEventListener){c.removeEventListener(b,a,false)}else{if(c.detachEvent){c.detachEvent("on"+b,c["e"+b+a]);c["e"+b+a]=null}}}}}ThePortRegisterNS("ThePort.Dictionary");ThePort.Dictionary=function(a){this.sValues=[];if(typeof a==ThePort.Common.CONST_UNDEFINED){a=ThePort.Common.CONST_EMPTY_STRING}this.FromCSV(a)};ThePort.Dictionary.prototype.GetDictionaryCSV=function(){return this.ToCSV()};ThePort.Dictionary.prototype.KeysToCSV=function(){var a=ThePort.Common.CONST_EMPTY_STRING;for(key in this.sValues){if(typeof this.sValues[key]!=ThePort.Common.CONST_TYPE_FUNCTION){if(a.length>0){a+=ThePort.Common.CONST_COMMA}a+=escape(key)}}return a};ThePort.Dictionary.prototype.ValuesToCSV=function(){var a=ThePort.Common.CONST_EMPTY_STRING;for(key in this.sValues){if(typeof this.sValues[key]!=ThePort.Common.CONST_TYPE_FUNCTION){if(a.length>0){a+=ThePort.Common.CONST_COMMA}a+=escape(this.sValues[key])}}return a};ThePort.Dictionary.prototype.ToCSV=function(){var a=ThePort.Common.CONST_EMPTY_STRING;for(key in this.sValues){if(typeof this.sValues[key]!=ThePort.Common.CONST_TYPE_FUNCTION){if(a.length>0){a+=ThePort.Common.CONST_COMMA}a+=escape(key)+ThePort.Common.CONST_EQUALS+escape(this.sValues[key])}}return a};ThePort.Dictionary.prototype.ResetDictionary=function(){this.sValues=null;this.sValues=[]};ThePort.Dictionary.prototype.KeysFromCSV=function(b){this.sValues=[];if((typeof b==ThePort.Common.CONST_UNDEFINED)||(b.length<=0)){return}sItems=b.split(/\s?,\s?/);for(var a=0;a<sItems.length;a++){this.AddStringPair(unescape(sItems[a]),unescape(ThePort.Common.CONST_EMPTY_STRING))}};ThePort.Dictionary.prototype.FromCSV=function(b){this.sValues=[];if((typeof b==ThePort.Common.CONST_UNDEFINED)||(b.length<=0)){return}sItems=b.split(/\s?,\s?/);for(var a=0;a<sItems.length;a++){var c=sItems[a].split(/\s?=\s?/);if(c.length==2){this.AddStringPair(unescape(c[0]),unescape(c[1]))}else{if(c.length==1){this.AddStringPair(unescape(c[0]),unescape(ThePort.Common.CONST_EMPTY_STRING))}}}};ThePort.Dictionary.prototype.PutDictionaryKey=function(a,b){this.AddStringPair(a,b)};ThePort.Dictionary.prototype.RemoveDictionaryKey=function(a){try{delete this.sValues[a]}catch(b){}};ThePort.Dictionary.prototype.GetDictionaryKey=function(a){var b=this.sValues[a];if(typeof b==ThePort.Common.CONST_UNDEFINED){b=ThePort.Common.CONST_EMPTY_STRING}return b};ThePort.Dictionary.prototype.AddStringPair=function(a,b){this.sValues[a]=b};ThePort.Dictionary.prototype.AddControlID=function(a){var b=ThePort.Utils.GetObj(a);if(b!=null){AddControl(b)}};ThePort.Dictionary.prototype.AddControl=function(a){if(a!=null){this.sValues[a.id]=a.value}};ThePort.Dictionary.prototype.Items=function(){return(this.sValues==null?[]:this.sValues)};ThePort.Dictionary.prototype.RemoveDictionaryKey=function(a){try{delete this.sValues[a]}catch(b){}};ThePort.Dictionary.prototype.Count=function(){var a=0;for(key in this.sValues){if(typeof this.sValues[key]!=ThePort.Common.CONST_TYPE_FUNCTION){a+=1}}return a};ThePort.Dictionary.prototype.GetArraySortedByKey=function(){return this.GetArray()};ThePort.Dictionary.prototype.GetArraySortedByValue=function(){return this.GetArray(false)};ThePort.Dictionary.prototype.GetArray=function(){var b=new Array();var e=function(g,f){return((g[1]<f[1])?-1:((g[1]>f[1])?1:0))};var d=true;if(arguments[0]!=null&&arguments[0]==false){d=false}for(key in this.sValues){if(typeof this.sValues[key]!=ThePort.Common.CONST_TYPE_FUNCTION){var c=new Array();c[0]=key;c[1]=this.sValues[key];b.push(c)}}if(d==true){b.sort()}else{b.sort(e)}return b};if(ThePortRegisterNS("ThePort.XML.Writer")){ThePort.XML.Writer=function(){this.m_oXml=new Array();this.Nodes=new Array();this.State=""};ThePort.XML.Writer.prototype.FormatXML=function(a){if(a){return a.replace(/&/g,"&amp;").replace(/\"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}return""};ThePort.XML.Writer.prototype.BeginNode=function(a){if(!a){return}if(this.State=="beg"){this.m_oXml.push(">")}this.State="beg";this.Nodes.push(a);this.m_oXml.push("<"+a)};ThePort.XML.Writer.prototype.EndNode=function(){if(this.State=="beg"){this.m_oXml.push("/>");this.Nodes.pop()}else{if(this.Nodes.length>0){this.m_oXml.push("</"+this.Nodes.pop()+">")}}this.State=""};ThePort.XML.Writer.prototype.Attrib=function(a,b){if(this.State!="beg"||!a){return}sAttr=" "+a+'="'+this.FormatXML(b)+'"';this.m_oXml.push(sAttr)};ThePort.XML.Writer.prototype.WriteString=function(a){if(this.State=="beg"){this.m_oXml.push(">")}this.m_oXml.push(this.FormatXML(a));this.State=""};ThePort.XML.Writer.prototype.Node=function(a,b){if(!a){return}if(this.State=="beg"){this.m_oXml.push(">")}this.m_oXml.push((b==""||!b)?"<"+a+"/>":"<"+a+">"+this.FormatXML(b)+"</"+a+">");this.State=""};ThePort.XML.Writer.prototype.Close=function(){while(this.Nodes.length>0){this.EndNode()}this.State="closed"};ThePort.XML.Writer.prototype.ToString=function(){var b=ThePort.Common.CONST_EMPTY_STRING;for(var a=0;a<this.m_oXml.length;a++){b+=this.m_oXml[a]}return b}}if(ThePortRegisterNS("ThePort.Debug")){ThePort.Debug={Enable:function(){if(ThePort.Debug.window){return}ThePort.Debug.window=window.open("about:blank","_blank","left=0,top=0,width=800,height=400,scrollbars=yes,status=yes,resizable=yes");if(ThePort.Debug.window){ThePort.Debug.window.opener=self;ThePort.Debug.window.document.open();ThePort.Debug.window.document.write("<HTML><HEAD><TITLE>Debug Window</TITLE></HEAD><BODY><PRE>\n")}else{if(typeof ThePort.Debug.alertMessage!=ThePort.Common.CONST_UNDEFINED){alert("You have enabled the debug window.  However it appears popups are disabled in your browser.");ThePort.Debug.alertMessage=true}}},LogExx:function(a){try{if(ThePort.Debug.window){ThePort.Debug.window.document.write("The following exception occurred: "+a.name+" - "+a.message+"\n")}}catch(a){}},Log:function(b){try{if(ThePort.Debug.window){ThePort.Debug.window.document.write(b+"\n")}}catch(a){}},LogModuleMsg:function(a,b){try{if(ThePort.Debug.window){var d="";if(a.m_sName.length>0){d=a.m_sName}else{d=a.m_sModuleName+"(Please setInterval 'sName' dictionary variable)"}ThePort.Debug.window.document.write(d+" : "+b+"\n")}}catch(c){}},Disable:function(){try{if(ThePort.Debug.window){ThePort.Debug.window.close();ThePort.Debug.window=null}}catch(a){}}}}ThePortRegisterNS("ThePort.Framework");ThePort.Framework={ModuleCreate:function(h,e,d,c,n,f,g){h.oDict=new ThePort.Dictionary(e);h.m_sName=d;h.m_sParentID=c;h.m_sModuleName=n;h.m_sBusyIndicator=f;h.m_sHash=ThePort.Common.CONST_EMPTY_STRING;h.m_interval=null;h.m_timeout=null;h.m_oPaging=null;h.m_busy=false;h.m_oBusyIndicatorNode=null;ThePort.Debug.LogModuleMsg(h,"New object Constructed.");if(g=="1"){if(h.m_sParentID!=null){var b=ThePort.Utils.GetObj(h.m_sParentID);if(b){b.className="tp_Show_Parts_Surround";var j=document.createElement("B");var a=document.createTextNode("Module Name::"+d+"    XSLT::"+h.oDict.GetDictionaryKey("sXslFileName"));j.className="tp_Show_Parts_Title";var m=j.appendChild(a);b.insertBefore(j,b.firstChild)}}}},ModuleUpdate:function(a){ThePort.Debug.LogModuleMsg(a,"Making an AJAX UPDATE request.");a.GoBusy(a.m_sParentID);ThePort.Debug.LogModuleMsg(a,"Send ajax Update request.");var b="/APIs/Services/XSL/Process.ashx";sPostData=ThePort.Utils.GetVariablePair(ThePort.Common.QS_DATA,a.oDict.ToCSV());if(a.m_sHash.length>0){sPostData+=ThePort.Utils.AddVariablePair(ThePort.Common.QS_HASH,a.m_sHash)}ThePort.XSL.AjaxPost(b,sPostData,ThePort.Utils.AjaxBind(a,"onUpdateResponse"))},ModuleOnUpdateResponse:function(b,c){ThePort.Debug.LogModuleMsg(b,"Processing an AJAX UPDATE Response.");b.NoBusy();ThePort.Debug.LogModuleMsg(b,"Handling ajax response.");var d=new ThePort.ReplyObject(c.responseXML);var e=ThePort.Utils.GetObj(b.m_sParentID);if(d.Response!="true"){if(e){ThePort.Debug.LogModuleMsg(b,"Ajax response=false, Message='"+d.Message+"'")}}else{if(e){ThePort.Debug.LogModuleMsg(b,"Ajax response=true, Updating content with new hash='"+d.Hash+"'");ThePort.Debug.LogModuleMsg(b,"Updating display with ajax data.");var a=ThePort.Utils.GetObj(b.m_sModuleName+"_Paging");if((a)&&(b.oDict.GetDictionaryKey(ThePort.Common.QS_OPERATION)==ThePort.Common.CONST_OPERATION_MORE)){a.parentNode.removeChild(a);ThePort.Utils.AddHTMLIntoNode(e,d.Data)}else{ThePort.Utils.LoadHTMLIntoNode(e,d.Data)}}else{ThePort.Debug.LogModuleMsg(b,"There are updates, but unable to locate sParentID::"+b.m_sParentID);b.CleanUp()}}},ModuleGoBusy:function(g,j){try{if(g.m_busy){return false}if(g.m_oBusyIndicatorNode!=null){return false}ThePort.Debug.LogModuleMsg(g,"Turning ON busy indicator.");if(typeof j==ThePort.Common.CONST_UNDEFINED){j=g.m_sParentID}var n=ThePort.Utils.GetObj(j);if(n==null){return false}var m=ThePort.Utils.findPosX(n);var d=ThePort.Utils.findPosY(n);var a=n.offsetHeight;var b=n.offsetWidth;var f=m+(b/2)-60;var c=d;g.m_oBusyIndicatorNode=document.body.appendChild(document.createElement("div"));g.m_oBusyIndicatorNode.style.left=f.toString()+"px";g.m_oBusyIndicatorNode.style.top=c.toString()+"px";g.m_oBusyIndicatorNode.style.position="absolute";g.m_oBusyIndicatorNode.innerHTML=g.m_sBusyIndicator}catch(h){g.m_oBusyIndicatorNode=null}g.m_busy=true;return true},ModuleNoBusy:function(a){try{ThePort.Debug.LogModuleMsg(a,"Turning OFF busy indicator.");a.m_busy=false;if(a.m_oBusyIndicatorNode){a.m_oBusyIndicatorNode.parentNode.removeChild(a.m_oBusyIndicatorNode)}a.m_oBusyIndicatorNode=null}catch(b){}},ModuleRefresh:function(a){ThePort.Debug.LogModuleMsg(a,"Refreshing module.");if((a.oDict.GetDictionaryKey(ThePort.Common.QS_OPERATION)==ThePort.Common.CONST_OPERATION_MORE)){a.oDict.PutDictionaryKey(ThePort.Common.QS_RESULTSTART,"1");a.oDict.PutDictionaryKey(ThePort.Common.QS_OPERATION,ThePort.Common.CONST_OPERATION_REFRESH)}a.Update()},ModuleDemand:function(a){ThePort.Debug.LogModuleMsg(a,"Module Demand called.  Turning off any icache variables.");a.oDict.PutDictionaryKey(ThePort.Common.QS_CACHE_RESET,"1");a.Refresh()},ModuleSetHash:function(a,b){ThePort.Debug.LogModuleMsg(a,"Setting HASH for module data.");ThePort.Debug.LogModuleMsg(a,"Hash = "+b);a.m_sHash=b},ModuleShow:function(a){ThePort.Debug.LogModuleMsg(a,"Showing Module");ThePort.Utils.Show(a.m_sParentID)},ModuleHide:function(a){ThePort.Debug.LogModuleMsg(a,"Hiding Module.");ThePort.Debug.LogModuleMsg(a,"Hide");ThePort.Utils.Hide(a.m_sParentID)},ModuleRefreshInterval:function(a,b){a.StopInterval();if(b>0){ThePort.Debug.LogModuleMsg(a,"RefreshInterval pending update in "+b+" seconds.");a.m_interval=setInterval(ThePort.Utils.Bind(a,"Refresh"),b*1000)}},ModuleStopInterval:function(a){if(a.m_interval){ThePort.Debug.LogModuleMsg(a,"Clearing previous interval.");clearInterval(a.m_interval)}a.m_interval=null},ModuleRefreshTimeout:function(a,b){a.StopTimeout();if(b>0){ThePort.Debug.LogModuleMsg(a,"RefreshTimeOut pending update in "+b+" seconds.");a.m_timeout=setTimeout(ThePort.Utils.Bind(a,"Refresh"),b*1000)}},ModuleDemandTimeout:function(a,b){a.StopTimeout();if(b>0){ThePort.Debug.LogModuleMsg(a,"DemandTimeOut pending update in "+b+" seconds.");a.m_timeout=setTimeout(ThePort.Utils.Bind(a,"Demand"),b*1000)}},ModuleStopTimeout:function(a){if(a.m_timeOut){ThePort.Debug.LogModuleMsg(a,"Clearing any previous timeOut.");clearInterval(a.m_timeout)}a.m_timeout=null},ModuleCleanUp:function(a){a.StopTimeout();a.StopInterval();a.NoBusy();ThePort.Debug.LogModuleMsg(a,"Timer cleanup.")},ModuleGotoPage:function(a,b){if(a.m_oPaging!=null){a.m_oPaging.GotoPage(b)}}};if(ThePortRegisterNS("ThePort.Code")){ThePort.Code={CONST_SUCCESS:0,CONST_ERROR_TIMEOUT:-1,CONST_ERROR_AUTH:-2}}if(ThePortRegisterNS("ThePort.FX")){ThePort.FX={iBusy:0,OpenDiv:function(a){if(ThePort.FX.iBusy!=0){return}ThePort.FX.iBusy=1;var c=ThePort.Utils.GetObj(a);ThePort.Utils.ShowNode(c);if(c.style.height!="1px"){c.style.origHeight=c.scrollHeight}c.style.height=1;setTimeout(b,10);function b(){var d=parseInt(c.style.height.split("px")[0]);if(d<c.style.origHeight){if(d+5>c.style.origHeight){d=c.style.origHeight}else{d+=10}c.style.height=d.toString()+"px";setTimeout(b,2)}else{ThePort.Utils.ShowNode(c);ThePort.FX.iBusy=0}}},CloseDiv:function(a){if(ThePort.FX.iBusy!=0){return}ThePort.FX.iBusy=1;var c=ThePort.Utils.GetObj(a);setTimeout(b,10);function b(){var d=parseInt(c.style.height.split("px")[0]);if(d>1){if(d-10<0){d=0}else{d-=10}c.style.height=d.toString()+"px";setTimeout(b,2)}else{ThePort.Utils.HideNode(c);ThePort.FX.iBusy=0}}}}}if(String.prototype.trim==null){String.prototype.trim=function(){if(this.length<1){return""}var a=new String("");a=this.rTrim();a=a.lTrim();return a}}if(String.prototype.rTrim==null){String.prototype.rTrim=function(){var c=String.fromCharCode(32);var d=this.length;var b="";if(d<0){return""}var a=d-1;while(a>-1){if(this.charAt(a)==c){}else{b=this.substring(0,a+1);break}a=a-1}return b}}if(String.prototype.lTrim==null){String.prototype.lTrim=function(){var c=String.fromCharCode(32);if(d<1){return""}var d=this.length;var b="";var a=0;while(a<d){if(this.charAt(a)==c){}else{b=this.substring(a,d);break}a=a+1}return b}}if(String.prototype.left==null){String.prototype.left=function(a){if(a<=0){return""}else{if(a>this.length){return this}else{return this.substring(0,a)}}}}if(String.prototype.right==null){String.prototype.right=function(b){if(b<=0){return""}else{if(b>this.length){return this}else{var a=this.length;return this.substring(a,a-b)}}}}if(String.prototype.trimEnd==null){String.prototype.trimEnd=function(c){if(c.length<=0){return""}else{if(c.length>this.length){return this}else{var a=c.length;var b=this.right(a);if(b==c){return this.substring(0,this.length-a)}return this}}}}if(ThePortRegisterNS("ThePort.UI.PopWindow")){ThePort.UI.PopWindow={popUpWindow:null,OpenDivWindow:function(b,c,a){if(typeof c==ThePort.Common.CONST_UNDEFINED){c=450}if(typeof a==ThePort.Common.CONST_UNDEFINED){a=450}ThePort.UI.PopWindow.popUpWindow=ThePort.UI.PopModalWindow.open("tp_Win","div",b,"","width="+c+"px,height="+a+"px,center=1,resize=0,scrolling=1")},OpenWindow:function(b,d,a,c){if(typeof d==ThePort.Common.CONST_UNDEFINED){d=450}if(typeof a==ThePort.Common.CONST_UNDEFINED){a=450}if(c=="modal"){ThePort.UI.PopWindow.popUpWindow=ThePort.UI.PopModalWindow.open("tp_Win","iframe",b,"","width="+d+"px,height="+a+"px,center=1,resize=1,scrolling=1")}if(c=="regular"){ThePort.UI.PopWindow.popUpWindow=ThePort.UI.PopWindow.open("tp_Win","iframe",b,"","width="+d+"px,height="+a+"px,center=1,resize=1,scrolling=1")}},OpenRegularWindow:function(b,a,c){ThePort.UI.PopWindow.OpenWindow(b,a,c,"regular")},CloseWindow:function(a){if(ThePort.UI.PopWindow.popUpWindow){ThePort.UI.PopWindow.popUpWindow.hide();if(a==true){window.location=window.location}}},OpenModalWindow:function(b,a,c){ThePort.UI.PopWindow.OpenWindow(b,a,c,"modal")},CloseModalWindow:function(a){ThePort.UI.PopWindow.CloseWindow(a)},ajaxbustcache:true,ajaxloadinghtml:"<b>Loading Page. Please wait...</b>",minimizeorder:0,zIndexvalue:100,tobjects:[],lastactivet:{},init:function(b){var e=document.createElement("div");e.id=b;e.className="dhtmlwindow";var d="";d='<div class="drag-handle">';d+='DHTML Window <div class="drag-controls"></div>';d+="</div>";d+='<div class="drag-contentarea"></div>';d+='<div class="drag-statusarea"><div class="drag-resizearea">&nbsp;</div></div>';d+="</div>";e.innerHTML=d;document.getElementById("dhtmlwindowholder").appendChild(e);var b=document.getElementById(b);var c=b.getElementsByTagName("div");for(var a=0;a<c.length;a++){if(/drag-/.test(c[a].className)){b[c[a].className.replace(/drag-/,"")]=c[a]}}b.handle._parent=b;b.resizearea._parent=b;b.controls._parent=b;b.onclose=function(){return true};b.onmousedown=function(){ThePort.UI.PopWindow.setfocus(this)};b.handle.onmousedown=ThePort.UI.PopWindow.setupdrag;b.resizearea.onmousedown=ThePort.UI.PopWindow.setupdrag;b.controls.onclick=ThePort.UI.PopWindow.enablecontrols;b.show=function(){ThePort.UI.PopWindow.show(this)};b.hide=function(){ThePort.UI.PopWindow.hide(this)};b.close=function(){ThePort.UI.PopWindow.close(this)};b.isClosed=false;b.setSize=function(f,g){ThePort.UI.PopWindow.setSize(this,f,g)};b.moveTo=function(f,g){ThePort.UI.PopWindow.moveTo(this,f,g)};b.isResize=function(f){ThePort.UI.PopWindow.isResize(this,f)};b.isScrolling=function(f){ThePort.UI.PopWindow.isScrolling(this,f)};b.load=function(f,g,h){ThePort.UI.PopWindow.load(this,f,g,h)};this.tobjects[this.tobjects.length]=b;return b},open:function(n,e,m,h,f,j){var g=ThePort.UI.PopWindow;function b(d){var o=new RegExp(d+"=([^,]+)","i");return(o.test(f))?parseInt(RegExp.$1):0}if(document.getElementById(n)==null){n=this.init(n)}else{n=document.getElementById(n)}this.setfocus(n);n.setSize(b(("width")),(b("height")));var c=b("center")?"middle":b("left");var a=b("center")?"middle":b("top");if(typeof j!="undefined"&&j=="recal"&&this.scroll_top==0){if(window.attachEvent&&!window.opera){this.addEvent(window,function(){setTimeout(function(){n.moveTo(c,a)},400)},"load")}else{this.addEvent(window,function(){n.moveTo(c,a)},"load")}}n.isResize(b("resize"));n.isScrolling(b("scrolling"));n.style.visibility="visible";n.style.display="block";n.contentarea.style.display="block";n.moveTo(c,a);n.load(e,m,h);if(n.state=="minimized"&&n.controls.firstChild.title=="Restore"){n.controls.firstChild.setAttribute("title","Minimize");n.state="fullview"}return n},setSize:function(b,a,c){b.style.width=Math.max(parseInt(a),150)+"px";b.contentarea.style.height=Math.max(parseInt(c),100)+"px"},moveTo:function(b,a,c){this.getviewpoint();b.style.left=(a=="middle")?this.scroll_left+(this.docwidth-b.offsetWidth)/2+"px":this.scroll_left+parseInt(a)+"px";b.style.top=(c=="middle")?this.scroll_top+(this.docheight-b.offsetHeight)/2+"px":this.scroll_top+parseInt(c)+"px"},isResize:function(a,b){a.statusarea.style.display=(b)?"block":"none";a.resizeBool=(b)?1:0},isScrolling:function(a,b){a.contentarea.style.overflow=(b)?"auto":"hidden"},load:function(c,b,d,e){if(c.isClosed){alert("DHTML Window has been closed, so no window to load contents into. Open/Create the window again.");return}var b=b.toLowerCase();if(typeof e!="undefined"){c.handle.firstChild.nodeValue=e}if(b=="inline"){c.contentarea.innerHTML=d}else{if(b=="div"){var a=document.getElementById(d);c.contentarea.innerHTML=(a.defaultHTML||a.innerHTML);if(!a.defaultHTML){a.defaultHTML=a.innerHTML}a.innerHTML="";a.style.display="none"}else{if(b=="iframe"){c.contentarea.style.overflow="hidden";if(!c.contentarea.firstChild||c.contentarea.firstChild.tagName!="IFRAME"){c.contentarea.innerHTML='<iframe src="" style="margin:0; padding:0; width:100%; height: 100%" name="_iframe-'+c.id+'"></iframe>'}window.frames["_iframe-"+c.id].location.replace(d)}else{if(b=="ajax"){this.ajax_connect(d,c)}}}}c.contentarea.datatype=b},setupdrag:function(b){var c=ThePort.UI.PopWindow;var a=this._parent;c.etarget=this;var b=window.event||b;c.initmousex=b.clientX;c.initmousey=b.clientY;c.initx=parseInt(a.offsetLeft);c.inity=parseInt(a.offsetTop);c.width=parseInt(a.offsetWidth);c.contentheight=parseInt(a.contentarea.offsetHeight);if(a.contentarea.datatype=="iframe"){a.style.backgroundColor="#F8F8F8";a.contentarea.style.visibility="hidden"}document.onmousemove=c.getdistance;document.onmouseup=function(){if(a.contentarea.datatype=="iframe"){a.contentarea.style.backgroundColor="white";a.contentarea.style.visibility="visible"}c.stop()};return false},getdistance:function(b){var c=ThePort.UI.PopWindow;var a=c.etarget;var b=window.event||b;c.distancex=b.clientX-c.initmousex;c.distancey=b.clientY-c.initmousey;if(a.className=="drag-handle"){c.move(a._parent,b)}else{if(a.className=="drag-resizearea"){c.resize(a._parent,b)}}return false},getviewpoint:function(){var b=document.all&&!window.opera;var a=document.documentElement&&parseInt(document.documentElement.clientWidth)||100000;this.standardbody=(document.compatMode=="CSS1Compat")?document.documentElement:document.body;this.scroll_top=(b)?this.standardbody.scrollTop:window.pageYOffset;this.scroll_left=(b)?this.standardbody.scrollLeft:window.pageXOffset;this.docwidth=(b)?this.standardbody.clientWidth:(/Safari/i.test(navigator.userAgent))?window.innerWidth:Math.min(a,window.innerWidth-16);this.docheight=(b)?this.standardbody.clientHeight:window.innerHeight},rememberattrs:function(a){this.getviewpoint();a.lastx=parseInt((a.style.left||a.offsetLeft))-ThePort.UI.PopWindow.scroll_left;a.lasty=parseInt((a.style.top||a.offsetTop))-ThePort.UI.PopWindow.scroll_top;a.lastwidth=parseInt(a.style.width)},move:function(a,b){a.style.left=ThePort.UI.PopWindow.distancex+ThePort.UI.PopWindow.initx+"px";a.style.top=ThePort.UI.PopWindow.distancey+ThePort.UI.PopWindow.inity+"px"},resize:function(a,b){a.style.width=Math.max(ThePort.UI.PopWindow.width+ThePort.UI.PopWindow.distancex,150)+"px";a.contentarea.style.height=Math.max(ThePort.UI.PopWindow.contentheight+ThePort.UI.PopWindow.distancey,100)+"px"},enablecontrols:function(b){var c=ThePort.UI.PopWindow;var a=window.event?window.event.srcElement:b.target;if(/Minimize/i.test(a.getAttribute("title"))){c.minimize(a,this._parent)}else{if(/Restore/i.test(a.getAttribute("title"))){c.restore(a,this._parent)}else{if(/Close/i.test(a.getAttribute("title"))){c.close(this._parent)}}}return false},minimize:function(b,a){ThePort.UI.PopWindow.rememberattrs(a);b.setAttribute("title","Restore");a.state="minimized";a.contentarea.style.display="none";a.statusarea.style.display="none";if(typeof a.minimizeorder=="undefined"){ThePort.UI.PopWindow.minimizeorder++;a.minimizeorder=ThePort.UI.PopWindow.minimizeorder}a.style.left="10px";a.style.width="200px";var c=a.minimizeorder*10;a.style.top=ThePort.UI.PopWindow.scroll_top+ThePort.UI.PopWindow.docheight-(a.handle.offsetHeight*a.minimizeorder)-c+"px"},restore:function(b,a){ThePort.UI.PopWindow.getviewpoint();b.setAttribute("title","Minimize");a.state="fullview";a.style.display="block";a.contentarea.style.display="block";if(a.resizeBool){a.statusarea.style.display="block"}a.style.left=parseInt(a.lastx)+ThePort.UI.PopWindow.scroll_left+"px";a.style.top=parseInt(a.lasty)+ThePort.UI.PopWindow.scroll_top+"px";a.style.width=parseInt(a.lastwidth)+"px"},close:function(b){try{var a=b.onclose()}catch(c){var a=true}finally{if(typeof a=="undefined"){alert('An error has occured somwhere inside your "onclose" event handler');var a=true}}if(a){if(b.state!="minimized"){ThePort.UI.PopWindow.rememberattrs(b)}if(window.frames["_iframe-"+b.id]){window.frames["_iframe-"+b.id].location.replace("about:blank")}else{b.contentarea.innerHTML=""}b.style.display="none";b.isClosed=true}return a},setopacity:function(a,b){if(!a){return}if(a.filters&&a.filters[0]){if(typeof a.filters[0].opacity=="number"){a.filters[0].opacity=b*100}else{a.style.filter="alpha(opacity="+b*100+")"}}else{if(typeof a.style.MozOpacity!="undefined"){a.style.MozOpacity=b}else{if(typeof a.style.opacity!="undefined"){a.style.opacity=b}}}},setfocus:function(a){this.zIndexvalue++;a.style.zIndex=this.zIndexvalue;a.isClosed=false;this.setopacity(this.lastactivet.handle,0.5);this.setopacity(a.handle,1);this.lastactivet=a},show:function(a){if(a.isClosed){alert("DHTML Window has been closed, so nothing to show. Open/Create the window again.");return}if(a.lastx){ThePort.UI.PopWindow.restore(a.controls.firstChild,a)}else{a.style.display="block"}this.setfocus(a);a.state="fullview"},hide:function(a){a.style.display="none"},ajax_connect:function(a,b){var f=false;var d="";if(window.XMLHttpRequest){f=new XMLHttpRequest()}else{if(window.ActiveXObject){try{f=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{f=new ActiveXObject("Microsoft.XMLHTTP")}catch(c){}}}else{return false}}b.contentarea.innerHTML=this.ajaxloadinghtml;f.onreadystatechange=function(){ThePort.UI.PopWindow.ajax_loadpage(f,b)};if(this.ajaxbustcache){d=(a.indexOf("?")!=-1)?"&"+new Date().getTime():"?"+new Date().getTime()}f.open("GET",a+d,true);f.send(null)},ajax_loadpage:function(b,a){if(b.readyState==4&&(b.status==200||window.location.href.indexOf("http")==-1)){a.contentarea.innerHTML=b.responseText}},stop:function(){ThePort.UI.PopWindow.etarget=null;document.onmousemove=null;document.onmouseup=null},addEvent:function(b,c,a){var a=(window.addEventListener)?a:"on"+a;if(b.addEventListener){b.addEventListener(a,c,false)}else{if(b.attachEvent){b.attachEvent(a,c)}}},cleanup:function(){for(var a=0;a<ThePort.UI.PopWindow.tobjects.length;a++){ThePort.UI.PopWindow.tobjects[a].handle._parent=ThePort.UI.PopWindow.tobjects[a].resizearea._parent=ThePort.UI.PopWindow.tobjects[a].controls._parent=null}window.onload=null}};document.write('<div id="dhtmlwindowholder"><span style="display:none">.</span></div>');window.onunload=ThePort.UI.PopWindow.cleanup}if(ThePortRegisterNS("ThePort.UI.PopModalWindow")){ThePort.UI.PopModalWindow={veilstack:0,open:function(c,b,e,g,a,h){var f=ThePort.UI.PopWindow;this.interVeil=document.getElementById("interVeil");this.veilstack++;this.loadveil();if(h=="recal"&&f.scroll_top==0){f.addEvent(window,function(){ThePort.UI.PopModalWindow.adjustveil()},"load")}var c=f.open(c,b,e,g,a,h);c.controls.onclick=function(){ThePort.UI.PopModalWindow.close(this._parent,true)};c.show=function(){ThePort.UI.PopModalWindow.show(this)};c.hide=function(){ThePort.UI.PopModalWindow.close(this)};return c},loadveil:function(){var a=ThePort.UI.PopWindow;var b=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;a.getviewpoint();if(b){this.docheightcomplete=window.innerHeight}else{this.docheightcomplete=(a.standardbody.offsetHeight>a.standardbody.scrollHeight)?a.standardbody.offsetHeight:a.standardbody.scrollHeight}this.interVeil.style.width=a.docwidth+"px";this.interVeil.style.height=this.docheightcomplete+"px";this.interVeil.style.left=0;this.interVeil.style.top=0;this.interVeil.style.visibility="visible";this.interVeil.style.display="block"},adjustveil:function(){if(this.interVeil&&this.interVeil.style.display=="block"){this.loadveil()}},closeveil:function(){this.veilstack--;if(this.veilstack==0){this.interVeil.style.display="none"}},close:function(b,a){b.contentDoc=(b.contentarea.datatype=="iframe")?window.frames["_iframe-"+b.id].document:b.contentarea;if(typeof a!="undefined"){b.onclose=function(){return true}}if(ThePort.UI.PopWindow.close(b)){this.closeveil()}},show:function(a){ThePort.UI.PopModalWindow.veilstack++;ThePort.UI.PopModalWindow.loadveil();ThePort.UI.PopWindow.show(a)}};document.write('<div id="interVeil"></div>')}if(ThePortRegisterNS("ThePort.Xml2JSon")){ThePort.Xml2JSon={parser:function(e,d,b){if(!d){d=""}e=e.replace(/\s*\/>/g,"/>");e=e.replace(/<\?[^>]*>/g,"").replace(/<\![^>]*>/g,"");if(!d.sort){d=d.split(",")}var a=this.no_fast_endings(e);a=this.attris_to_tags(a);a=escape(a);a=a.split("%3C").join("<").split("%3E").join(">").split("%3D").join("=").split("%22").join('"');for(var c=0;c<d.length;c++){a=a.replace(new RegExp("<"+d[c]+">","g"),"*$**"+d[c]+"**$*");a=a.replace(new RegExp("</"+d[c]+">","g"),"*$***"+d[c]+"**$*")}a="<JSONTAGWRAPPER>"+a+"</JSONTAGWRAPPER>";this.xmlobject={};var f=this.xml_to_object(a).jsontagwrapper;if(b){f=this.show_json_structure(f,b)}return f},xml_to_object:function(xmlcode){var x=xmlcode.replace(/<\//g,"§");x=x.split("<");var y=[];var level=0;var opentags=[];for(var i=1;i<x.length;i++){var tagname=x[i].split(">")[0];opentags.push(tagname);level++;y.push(level+"<"+x[i].split("§")[0]);while(x[i].indexOf("§"+opentags[opentags.length-1]+">")>=0){level--;opentags.pop()}}var oldniva=-1;var objname="this.xmlobject";for(var i=0;i<y.length;i++){var preeval="";var niva=y[i].split("<")[0];var tagnamn=y[i].split("<")[1].split(">")[0];tagnamn=tagnamn.toLowerCase();var rest=y[i].split(">")[1];if(niva<=oldniva){var tabort=oldniva-niva+1;for(var j=0;j<tabort;j++){objname=objname.substring(0,objname.lastIndexOf("."))}}objname+="."+tagnamn;var pobject=objname.substring(0,objname.lastIndexOf("."));if(eval("typeof "+pobject)!="object"){preeval+=pobject+"={value:"+pobject+"};\n"}var objlast=objname.substring(objname.lastIndexOf(".")+1);var already=false;for(k in eval(pobject)){if(k==objlast){already=true}}var onlywhites=true;for(var s=0;s<rest.length;s+=3){if(rest.charAt(s)!="%"){onlywhites=false}}if(rest!=""&&!onlywhites){if(rest/1!=rest){rest="'"+rest.replace(/\'/g,"\\'")+"'";rest=rest.replace(/\*\$\*\*\*/g,"</");rest=rest.replace(/\*\$\*\*/g,"<");rest=rest.replace(/\*\*\$\*/g,">")}}else{rest="{}"}if(rest.charAt(0)=="'"){rest="unescape("+rest+")"}if(already&&!eval(objname+".sort")){preeval+=objname+"=["+objname+"];\n"}var before="=";after="";if(already){before=".push(";after=")"}var toeval=preeval+objname+before+rest+after;eval(toeval);if(eval(objname+".sort")){objname+="["+eval(objname+".length-1")+"]"}oldniva=niva}return this.xmlobject},show_json_structure:function(d,a,b){var h="";if(d.sort){h+="[\n"}else{h+="{\n"}for(var e in d){if(!d.sort){h+=e+":"}if(typeof d[e]=="object"){h+=this.show_json_structure(d[e],false,1)}else{if(typeof d[e]=="function"){var m=d[e]+"";h+=m}else{if(typeof d[e]!="string"){h+=d[e]+",\n"}else{h+="'"+d[e].replace(/\'/g,"\\'").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")+"',\n"}}}}if(d.sort){h+="],\n"}else{h+="},\n"}if(!b){h=h.substring(0,h.lastIndexOf(","));h=h.replace(new RegExp(",\n}","g"),"\n}");h=h.replace(new RegExp(",\n]","g"),"\n]");var f=h.split("\n");h="";var g=0;for(var e=0;e<f.length;e++){if(f[e].indexOf("}")>=0||f[e].indexOf("]")>=0){g--}tabs="";for(var c=0;c<g;c++){tabs+="\t"}h+=tabs+f[e]+"\n";if(f[e].indexOf("{")>=0||f[e].indexOf("[")>=0){g++}}if(a=="html"){h=h.replace(/</g,"&lt;").replace(/>/g,"&gt;");h=h.replace(/\n/g,"<BR>").replace(/\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;")}if(a=="compact"){h=h.replace(/\n/g,"").replace(/\t/g,"")}}return h},no_fast_endings:function(a){a=a.split("/>");for(var c=1;c<a.length;c++){var b=a[c-1].substring(a[c-1].lastIndexOf("<")+1).split(" ")[0];a[c]="></"+b+">"+a[c]}a=a.join("");return a},attris_to_tags:function(a){var g=" =\"'".split("");a=a.split(">");for(var e=0;e<a.length;e++){var b=a[e].split("<");for(var f=0;f<4;f++){b[0]=b[0].replace(new RegExp(g[f],"g"),"_jsonconvtemp"+f+"_")}if(b[1]){b[1]=b[1].replace(/'/g,'"');b[1]=b[1].split('"');for(var c=1;c<b[1].length;c+=2){for(var f=0;f<4;f++){b[1][c]=b[1][c].replace(new RegExp(g[f],"g"),"_jsonconvtemp"+f+"_")}}b[1]=b[1].join('"')}a[e]=b.join("<")}a=a.join(">");a=a.replace(/ ([^=]*)=([^ |>]*)/g,"><$1>$2</$1");a=a.replace(/>"/g,">").replace(/"</g,"<");for(var f=0;f<4;f++){a=a.replace(new RegExp("_jsonconvtemp"+f+"_","g"),g[f])}return a}}}function ThePortCommon(){}ThePortCommon.Constants={CONST_EMPTY_STRING:ThePort.Common.CONST_EMPTY_STRING,CONST_UNDEFINED:ThePort.Common.CONST_UNDEFINED,CONST_TYPE_FUNCTION:ThePort.Common.CONST_TYPE_FUNCTION,CONST_ERROR_MESSAGE:ThePort.Common.CONST_ERROR_MESSAGE,CONST_FORM_POST:ThePort.Common.CONST_FORM_POST,CONST_FORM_GET:ThePort.Common.CONST_FORM_GET,CONST_FORM_DELETE:ThePort.Common.CONST_FORM_DELETE,CONST_FORM_PUT:ThePort.Common.CONST_FORM_PUT,CONST_FORMAT_XML:ThePort.Common.CONST_FORMAT_XML,CONST_FORMAT_JSON:ThePort.Common.CONST_FORMAT_JSON,CONST_CONTENTTYPE_JSON1:ThePort.Common.CONST_CONTENTTYPE_JSON1,CONST_CONTENTTYPE_JSON2:ThePort.Common.CONST_CONTENTTYPE_JSON2,CONST_CONTENTTYPE_JSON3:ThePort.Common.CONST_CONTENTTYPE_JSON3,CONST_CONTENTTYPE_XML:ThePort.Common.CONST_CONTENTTYPE_XML,CONST_CONTENTTYPE:ThePort.Common.CONST_CONTENTTYPE,CONST_FORM_POST_URLENC:ThePort.Common.CONST_FORM_POST_URLENC,CONST_CONTENTLENGTH:ThePort.Common.CONST_CONTENTLENGTH,CONST_HEADER_CONNECTION:ThePort.Common.CONST_HEADER_CONNECTION,CONST_HEADER_CONN_CLOSE:ThePort.Common.CONST_HEADER_CONN_CLOSE,CONST_ACTIVEX1_AJAX_OBJ:ThePort.Common.CONST_ACTIVEX1_AJAX_OBJ,CONST_ACTIVEX2_AJAX_OBJ:ThePort.Common.CONST_ACTIVEX2_AJAX_OBJ,CONST_ACTIVEX_XML_OBJ:ThePort.Common.CONST_ACTIVEX_XML_OBJ,QS_NAME:ThePort.Common.QS_NAME,QS_OBJECTID:ThePort.Common.QS_OBJECTID,QS_DATA:ThePort.Common.QS_DATA,QS_DATAFORMAT:ThePort.Common.QS_DATAFORMAT,QS_HASH:ThePort.Common.QS_HASH,QS_COMMENT:ThePort.Common.QS_COMMENT,QS_CONTEXTID:ThePort.Common.QS_CONTEXTID,CONST_COMMA:ThePort.Common.CONST_COMMA,CONST_EQUALS:ThePort.Common.CONST_EQUALS,CONST_QUESTION_MARK:ThePort.Common.CONST_QUESTION_MARK,CONST_AMPERSAND:ThePort.Common.CONST_AMPERSAND,CONST_SINGLE_QUOTE:ThePort.Common.CONST_SINGLE_QUOTE,CONST_DBL_QUOTE:ThePort.Common.CONST_DBL_QUOTE,CONST_GREATER_THAN:ThePort.Common.CONST_GREATER_THAN,CONST_LESS_THAN:ThePort.Common.CONST_LESS_THAN,CONST_ENC_AMPERSAND:ThePort.Common.CONST_ENC_AMPERSAND,CONST_ENC_SINGLE_QUOTE:ThePort.Common.CONST_ENC_SINGLE_QUOTE,CONST_ENC_DBL_QUOTE:ThePort.Common.CONST_ENC_DBL_QUOTE,CONST_ENC_GREATER_THAN:ThePort.Common.CONST_ENC_GREATER_THAN,CONST_ENC_LESS_THAN:ThePort.Common.CONST_ENC_LESS_THAN,CONST_HTTP_READYSTATE_UNINITIALIZED:ThePort.Common.CONST_HTTP_READYSTATE_UNINITIALIZED,CONST_HTTP_READYSTATE_LOADING:ThePort.Common.CONST_HTTP_READYSTATE_LOADING,CONST_HTTP_READYSTATE_LOADED:ThePort.Common.CONST_HTTP_READYSTATE_LOADED,CONST_HTTP_READYSTATE_INTERACTIVE:ThePort.Common.CONST_HTTP_READYSTATE_INTERACTIVE,CONST_HTTP_READYSTATE_COMPLETED:ThePort.Common.CONST_HTTP_READYSTATE_COMPLETED,CONST_STYLE_DISPLAY_ON:ThePort.Common.CONST_STYLE_DISPLAY_ON,CONST_STYLE_DISPLAY_OFF:ThePort.Common.CONST_STYLE_DISPLAY_OFF,CONST_AJAX_URL:ThePort.Common.CONST_AJAX_URL};ThePortXSL={Instantiate:function(a){return ThePort.XSL.Instantiate(a)},Instantiate64:function(a){return ThePort.XSL.Instantiate64(a)},RenderXML:function(a){return ThePort.XSL.RenderXML(a)},ParseAndRenderXML:function(a,b){return ThePort.XSL.ParseAndRenderXML(a,b)},FormatXmlToString:function(a){return ThePort.XSL.FormatXmlToString(a)},Decoder:function(a){return ThePort.XSL.Decoder(a)},LoadDocument:function(a){return ThePort.XSL.LoadDocument(a)},EscapeXML:function(a){return ThePort.XSL.EscapeXML(a)},SerializeToXML:function(a){return ThePort.XSL.SerializeToXML(a)},Save:function(a,b){return ThePort.XSL.Save(a,b)},Delete:function(a,b){return ThePort.XSL.Delete(a,b)},AjaxPost:function(c,a,b){return ThePort.XSL.AjaxPost(c,a,b)},AjaxDelete:function(c,a,b){return ThePort.XSL.AjaxDelete(c,a,b)},AjaxGet:function(b,a){return ThePort.XSL.AjaxGet(b,a)},GetModulePointer:function(a){return ThePort.XSL.GetModulePointer(a)},CallModuleFunction:function(b,a){return ThePort.XSL.CallModuleFunction(b,a)}};ThePortUtilities={Ajax:function(d,c,b,a){return ThePort.Utils.Ajax(d,c,b,a)},Bind:function(a,b){return ThePort.Utils.Bind(a,b)},AjaxBind:function(a,b){return ThePort.Utils.AjaxBind(a,b)},LogServerException:function(a){return ThePort.Utils.LogServerException(a)},RegisterModule:function(a){return ThePort.Utils.RegisterModule(a)},GetTagValue:function(a,b){return ThePort.Utils.GetTagValue(a,b)},GetVariablePair:function(a,b){return ThePort.Utils.GetVariablePair(a,b)},AddDictionaryPair:function(a,b){return ThePort.Utils.AddDictionaryPair(a,b)},AddVariablePair:function(a,b){return ThePort.Utils.AddVariablePair(a,b)},GetTagAttributeValue:function(a,b,c){return ThePort.Utils.GetTagAttributeValue(a,b,c)},GetValueFromNode:function(a){return ThePort.Utils.GetValueFromNode(a)},GetAttrValueFromNode:function(b,a){return ThePort.Utils.GetAttrValueFromNode(b,a)},GetObj:function(a){return ThePort.Utils.GetObj(a)},StopEvent:function(a){return ThePort.Utils.StopEvent(a)},Show:function(a){return ThePort.Utils.Show(a)},Hide:function(a){return ThePort.Utils.Hide(a)},Toggle:function(a){return ThePort.Utils.Toggle(a)},KeyDownHandler:function(a,b){return ThePort.Utils.KeyDownHandler(a,b)},GetReplyObject:function(a){return ThePort.Utils.GetReplyObject(a)},Decode64:function(a){return ThePort.Utils.Decode64(a)}};ThePortXMLProcessor=function(){this.m_oXmp=new ThePort.XMLProcessor()};ThePortXMLProcessor.prototype.transform=function(){return this.m_oXmp.transform()};ThePortXMLProcessor.prototype.loadXMLText=function(a){return this.m_oXmp.loadXMLText(a)};ThePortXMLProcessor.prototype.revert=function(a){return this.m_oXmp.revert(a)};ThePortXMLProcessor.prototype.setNodeEventValue=function(a,b){return this.m_oXmp.setNodeEventValue(a,b)};ThePortXMLProcessor.prototype.loadXSLText=function(a){return this.m_oXmp.loadXSLText(a)};ThePortXMLProcessor.prototype.setNodeEventValue=function(a,b){return this.m_oXmp.setNodeEventValue(a,b)};ThePortXMLProcessor.prototype.setNodeValue=function(b,a){return this.m_oXmp.setNodeValue(b,a)};ThePortXMLProcessor.prototype.getNodeValue=function(a){return this.m_oXmp.getNodeValue(a)};ThePortXMLProcessor.prototype.parse=function(a){return this.m_oXmp.parse(a)};ThePortXMLProcessor.prototype.getTagValue=function(a){return this.m_oXmp.getTagValue(a)};ThePortXMLProcessor.prototype.debug=function(){return this.m_oXmp.debug()};ThePortXMLProcessor.prototype.displayXML=function(a,b){return this.m_oXmp.displayXML(a,b)};ThePortXMLProcessor.prototype.Delete=function(a){return this.m_oXmp.fnCallback(Delete)};ThePortXMLProcessor.prototype.Save=function(a){return this.m_oXmp.Save(a)};ThePortXMLProcessor.prototype.Response=function(a){return this.m_oXmp.Response(a)};ThePortReplyObject=function(a){this.m_ro=new ThePort.ReplyObject(a);this.ID=this.m_ro.ID;this.Response=this.m_ro.Response;this.ReturnCode=this.m_ro.ReturnCode;this.Action=this.m_ro.Action;this.ObjectName=this.m_ro.ObjectName;this.Message=this.m_ro.Message;this.Data=this.m_ro.Data;this.Hash=this.m_ro.Hash};ThePortReplyObject.prototype.getProcessedXML=function(){return this.m_ro.getProcessedXML()};ThePortReplyObject.prototype.loadReply=function(a){return this.m_ro.loadReply(a);this.ID=this.m_ro.ID;this.Response=this.m_ro.Response;this.ReturnCode=this.m_ro.ReturnCode;this.Action=this.m_ro.Action;this.ObjectName=this.m_ro.ObjectName;this.Message=this.m_ro.Message;this.Data=this.m_ro.Data;this.Hash=this.m_ro.Hash};if(ThePortRegisterNS("ThePort.OnLoader")){var oFunc=function(){ThePort.Initialize()};ThePort.Event.AddHandler(window,"load",oFunc)}var Drag={obj:null,dInt:null,cx:-1,cy:-1,init:function(e,h,d,m,g,b,f,a,n,j,p,c){d.instance=e;d.clientObject=h;d.onmousedown=Drag.start;d.root=m&&m!=null?m:d;d.hmode=n?false:true;d.vmode=j?false:true;if(d.hmode&&isNaN(parseInt(d.root.style.left))){d.root.style.left="0px"}if(d.vmode&&isNaN(parseInt(d.root.style.top))){d.root.style.top="0px"}if(!d.hmode&&isNaN(parseInt(d.root.style.right))){d.root.style.right="0px"}if(!d.vmode&&isNaN(parseInt(d.root.style.bottom))){d.root.style.bottom="0px"}d.minX=typeof g!="undefined"?g:null;d.minY=typeof f!="undefined"?f:null;d.maxX=typeof b!="undefined"?b:null;d.maxY=typeof a!="undefined"?a:null;d.xMapper=p?p:null;d.yMapper=c?c:null;d.root.onDragStart=new Function();d.root.onDragEnd=new Function();d.root.onDrag=new Function()},start:function(b){var c=Drag.obj=this;b=Drag.fixE(b);var d=parseInt(c.vmode?c.root.style.top:c.root.style.bottom);var a=parseInt(c.hmode?c.root.style.left:c.root.style.right);c.root.onDragStart(this.instance,this.clientObject,a,d);c.lastMouseX=b.clientX;c.lastMouseY=b.clientY;if(c.hmode){if(c.minX!=null){c.minMouseX=b.clientX-a+c.minX}if(c.maxX!=null){c.maxMouseX=c.minMouseX+c.maxX-c.minX}}else{if(c.minX!=null){c.maxMouseX=-c.minX+b.clientX+a}if(c.maxX!=null){c.minMouseX=-c.maxX+b.clientX+a}}if(c.vmode){if(c.minY!=null){c.minMouseY=b.clientY-d+c.minY}if(c.maxY!=null){c.maxMouseY=c.minMouseY+c.maxY-c.minY}}else{if(c.minY!=null){c.maxMouseY=-c.minY+b.clientY+d}if(c.maxY!=null){c.minMouseY=-c.maxY+b.clientY+d}}document.onmousemove=Drag.drag;document.onmouseup=Drag.end;Drag.cx=-1;Drag.cy=-1;if(Drag.dInt){clearInterval(Drag.dInt);Drag.dInt=null}return false},drag:function(f){f=Drag.fixE(f);if(f==null){cx=Drag.cx;cy=Drag.cy;if((cx<0)&&(cy<0)){return}}else{cx=f.clientX;cy=f.clientY}var a=Drag.obj;if(a==null){return}a.instance.loadScreenVariables();var b=0;if((cy>=a.instance.m_windowHeight-30)&&(cy+a.instance.m_scrollPosY<a.instance.itemH[a.instance.itemH.length-1]+a.instance.rowH[a.instance.rowH.length-1])){cy=a.instance.m_windowHeight-30;b=25;scrollTo(a.instance.m_scrollPosX,a.instance.m_scrollPosY+b);if(!Drag.dInt){Drag.dInt=setInterval(Drag.drag,1)}}else{if((cy<=30)&&(cy+a.instance.m_scrollPosY>a.instance.rowH[0])){cy=30;b=-25;scrollTo(a.instance.m_scrollPosX,a.instance.m_scrollPosY+b);if(!Drag.dInt){Drag.dInt=setInterval(Drag.drag,1)}}else{if(Drag.dInt){clearInterval(Drag.dInt);Drag.dInt=null}}}var g=cy+b;var h=cx;var j=parseInt(a.vmode?a.root.style.top:a.root.style.bottom)+b;var m=parseInt(a.hmode?a.root.style.left:a.root.style.right);var d,c;if(a.minX!=null){h=a.hmode?Math.max(h,a.minMouseX):Math.min(h,a.maxMouseX)}if(a.maxX!=null){h=a.hmode?Math.min(h,a.maxMouseX):Math.max(h,a.minMouseX)}if(a.minY!=null){g=a.vmode?Math.max(g,a.minMouseY):Math.min(g,a.maxMouseY)}if(a.maxY!=null){g=a.vmode?Math.min(g,a.maxMouseY):Math.max(g,a.minMouseY)}d=m+((h-a.lastMouseX)*(a.hmode?1:-1));c=j+((g-a.lastMouseY)*(a.vmode?1:-1));if(a.xMapper){d=a.xMapper(j)}else{if(a.yMapper){c=a.yMapper(m)}}Drag.obj.root.style[a.hmode?"left":"right"]=d+0.25+"px";Drag.obj.root.style[a.vmode?"top":"bottom"]=c+0.25+"px";Drag.obj.lastMouseX=h;Drag.obj.lastMouseY=g;Drag.obj.root.onDrag(a.instance,a.clientObject,d,c,h,g);Drag.cx=cx;Drag.cy=cy;return false},end:function(a){if(Drag.dInt){clearInterval(Drag.dInt);Drag.dInt=null}document.onmousemove=null;document.onmouseup=null;Drag.obj.root.onDragEnd(Drag.obj.instance,Drag.obj.clientObject,parseInt(Drag.obj.root.style[Drag.obj.hmode?"left":"right"]),parseInt(Drag.obj.root.style[Drag.obj.vmode?"top":"bottom"]),a);Drag.obj=null},fixE:function(a){try{if(typeof a=="undefined"){a=window.event}if(typeof a.layerX=="undefined"){a.layerX=a.offsetX}if(typeof a.layerY=="undefined"){a.layerY=a.offsetY}}catch(a){return null}return a}};function parm(a){this.value=a}ThePortRegisterNS("ThePort.Layout.Manager");ThePort.Layout.Manager=function(c,b,a,d,e,f){this.m_sID=c;this.columnInsertIdx;this.rowInsertIdx;this.colX;this.colY;this.rowH;this.itemH;this.m_windowWidth;this.m_windowHeight;this.m_scrollPosX;this.m_scrollPosY;this.m_iAdminMode=f;this.lastcolumnInsertIdx=-1;this.lastrowInsertIdx=-1;this.m_fnModuleEvent=null;this.m_fnModuleMove=null;this.m_dragMaxRowIdx=-1;this.m_dragReplaceType="add";this.draggable=d;this.m_saveSupport=e;this.m_dObj=new Array();this.idx=0;this.insertDiv=null;this.leftIndex=0;this.style=new Array();this.findPosX=findPosX;this.findPosY=findPosY;this.m_serializedModules=null;this.m_scriptFileUrl=null;this.m_minimized=false;this.m_defaultRiver=null;this.m_minimizeSerializing=true;this.m_prevSerializedData=ThePort.Common.CONST_EMPTY_STRING;this.colObj=new Array();this.m_itemStrings=null;this.m_oLayoutNode=document.createElement("div");this.m_oLayoutNode.id="tp_LayoutContainer_"+this.m_sID;oParentNode=ThePort.Utils.GetObj(b);oParentNode.appendChild(this.m_oLayoutNode);if(a<=0){a=5}this.SetColumnMode(a);this.lastMouseX=0;this.lastMouseY=0;this.m_oFnXMLCallback=null;this.bSerializeOnEveryWidgetLoad=false};ThePort.Layout.Manager.prototype.SerializeOnEveryWidgetLoad=function(a){this.bSerializeOnEveryWidgetLoad=a};ThePort.Layout.Manager.prototype.SetColumnMode=function(a){if(a==1){if(!this.Columnize(1)){return false}}else{if(a==2){if(!this.Columnize(2)){return false}this.colObj[0].style.width="69%";this.colObj[1].style.width="29%"}else{if(a==3){if(!this.Columnize(3)){return false}this.colObj[0].style.width="19%";this.colObj[1].style.width="19%";this.colObj[2].style.width="59%"}else{if(a==4){if(!this.Columnize(2)){return false}this.colObj[0].style.width="49%";this.colObj[1].style.width="49%"}else{if(a==5){if(!this.Columnize(3)){return false}this.colObj[0].style.width="32%";this.colObj[1].style.width="32%";this.colObj[2].style.width="32%"}else{if(a==6){if(!this.Columnize(3)){return false}this.colObj[0].style.width="59%";this.colObj[1].style.width="19%";this.colObj[2].style.width="19%"}else{if(a==7){if(!this.Columnize(2)){return false}this.colObj[0].style.width="29%";this.colObj[1].style.width="69%"}else{if(a==8){if(!this.Columnize(3)){return false}this.colObj[0].style.width="19%";this.colObj[1].style.width="59%";this.colObj[2].style.width="19%"}else{if(a==9){if(!this.Columnize(4)){return false}this.colObj[0].style.width="24%";this.colObj[1].style.width="24%";this.colObj[2].style.width="24%";this.colObj[3].style.width="24%"}}}}}}}}}this.m_columnMode=a;this.serializeState();return true};ThePort.Layout.Manager.prototype.Columnize=function(e){var b;b=this.colObj.length;if(b>e){for(var c=b-1;c>e-1;c--){if(this.GetGenericInsertWeight(c)>0){alert("Before reducing column count, please unlock widets in column #"+(c+1));return false}}}if((e<=0)||(e==b)){return true}if(e>b){for(c=0;c<e;c++){width=100/e;if(c<this.colObj.length){this.colObj[c].style.width=Math.floor(width-1)+"%";this.colObj[c].id="tp_LayoutColumn"+(c+1).toString()}else{d=document.createElement("div");d.className="layoutColumn";width=100/e;d.style.width=Math.floor(width-1)+"%";d.id="tp_LayoutColumn"+(c+1).toString();this.m_oLayoutNode.appendChild(d);this.colObj[this.colObj.length]=d}}}else{var a=0;for(c=e;c<b;c++){while(this.colObj[c].childNodes.length){var d=this.colObj[c].removeChild(this.colObj[c].childNodes[0]);this.colObj[a++].appendChild(d);if(a>=e){a=0}}}while(this.m_oLayoutNode.childNodes.length>e){var a=this.m_oLayoutNode.childNodes.length-1;this.colObj.splice(a,1);this.m_oLayoutNode.removeChild(this.m_oLayoutNode.childNodes[a])}width=100/e;for(c=0;c<this.m_oLayoutNode.childNodes.length;c++){this.colObj[c].style.width=Math.floor(width-1)+"%"}}return true};ThePort.Layout.Manager.prototype.Hide=function(){if(this.m_oLayoutNode!=void (0)){ThePort.Utils.Hide(this.m_oLayoutNode)}for(var a=0;a<this.m_dObj.length;a++){if(this.m_dObj[a].getType()=="group"){this.m_dObj[a].updateContentArea()}}};ThePort.Layout.Manager.prototype.Show=function(){if(this.m_oLayoutNode!=void (0)){ThePort.Utils.Show(this.m_oLayoutNode)}};ThePort.Layout.Manager.prototype.setRendererColumns=function(){var a=new Array();for(i=0;i<arguments.length;i++){a.push(arguments[i])}if(a.length<=0){return false}this.colObj=new Array();for(i=0;i<a.length;i++){this.colObj[this.colObj.length]=a[i]}};ThePort.Layout.Manager.prototype.Cleanup=function(){for(var a=0;a<this.m_dObj.length;a++){this.m_dObj[a].onClose()}var b=this.m_oLayoutNode.parentElement;b.removeChild(this.m_oLayoutNode);var b=this.m_riverViewNode.parentElement;b.removeChild(this.m_riverViewNode);this.collectGarbage()};ThePort.Layout.Manager.prototype.collectGarbage=function(){for(var b=0;b<this.m_dObj.length;b++){if(this.m_dObj[b].m_oWidgetObject==null){for(var a=0;a<this.m_dObj.length;a++){if((b!=a)&&(this.m_dObj[a].m_oWidgetObject!=null)){if(this.m_dObj[a].m_parent==this.m_dObj[b]){this.m_dObj[a].m_parent=this.m_dObj[b].m_parent}}}this.m_dObj.splice(b,1);b--}}};ThePort.Layout.Manager.prototype.IsWidgetLockedByObjectID=function(a){for(var b=0;b<this.m_dObj.length;b++){if(this.m_dObj[b].m_oWidgetObject!=null){if(this.m_dObj[b].m_sWidgetObjectID==a){return this.m_dObj[b].IsLocked()}}}return false};ThePort.Layout.Manager.prototype.resizeModules=function(){for(var a=0;a<this.m_dObj.length;a++){this.m_dObj[a].forceResize()}};ThePort.Layout.Manager.prototype.findModuleIdx=function(a){for(var b=0;b<this.m_dObj.length;b++){if(this.m_dObj[b].m_sID==a){return b}}return -1};ThePort.Layout.Manager.prototype.resetGroupItems=function(){var a=0;while(a<this.m_dObj.length){if(this.m_dObj[a].getType()=="group"){this.m_dObj[a].resetAllItems()}a++}};ThePort.Layout.Manager.prototype.SetLayoutXMLCallBack=function(a){this.m_oFnXMLCallback=a};ThePort.Layout.Manager.prototype.GetGenericInsertWeight=function(b){try{var c;for(c=0;c<this.colObj[b].childNodes.length;c++){if(this.colObj[b].childNodes[c].tagName=="DIV"){var a=this.GetWidgetIDByObjectID(this.colObj[b].childNodes[c].id);if(this.m_dObj[a].IsLocked()==false){return c}}}return c}catch(d){return false}};ThePort.Layout.Manager.prototype.IsLockable=function(b){try{var f;var d=new Array();iWidgetIdx=this.findModuleIdx(b);var c=this.m_dObj[iWidgetIdx].GetWidgetColumn();count=this.colObj[c].childNodes.length;for(f=0;f<count;f++){if(this.colObj[c].childNodes[f].tagName=="DIV"){var a=this.GetWidgetIDByObjectID(this.colObj[c].childNodes[f].id);d.push(a)}}f=0;while(f<d.length&&d[f]!=iWidgetIdx){f++}if(f==0){return true}return this.m_dObj[d[f-1]].IsLocked()}catch(g){return false}};ThePort.Layout.Manager.prototype.GetWidgetIDByObjectID=function(a){for(var b=0;b<this.m_dObj.length;b++){if(this.m_dObj[b].m_oWidgetObject!=null){if(this.m_dObj[b].m_sWidgetObjectID==a){return b}}}return -1};ThePort.Layout.Manager.prototype.IsUnLockable=function(b){try{var f;var d=new Array();iWidgetIdx=this.findModuleIdx(b);var c=this.m_dObj[iWidgetIdx].GetWidgetColumn();count=this.colObj[c].childNodes.length;for(f=0;f<count;f++){if(this.colObj[c].childNodes[f].tagName=="DIV"){var a=this.GetWidgetIDByObjectID(this.colObj[c].childNodes[f].id);d.push(a)}}f=0;while(f<d.length&&d[f]!=iWidgetIdx){f++}if(f==d.length-1){return true}return !this.m_dObj[d[f+1]].IsLocked()}catch(g){return false}};ThePort.Layout.Manager.prototype.serializeState=function(){var c,b,a;this.collectGarbage();if((!this.m_saveSupport)||(!this.m_oFnXMLCallback)){return}try{xml=new ThePort.XML.Writer();xml.BeginNode("ManagerLayout");xml.Attrib("ColumnMode",this.m_columnMode.toString());for(c=0;c<this.colObj.length;c++){for(b=0;b<this.colObj[c].childNodes.length;b++){a=this.getNodeObjectIndex(this.colObj[c].childNodes[b]);if(a>=0){this.m_dObj[a].SetWidgetWeight(b);xml.BeginNode("Widget");xml.Attrib("ID",this.m_dObj[a].m_sID);xml.Attrib("Data",this.m_dObj[a].GetDictionary().ToCSV());xml.EndNode()}}}xml.EndNode()}catch(f){return false}var d=xml.ToString();if(this.m_prevSerializedData==d){return}this.m_prevSerializedData=d;if(this.m_oFnXMLCallback!=null){this.m_oFnXMLCallback(d)}};ThePort.Layout.Manager.prototype.getNodeObjectIndex=function(b){for(var a=0;a<this.m_dObj.length;a++){if(b==this.m_dObj[a].m_oWidgetObject){return a}}return -1};ThePort.Layout.Manager.prototype.getNodeAttr=function(b,a){try{for(l=0;l<b.attributes.length;l++){if(b.attributes[l].nodeName==a){return(b.attributes[l].nodeValue)}}}catch(c){return null}return null};ThePort.Layout.Manager.prototype.refreshColumnsLocations=function(){this.colX=new Array();this.colY=new Array();for(var a=0;a<this.colObj.length;a++){this.colX.push(findPosX(this.colObj[a]));this.colY.push(findPosY(this.colObj[a]))}};ThePort.Layout.Manager.prototype.refreshRowHeightLocations=function(b){this.rowH=new Array();this.itemH=new Array();this.isLocked=new Array();count=this.colObj[b].childNodes.length;for(var a=0;a<count;a++){if(this.colObj[b].childNodes[a].tagName=="DIV"){if(this.colObj[b].childNodes[a].id=="dockingInsertPlaceHolder"){a++}else{this.rowH.push(this.findPosY(this.colObj[b].childNodes[a]));this.itemH.push(this.colObj[b].childNodes[a].offsetHeight);this.isLocked.push(this.IsWidgetLockedByObjectID(this.colObj[b].childNodes[a].id))}}}};ThePort.Layout.Manager.prototype.resolveColumnIdx=function(b){x=parseInt(b.style.left)+(b.offsetWidth/2);for(var a=1;a<this.colX.length;a++){if(x<=this.colX[a]){return a-1}}return(this.colX.length-1)};ThePort.Layout.Manager.prototype.resolveRowIdx=function(b){var c=parseInt(b.style.top);var a=0;while(this.rowH[a]<c&&a<this.rowH.length){a++}if(a>this.rowH.length){a=this.rowH.length-1}while(a<this.rowH.length&&this.isLocked[a]){a++}return a};ThePort.Layout.Manager.prototype.loadModule=function(a,b,c){try{ThePort.Debug.Log("addModule where sID='"+a+"' sDictCSV= '"+b+"' sContent= '"+c+"'.");this.addModule(a,b,this.m_oLayoutNode,c)}catch(d){ThePort.Debug.LogExx(d)}};ThePort.Layout.Manager.prototype.addModule=function(a,s,c,p){var g=ThePort.Utils.Bind(this,"collectGarbage()");var y=ThePort.Utils.Bind(this,"serializeState");var u=ThePort.Utils.Bind(this,"IsLockable");var h=ThePort.Utils.Bind(this,"IsUnLockable");var o=new ThePort.Layout.Widget(a,s,this.m_iAdminMode,g,y,u,h);var v=o.GetWidgetColumn();var n=null;var f;if(v<0){f=c}else{if(v>=this.colObj.length){v=this.colObj.length-1}f=this.colObj[v]}try{var d=o.GetWidgetWeight();var m=this.GetGenericInsertWeight(v);if(d<m){d=m-1;o.SetWidgetWeight(d)}var r=0;if(v>=0){while((r<f.childNodes.length)&&(n==null)){var q=this.getNodeObjectIndex(f.childNodes[r]);if(q>=0){if(this.m_dObj[q].GetWidgetWeight()>d){n=f.childNodes[r]}}r++}}}catch(w){return false}o.onInitialize(f,n,p);if(this.draggable){var b=o.m_oWidgetTitleBar;Drag.init(this,o,b,o.m_oWidgetObject);o.m_oWidgetObject.onDragStart=function(j,z,e,A){if(z.IsLocked()){return}};o.m_oWidgetObject.onDrag=function(G,B,L,K,O,M){try{if(B.IsLocked()){return}if(document.selection){document.selection.empty()}else{if(window.getSelection){window.getSelection().removeAllRanges()}}if(B.m_dragInProgress==false){B.m_dragInProgress=true;if(G.m_fnModuleEvent){G.m_fnModuleEvent(L,K,"dragstart",G.m_sID)}B.m_dragCol=-1;B.m_dragRow=-1;G.loadScreenVariables();var H=0;var N=0;while(N<G.colObj.length&&B.m_dragCol<0){H=0;while(H<G.colObj[N].childNodes.length&&B.m_dragCol<0){if(G.colObj[N].childNodes[H]==B.m_oWidgetObject){B.m_dragCol=N}H++}N++}G.refreshRowHeightLocations(B.m_dragCol);if(ThePort.Utils.IsIE()){var A=0;var C=G.colObj[B.m_dragCol].childNodes.length;for(var E=0;E<G.colObj[B.m_dragCol].childNodes.length;E++){if(G.colObj[B.m_dragCol].childNodes[E]==B.m_oWidgetObject){A=E}}}if(B.onDragStart(B.m_dragCol,G.resolveRowIdx(B.m_oWidgetObject))==false){B.m_dragCol=-1;B.m_dragRow=-1;return}G.m_oLayoutNode.style.height=(G.m_oLayoutNode.offsetHeight+B.m_oWidgetObject.offsetHeight)+"px";for(var z=0;z<G.colObj.length;z++){G.colObj[z].style.height=(G.colObj[z].offsetHeight+B.m_oWidgetObject.offsetHeight)+"px"}if(document.all){B.m_oWidgetObject.style.width=B.m_oWidgetObject.offsetWidth+"px"}else{B.m_oWidgetObject.style.width=B.m_oWidgetObject.offsetWidth-3+"px"}B.m_oWidgetObject.style.left=findPosX(B.m_oWidgetObject)-3+"px";B.m_oWidgetObject.style.top=findPosY(B.m_oWidgetObject)-5+"px";B.m_oWidgetObject.style.zIndex=1;G.refreshColumnsLocations();if(B.m_dragCol!=-1&&G.insertDiv!=null){G.colObj[B.m_dragCol].removeChild(G.insertDiv)}G.insertDiv=document.createElement("div");G.insertDiv.id="dockingInsertPlaceHolder";if(document.all){G.insertDiv.style.width=B.m_oWidgetObject.style.width;G.insertDiv.style.height=B.m_oWidgetObject.offsetHeight+"px"}else{G.insertDiv.style.width=B.m_oWidgetObject.style.width-2+"px";G.insertDiv.style.height=B.m_oWidgetObject.offsetHeight-2+"px"}G.insertDiv.className="widgetShadowBox";G.colObj[B.m_dragCol].insertBefore(G.insertDiv,B.m_oWidgetObject);B.m_oWidgetObject.style.position="absolute";G.columnInsertIdx=B.m_dragCol;G.refreshRowHeightLocations(B.m_dragCol);B.m_dragRow=G.resolveRowIdx(B.m_oWidgetObject);return}var J;if(G.m_fnModuleEvent){J=G.m_fnModuleEvent(O,K,"drag",G.m_sID);if(J>=0){ThePort.Utils.Hide(G.insertDiv);return}}ThePort.Utils.Show(G.insertDiv);B.onDragging();G.columnInsertIdx=G.resolveColumnIdx(B.m_oWidgetObject);if(G.columnInsertIdx!=B.m_dragCol){G.refreshRowHeightLocations(G.columnInsertIdx)}G.rowInsertIdx=G.resolveRowIdx(B.m_oWidgetObject);try{if(G.rowInsertIdx==0){var P=G.getNodeObjectIndex(G.colObj[G.columnInsertIdx].childNodes[0])}if((P>=0)&&(G.m_dObj[P].IsLocked()==true)){return}}catch(I){}if((G.m_dragMaxRowIdx>=0)&&(G.rowInsertIdx>G.m_dragMaxRowIdx)){return}if((G.columnInsertIdx!=B.m_dragCol)||(G.rowInsertIdx!=B.m_dragRow)){if(G.m_dragReplaceType=="add"){G.colObj[B.m_dragCol].removeChild(G.insertDiv);G.colObj[B.m_dragCol].removeChild(B.m_oWidgetObject);var F=G.colObj[G.columnInsertIdx].offsetWidth;G.insertDiv.style.width=(F-6)+"px";if(G.rowInsertIdx<G.rowH.length){G.colObj[G.columnInsertIdx].insertBefore(G.insertDiv,G.colObj[G.columnInsertIdx].childNodes[G.rowInsertIdx])}else{G.colObj[G.columnInsertIdx].appendChild(G.insertDiv)}G.colObj[G.columnInsertIdx].insertBefore(B.m_oWidgetObject,G.insertDiv.nextSibling);B.m_dragCol=G.columnInsertIdx;B.m_dragRow=G.rowInsertIdx;G.refreshRowHeightLocations(G.columnInsertIdx)}else{if(G.m_dragReplaceType=="swap"){G.colObj[B.m_dragCol].removeChild(B.m_oWidgetObject);if(G.rowH.length<=0){G.colObj[B.m_dragCol].removeChild(G.insertDiv);G.colObj[G.columnInsertIdx].appendChild(G.insertDiv)}else{if(G.rowInsertIdx<G.rowH.length){var D=G.colObj[G.columnInsertIdx].replaceChild(G.insertDiv,G.colObj[G.columnInsertIdx].childNodes[G.rowInsertIdx]);G.colObj[B.m_dragCol].appendChild(G.insertDiv)}}G.colObj[G.columnInsertIdx].insertBefore(B.m_oWidgetObject,G.insertDiv.nextSibling);B.m_dragCol=G.columnInsertIdx;B.m_dragRow=G.rowInsertIdx;G.refreshRowHeightLocations(G.columnInsertIdx)}}}}catch(I){}};o.m_oWidgetObject.onDragEnd=function(A,B,j,C){if(B.IsLocked()){return}if(B.m_dragInProgress){B.m_dragInProgress=false}else{return}if(A.m_fnModuleEvent){var e=A.m_fnModuleEvent(0,0,"mouseup",A.m_sID);if(e>=0){if(A.m_fnModuleMove){B.onClose();A.m_fnModuleMove(e,B,A.m_sID)}if(A.insertDiv!=null){A.colObj[A.columnInsertIdx].removeChild(A.insertDiv)}A.insertDiv=null;A.m_oLayoutNode.style.height=ThePort.Common.CONST_EMPTY_STRING;A.serializeState();return}}A.columnInsertIdx=A.resolveColumnIdx(B.m_oWidgetObject);B.SetWidgetColumn(A.columnInsertIdx);if(A.insertDiv!=null){A.colObj[A.columnInsertIdx].removeChild(A.insertDiv)}A.insertDiv=null;B.m_oWidgetObject.style.width=ThePort.Common.CONST_EMPTY_STRING;B.m_oWidgetObject.style.left=0;B.m_oWidgetObject.style.top=0;B.m_oWidgetObject.style.position=ThePort.Common.CONST_EMPTY_STRING;B.m_oWidgetObject.style.zIndex=0;B.onDragEnd(B.m_dragCol,B.m_dragRow);B.m_dragCol=-1;B.m_dragRow=-1;A.serializeState();A.m_oLayoutNode.style.height="";for(var z=0;z<A.colObj.length;z++){A.colObj[z].style.height=""}}}this.idx++;if(this.idx>=this.colObj.length){this.idx=0}this.m_dObj.push(o);if(this.bSerializeOnEveryWidgetLoad){this.serializeState()}};function findPosX(a){var b=0;if(a.offsetParent){while(a.offsetParent){b+=a.offsetLeft;a=a.offsetParent}}else{if(a.x){b+=a.x}}return b}function findPosY(b){var a=0;if(b.offsetParent){while(b.offsetParent){a+=b.offsetTop;b=b.offsetParent}}else{if(b.y){a+=b.y}}return a}ThePort.Layout.Manager.prototype.loadScreenVariables=function(){this.getClientArea();this.getScrollPos()};ThePort.Layout.Manager.prototype.getClientArea=function(){var b=0,a=0;if(typeof(window.innerWidth)=="number"){b=window.innerWidth;a=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){b=document.documentElement.clientWidth;a=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){b=document.body.clientWidth;a=document.body.clientHeight}}}this.m_windowWidth=b;this.m_windowHeight=a};ThePort.Layout.Manager.prototype.getScrollPos=function(){var b=0,a=0;if(typeof(window.pageYOffset)=="number"){a=window.pageYOffset;b=window.pageXOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){a=document.body.scrollTop;b=document.body.scrollLeft}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){a=document.documentElement.scrollTop;b=document.documentElement.scrollLeft}}}this.m_scrollPosX=b;this.m_scrollPosY=a};if(ThePortRegisterNS("ThePort.Layout.Manager.Array")){ThePort.Layout.Manager.Array=new Array()}if(ThePortRegisterNS("ThePort.Layout.Manager.Utils")){ThePort.Layout.Manager.Utils={GetManagerPointer:function(a){try{if(typeof ThePort.Layout.Manager.Array==ThePort.Common.CONST_UNDEFINED){return null}for(var b=0;b<ThePort.Layout.Manager.Array.length;b++){if(ThePort.Layout.Manager.Array[b].m_sID==a){return ThePort.Layout.Manager.Array[b]}}ThePort.Debug.Log("ERROR::ThePort.Layout.Manager.Utils.GetManagerPointer('"+a+"') Unable to find Manager.")}catch(c){ThePort.Debug.LogExx(c)}return null},AddWidgetToLayout:function(f,c,a,b){try{ThePort.Debug.Log("Attempting to Add Widget to Layout.");oLOM=ThePort.Layout.Manager.Utils.GetManagerPointer(f);if(oLOM){ThePort.Debug.Log("Adding widget '"+c+"' to Manager Layout '"+f+"'.");ThePort.Debug.Log("Widget layout="+f+" has been found and now injecting widget into Layout.");oLOM.loadModule(c,a,b)}else{ThePort.Debug.Log("ERROR::Cannot add widget '"+c+"' to Manager Layout '"+f+"'.")}}catch(d){ThePort.Debug.LogExx(d)}return},SetLayoutXMLCallback:function(c,a){try{oLOM=ThePort.Layout.Manager.Utils.GetManagerPointer(c);if(oLOM){oLOM.SetLayoutXMLCallBack(a)}else{ThePort.Debug.Log("ERROR::Cannot add widget '"+sWidgetID+"' to Manager Layout '"+c+"'.")}}catch(b){ThePort.Debug.LogExx(b)}return},AddWidgetDictionaryToLayout:function(f,b){try{ThePort.Debug.Log("Call to AddWidgetDictionaryToLayout('"+f+"','"+b+"');");var c="/APIs/Services/XSL/Process.ashx?sLayoutConstant="+f+"&iAddWidgetDictionaryToLayout=1";var a=new ThePort.Dictionary(b);a.RemoveDictionaryKey(ThePort.Common.QS_MODULEID);sPostData=ThePort.Utils.GetVariablePair(ThePort.Common.QS_DATA,a.ToCSV());ThePort.Debug.Log("Making AJAX call for Widget content...");ThePort.XSL.AjaxPost(c,sPostData,ThePort.Layout.Manager.Utils.OnAddWidgetResponse)}catch(d){ThePort.Debug.LogExx(d)}},SetLayoutColumnMode:function(c,b){try{oLOM=ThePort.Layout.Manager.Utils.GetManagerPointer(c);if(oLOM){oLOM.SetColumnMode(b);return oLOM.m_columnMode}}catch(a){ThePort.Debug.LogExx(a)}},SerializeOnEveryWidgetLoad:function(c,a){try{oLOM=ThePort.Layout.Manager.Utils.GetManagerPointer(c);if(oLOM){oLOM.SerializeOnEveryWidgetLoad(a)}}catch(b){ThePort.Debug.LogExx(b)}},OnAddWidgetResponse:function(b){try{var a=new ThePort.ReplyObject(b.responseXML);if(a.Response=="true"){ThePort.Debug.Log("Widget Response AJAX call has returned TRUE, the content may have errors, but the round trip was good.");ThePort.Utils.AddScriptTags(a.Data);return}ThePort.Debug.Log("Error in Widget Response AJAX call and has returned FALSE.")}catch(c){ThePort.Debug.LogExx(c)}}}}if(ThePortRegisterNS("ThePort.Layout.Widget")){ThePort.Layout.Widget=function(b,c,f,a,e,d,g){this.m_sID=b;this.m_oDict=new ThePort.Dictionary(c);this.m_oDict.RemoveDictionaryKey("WidgetDraggable");this.m_oDict.RemoveDictionaryKey("WidgetTitleBarVisible");this.m_iAdminMode=f;this.m_iWidgetMode=this.m_oDict.GetDictionaryKey(ThePort.Common.CONST_WIDGET_TYPE);this.m_fnCleanup=a;this.m_fnSerialize=e;this.m_fnLockable=d;this.m_fnUnLockable=g;this.m_sWidgetObjectID=b+"widgetObject";this.m_oWidgetObject=null;this.m_dragInProgress=false;this.m_sOriginalTitle=ThePort.Common.CONST_EMPTY_STRING;this.m_sOriginalColorClass=ThePort.Common.CONST_EMPTY_STRING;this.m_iFrameWatcher=null;this.m_IE=ThePort.Utils.IsIE();this.m_dragging=false};ThePort.Layout.Widget.prototype.onDragStart=function(b,a){return(this._onDragStart(b,a))};ThePort.Layout.Widget.prototype._onDragStart=function(b,a){return true};ThePort.Layout.Widget.prototype.onDragging=function(){this._onDragging()};ThePort.Layout.Widget.prototype.onDragEnd=function(b,a){this._onDragEnd(b,a)};ThePort.Layout.Widget.prototype.IsLocked=function(){return ThePort.Utils.StringToBoolean(this.GetDictionaryKey(ThePort.Common.CONST_WIDGET_LOCKED))};ThePort.Layout.Widget.prototype.IsCloseable=function(){return ThePort.Utils.StringToBoolean(this.GetDictionaryKey(ThePort.Common.CONST_WIDGET_REMOVABLE))};ThePort.Layout.Widget.prototype.GetWidgetWeight=function(){return ThePort.Utils.GetInt(this.GetDictionaryKey(ThePort.Common.CONST_WIDGET_WEIGHT),-1)};ThePort.Layout.Widget.prototype.SetWidgetWeight=function(a){this.PutDictionaryKey(ThePort.Common.CONST_WIDGET_WEIGHT,a.toString())};ThePort.Layout.Widget.prototype.GetWidgetColumn=function(){return ThePort.Utils.GetInt(this.GetDictionaryKey(ThePort.Common.CONST_WIDGET_COLUMN))};ThePort.Layout.Widget.prototype.SetWidgetColumn=function(a){this.PutDictionaryKey(ThePort.Common.CONST_WIDGET_COLUMN,a.toString())};ThePort.Layout.Widget.prototype.GetWidgetMinMax=function(){return ThePort.Utils.GetInt(this.GetDictionaryKey(ThePort.Common.CONST_WIDGET_MINMAX))};ThePort.Layout.Widget.prototype.SetWidgetMinMax=function(a){this.PutDictionaryKey(ThePort.Common.CONST_WIDGET_MINMAX,a.toString())};ThePort.Layout.Widget.prototype.onInitialize=function(b,a,c){this.m_oWidgetObject=document.createElement("div");this.m_oWidgetObject.id=this.m_sWidgetObjectID;this.m_oWidgetObject.className="widgetObject";if(b!=null){if(a!=null){b.insertBefore(this.m_oWidgetObject,a)}else{b.appendChild(this.m_oWidgetObject)}}if(this.m_iWidgetMode==ThePort.Common.CONST_WIDGET_TYPE_IFRAME){this.m_oWidgetObject.innerHTML=c;this.BuildIFrame(this.findChildId("widgetContent"),this.m_oDict.GetDictionaryKey(ThePort.Common.QS_IFRAMEURL))}else{ThePort.Utils.LoadHTMLIntoNode(this.m_oWidgetObject,c)}if(this.m_iAdminMode==1){ThePort.Utils.Show(this.findChildId("widgetTitleBar"))}this.InitializeUIEnvelope();this.m_oWidgetTitleBar=this.findChildId("widgetTitleBar");this.SetWidgetAdminExport(this.GetDictionaryKey(ThePort.Common.CONST_WIDGET_EXPORTABLE));this.SetWidgetAdminLocked(this.GetDictionaryKey(ThePort.Common.CONST_WIDGET_LOCKED));this.SetWidgetAdminTitleBarVisibility(this.GetDictionaryKey(ThePort.Common.CONST_WIDGET_TITLEHIDDEN))};ThePort.Layout.Widget.prototype.Close=function(){try{if(this.m_oWidgetObject==null){return}if(this.m_iFrameWatcher){this.m_iFrameWatcher.clearInterval();this.m_iFrameWatcher=null}var a=this.m_oWidgetObject.parentNode;a.removeChild(this.m_oWidgetObject);this.m_oWidgetObject=null;if(this.fnCleanup){this.fnCleanup()}if(this.m_fnSerialize){this.m_fnSerialize()}}catch(b){}};ThePort.Layout.Widget.prototype.findChildId=function(a){return ThePort.Utils.GetObj(this.m_sID+a)};ThePort.Layout.Widget.prototype.WidgetConfigEditButtonHandler=function(){var c=this.m_sID;if(ThePort.Utils.IsVisible(this.findChildId("widgetEditPanel"))){return this.CancelButtonHandler()}var h=this.findChildId("widgetAdminLocked_cb");if(!this.IsLocked()){if(this.m_fnLockable(this.m_sID)){ThePort.Utils.Show(h);var b=this.findChildId("widgetAdminLockedMessage");if(b){b.innerHTML=" Lock Widget"}}else{ThePort.Utils.Hide(h);var b=this.findChildId("widgetAdminLockedMessage");if(b){b.innerHTML="Widget may not be locked."}}}else{if(this.m_fnUnLockable(this.m_sID)){ThePort.Utils.Show(h);var b=this.findChildId("widgetAdminLockedMessage");if(b){b.innerHTML=" Lock Widget"}}else{ThePort.Utils.Hide(h);var b=this.findChildId("widgetAdminLockedMessage");if(b){b.innerHTML="Widget may not be unlocked."}}}var d=this.findChildId("widgetConfigTitleTxt");var g=this.findChildId("widgetTitleBarText");this.m_sOriginalTitle=g.innerHTML;this.m_sOriginalColorClass=this.findChildId("widgetTitleBar").className;if((d!=null)&&(g!=null)){var a=new String(g.innerHTML);try{a.replace(a,"\n"," ");a=a.trim()}catch(f){}d.value=a}ThePort.Utils.Show(this.findChildId("widgetEditPanel"));if(this.m_fnSerialize){this.m_fnSerialize()}};ThePort.Layout.Widget.prototype.SetWidgetTitle=function(a){var b=this.findChildId("widgetTitleBarText");if(b){b.innerHTML=a}};ThePort.Layout.Widget.prototype.GetWidgetTitle=function(){var a=this.findChildId("widgetTitleBarText");if(a){return a.innerHTML}};ThePort.Layout.Widget.prototype.NameChangeHandler=function(b){var a=this.findChildId("widgetConfigTitleTxt");this.SetWidgetTitle(a.value)};ThePort.Layout.Widget.prototype.CancelButtonHandler=function(){var a=this.m_sID;this.findChildId("widgetTitleBarText").innerHTML=this.m_sOriginalTitle;ThePort.Utils.SetNodeClassName(this.findChildId("widgetTitleBar"),this.m_sOriginalColorClass);ThePort.Utils.Hide(this.findChildId("widgetEditPanel"));if(this.m_fnSerialize){this.m_fnSerialize()}};ThePort.Layout.Widget.prototype.WidgetCloseSaveButtonHandler=function(){if(!confirm("Are you sure you want to delete?\n\nClick OK to continue or Cancel to abort.")){return}this.Close()};ThePort.Layout.Widget.prototype.SetTitleBarClassName=function(a){if((a)&&(a!=ThePort.Common.CONST_EMPTY_STRING)){ThePort.Utils.SetClassName(this.findChildId("widgetTitleBar"),a)}};ThePort.Layout.Widget.prototype.GetTitleBarClassName=function(){return ThePort.Utils.GetClassName(this.findChildId("widgetTitleBar"))};ThePort.Layout.Widget.prototype.WidgetConfigSaveButtonHandler=function(){this.PutDictionaryKey(ThePort.Common.CONST_WIDGET_TITLE_TEXT,this.GetWidgetTitle());this.PutDictionaryKey(ThePort.Common.CONST_WIDGET_TITLE_CLASS,this.GetTitleBarClassName());ThePort.Utils.Hide(this.findChildId("widgetEditPanel"));if(this.m_fnSerialize){this.m_fnSerialize()}};ThePort.Layout.Widget.prototype.ShowConfigTab=function(){ThePort.Utils.ShowNode(this.findChildId("widgetTabAreaConfig"));ThePort.Utils.HideNode(this.findChildId("widgetTabAreaAdmin"));ThePort.Utils.SetClassName(this.findChildId("widgetEditPanelAdminTab"),"");ThePort.Utils.SetClassName(this.findChildId("widgetEditPanelConfigTab"),"current")};ThePort.Layout.Widget.prototype.ShowExportTab=function(){ThePort.Utils.HideNode(this.findChildId("widgetTabAreaConfig"));ThePort.Utils.HideNode(this.findChildId("widgetTabAreaAdmin"))};ThePort.Layout.Widget.prototype.ShowAdminTab=function(){ThePort.Utils.ShowNode(this.findChildId("widgetTabAreaAdmin"));ThePort.Utils.HideNode(this.findChildId("widgetTabAreaConfig"));ThePort.Utils.SetClassName(this.findChildId("widgetEditPanelAdminTab"),"current");ThePort.Utils.SetClassName(this.findChildId("widgetEditPanelConfigTab"),"")};ThePort.Layout.Widget.prototype.GetDictionary=function(){if(this.m_iWidgetMode==ThePort.Common.CONST_WIDGET_TYPE_IFRAME){return this.m_oDict}return this.m_oDict};ThePort.Layout.Widget.prototype.GetDictionaryKey=function(a){return this.GetDictionary().GetDictionaryKey(a)};ThePort.Layout.Widget.prototype.PutDictionaryKey=function(a,b){return this.GetDictionary().PutDictionaryKey(a,b)};ThePort.Layout.Widget.prototype.WidgetAdminExportButtonHandler=function(a){this.HandleCheckBox(ThePort.Common.CONST_WIDGET_EXPORTABLE,a)};ThePort.Layout.Widget.prototype.WidgetAdminDragButtonHandler=function(a){this.HandleCheckBox(ThePort.Common.CONST_WIDGET_LOCKED,a);this.SetWidgetAdminLocked(this.GetDictionaryKey(ThePort.Common.CONST_WIDGET_LOCKED))};ThePort.Layout.Widget.prototype.WidgetAdminTitleBarVisibleHandler=function(a){this.HandleCheckBox(ThePort.Common.CONST_WIDGET_TITLEHIDDEN,a);this.SetWidgetAdminTitleBarVisibility(this.GetDictionaryKey(ThePort.Common.CONST_WIDGET_TITLEHIDDEN))};ThePort.Layout.Widget.prototype.WidgetAdminRemoveButtonHandler=function(a){this.HandleCheckBox(ThePort.Common.CONST_WIDGET_REMOVABLE,a);if(!this.IsCloseable()){ThePort.Utils.Hide(this.findChildId("widgetTitleBarCloseBtn"))}else{ThePort.Utils.Show(this.findChildId("widgetTitleBarCloseBtn"))}};ThePort.Layout.Widget.prototype.HandleCheckBox=function(b,a){var c=a||window.event;if(window.event){el=c.srcElement}else{el=c.currentTarget}return this.PutDictionaryKey(b,el.checked.toString())};ThePort.Layout.Widget.prototype.SetWidgetAdminExport=function(b){var a=ThePort.Utils.StringToBoolean(b,false);if(this.findChildId("widgetAdminExport_cb")){this.findChildId("widgetAdminExport_cb").checked=a}};ThePort.Layout.Widget.prototype.SetWidgetAdminLocked=function(b){var a=ThePort.Utils.StringToBoolean(b,false);if(this.findChildId("widgetAdminLocked_cb")){this.findChildId("widgetAdminLocked_cb").checked=a}this.PutDictionaryKey(ThePort.Common.CONST_WIDGET_LOCKED,ThePort.Utils.BooleanToString(a));if(a){ThePort.Utils.Show(this.findChildId("widgetTitleBarLockImg"));this.findChildId("widgetTitleBar").style.cursor="default"}else{ThePort.Utils.Hide(this.findChildId("widgetTitleBarLockImg"));this.findChildId("widgetTitleBar").style.cursor="move"}};ThePort.Layout.Widget.prototype.SetWidgetAdminTitleBarVisibility=function(b){var a=ThePort.Utils.StringToBoolean(b,false);if(this.findChildId("widgetAdminTitleBarVisible_cb")){this.findChildId("widgetAdminTitleBarVisible_cb").checked=a}this.PutDictionaryKey(ThePort.Common.CONST_WIDGET_TITLEHIDDEN,ThePort.Utils.BooleanToString(a));if(a){ThePort.Utils.SetNodeClassName(this.findChildId("widgetTitleHiddenImg"),"WidgetTitleHide")}else{ThePort.Utils.SetNodeClassName(this.findChildId("widgetTitleHiddenImg"),"WidgetTitleShow")}};ThePort.Layout.Widget.prototype.SetWidgetAdminRemove=function(b){var a=ThePort.Utils.StringToBoolean(b,true);if(this.findChildId("widgetAdminRemovable_cb")){this.findChildId("widgetAdminRemovable_cb").checked=a}this.PutDictionaryKey(ThePort.Common.CONST_WIDGET_REMOVABLE,ThePort.Utils.BooleanToString(a))};ThePort.Layout.Widget.prototype.InitializeUIEnvelope=function(){if(!this.findChildId("widgetTitleBarEditBtn")){return}ThePort.Event.AddHandler(this.findChildId("widgetTitleBarEditBtn"),"click",ThePort.Utils.Bind(this,"WidgetConfigEditButtonHandler"));ThePort.Event.AddHandler(this.findChildId("widgetEditPanelConfigTab"),"click",ThePort.Utils.Bind(this,"ShowConfigTab"));ThePort.Event.AddHandler(this.findChildId("widgetEditPanelExportTab"),"click",ThePort.Utils.Bind(this,"ShowExportTab"));ThePort.Event.AddHandler(this.findChildId("widgetEditPanelAdminTab"),"click",ThePort.Utils.Bind(this,"ShowAdminTab"));ThePort.Event.AddHandler(this.findChildId("widgetConfigTitleTxt"),"keyup",ThePort.Utils.Bind(this,"NameChangeHandler"));ThePort.Event.AddHandler(this.findChildId("widgetConfigTitleTxt"),"keydown",function(b){var a=b||window.event;if(ThePort.Event.GetEventKeyCode(a)==13){a.returnValue=false;ThePort.Event.StopEvent(a)}});ThePort.Event.AddHandler(this.findChildId("widgetConfigBtnCancel"),"click",ThePort.Utils.Binder(this,"CancelButtonHandler"));ThePort.Event.AddHandler(this.findChildId("widgetTitleBarColor1"),"click",ThePort.Utils.BinderNP(this,"SetTitleBarClassName","widgetTitleBarColor1"));ThePort.Event.AddHandler(this.findChildId("widgetTitleBarColor2"),"click",ThePort.Utils.BinderNP(this,"SetTitleBarClassName","widgetTitleBarColor2"));ThePort.Event.AddHandler(this.findChildId("widgetTitleBarColor3"),"click",ThePort.Utils.BinderNP(this,"SetTitleBarClassName","widgetTitleBarColor3"));ThePort.Event.AddHandler(this.findChildId("widgetTitleBarColor4"),"click",ThePort.Utils.BinderNP(this,"SetTitleBarClassName","widgetTitleBarColor4"));ThePort.Event.AddHandler(this.findChildId("widgetTitleBarColor5"),"click",ThePort.Utils.BinderNP(this,"SetTitleBarClassName","widgetTitleBarColor5"));ThePort.Event.AddHandler(this.findChildId("widgetTitleBarColor6"),"click",ThePort.Utils.BinderNP(this,"SetTitleBarClassName","widgetTitleBarColor6"));ThePort.Event.AddHandler(this.findChildId("widgetConfigBtnSave"),"click",ThePort.Utils.Bind(this,"WidgetConfigSaveButtonHandler"));ThePort.Event.AddHandler(this.findChildId("widgetTitleBarCloseBtn"),"click",ThePort.Utils.Bind(this,"WidgetCloseSaveButtonHandler"));ThePort.Event.AddHandler(this.findChildId("widgetAdminExport_cb"),"click",ThePort.Utils.Bind(this,"WidgetAdminExportButtonHandler"));ThePort.Event.AddHandler(this.findChildId("widgetAdminLocked_cb"),"click",ThePort.Utils.Bind(this,"WidgetAdminDragButtonHandler"));ThePort.Event.AddHandler(this.findChildId("widgetAdminTitleBarVisible_cb"),"click",ThePort.Utils.Bind(this,"WidgetAdminTitleBarVisibleHandler"));ThePort.Event.AddHandler(this.findChildId("widgetAdminRemovable_cb"),"click",ThePort.Utils.Bind(this,"WidgetAdminRemoveButtonHandler"));ThePort.Event.AddHandler(this.findChildId("widgetAdminCancel_btn"),"click",ThePort.Utils.Bind(this,"WidgetCloseSaveButtonHandler"));ThePort.Event.AddHandler(this.findChildId("widgetAdminSave_btn"),"click",ThePort.Utils.Bind(this,"WidgetConfigSaveButtonHandler"))};ThePort.Layout.Widget.prototype.BuildIFrame=function(e,c){var d=" ";var b=this.m_sID+"iframe";var a=this.m_sID+"divWrapper";d+="<div id='"+a+"' ";d+="style='DISPLAY:block;z-index:0;position:relative;left:0px;top:0px;clear:both'";d+=" > ";d+="</div>";d+="<iframe ";d+=" id='"+b+"' ";d+="style='DISPLAY:block;z-index:0;";d+=" border='0' ";d+=" frameborder='0' ";d+=" frameborder='no' ";d+=" scrolling='no' ";d+=" hidefocus='true' ";d+=" src='"+c+"' ";d+=" width='100%' ";d+=" height='15' ";d+=" > ";d+=" </iframe> ";e.style.height=ThePort.Common.CONST_EMPTY_STRING;ThePort.Utils.LoadHTMLIntoNode(e,d);if(this.m_iFrameWatcher){this.m_iFrameWatcher.clearInterval();this.m_iFrameWatcher=null}var e=this.findChildId("iframe");if(e){this.m_iFrameWatcher=new ThePort.Utils.SizeChecker(e);this.m_iFrameWatcher.setInterval(500)}};ThePort.Layout.Widget.prototype._onDragging=function(){var a=0;if(this.m_iWidgetMode!=ThePort.Common.CONST_WIDGET_TYPE_IFRAME){return}try{if(!this.m_dragging){if(this.m_iFrameWatcher){a=this.m_iFrameWatcher.m_lastHeight;this.m_iFrameWatcher.clearInterval();this.m_iFrameWatcher=null}var c=this.findChildId("divWrapper");if(!this.m_IE){ThePort.Utils.LoadHTMLIntoNode(this.findChildId("widgetContent"),"");this.findChildId("widgetContent").style.height=a+"px"}else{if(c){c.style.height="15px"}}this.m_dragging=true}}catch(b){}};ThePort.Layout.Widget.prototype._onDragEnd=function(b,a){var c;if((this.m_iWidgetMode!=ThePort.Common.CONST_WIDGET_TYPE_IFRAME)||(!this.m_dragging)){return}this.m_dragging=false;if(!this.m_IE){this.BuildIFrame(this.findChildId("widgetContent"),this.m_oDict.GetDictionaryKey(ThePort.Common.QS_IFRAMEURL));return}var c=this.findChildId("iframe");if(c){this.m_iFrameWatcher=new ThePort.Utils.SizeChecker(c);this.m_iFrameWatcher.setInterval(250)}c=this.findChildId("divWrapper");if(c){c.style.height="0px"}}}if(ThePortRegisterNS("ThePort.WidgetPicker")){ThePort.WidgetPicker={oWidgetPickerCurrentNode:null,HighlightListPickerCategory:function(a){var b=a.parentNode;count=b.childNodes.length;for(i=0;i<count;i++){if(b.childNodes[i].tagName=="DIV"){if(b.childNodes[i].className.indexOf("tp_pickListItem")>=0){ThePort.Utils.ClassSwapper(b.childNodes[i],"tp_pickListItemActive","tp_pickListItemInactive")}}}a.className=a.className+=" tp_pickListItemActive";ThePort.WidgetPicker.oWidgetPickerCurrentNode=a},ToggleWidgetPicker:function(a,c){var d=document.getElementById(a).style.display;if(d=="block"){document.getElementById(a).style.display="none";c.innerHTML="Add Widgets"}else{document.getElementById(a).style.display="block";c.innerHTML="Close Widgets";if(!ThePort.WidgetPicker.oWidgetPickerCurrentNode){var b=document.getElementsByTagName("DIV");for(i=0;i<b.length;i++){if(b[i].className.indexOf("tp_pickListItem")>=0){ThePort.WidgetPicker.HighlightListPickerCategory(b[i]);return}}}}}}}if(ThePortRegisterNS("ThePort.Scroll")){ThePort.Scroll={TestForScroll:function(d,e,a,c){var b=document.getElementById(e);if(b.offsetHeight<(d-5)){hideScrolling(a,c)}else{}},HideScrolling:function(a,b){document.getElementById(a).parentNode.removeChild(document.getElementById(a));document.getElementById(b).parentNode.removeChild(document.getElementById(b))}}}if(ThePortRegisterNS("ThePort.Utils.SizeChecker")){ThePort.Utils.SizeChecker=function(a){this.m_interval=null;this.m_elem=a;this.m_lastHeight=-1;this.m_IE=ThePort.Utils.IsIE()};ThePort.Utils.SizeChecker.prototype.setInterval=function(b){if(this.m_interval){return}var a=this;function c(){a.handleTimer(a)}this.m_interval=setInterval(c,b)};ThePort.Utils.SizeChecker.prototype.clearInterval=function(){if(this.m_interval){clearInterval(this.m_interval)}this.m_interval=null};ThePort.Utils.SizeChecker.prototype.handleTimer=function(f){try{var a;var c=f.m_elem;var b=(c.contentDocument)?c.contentDocument:c.contentWindow.document;if(b.body.offsetHeight){a=b.body.offsetHeight+32}else{if(c.Document&&c.Document.body.scrollHeight){a=c.Document.body.scrollHeight}}if((a-f.m_lastHeight>10)||(f.m_lastHeight-a>10)){f.m_lastHeight=a;c.height=a}}catch(d){}}}if(ThePortRegisterNS("ThePort.FW.Utils")){ThePort.FW.Utils={ConditionalCommentBoxSubmit:function(c,b,d){var a=ThePort.Utils.GetObj(b);if(a.value==ThePort.Common.CONST_EMPTY_STRING){alert("Please enter your comment.")}else{ThePort.XSL.CallModuleFunction(c,d,b)}},AccordionNav:function(b){var a;var d=b.parentNode.getElementsByTagName("DIV");for(i=1;i<d.length;i++){if(d[i].style.display=="none"||d[i].style.display==""){d[i].style.display="block";a="tp_AccordionPointer_Close"}else{d[i].style.display="none";a="tp_AccordionPointer_Open"}}var c=b.getElementsByTagName("IMG");if(c[0]){c[0].className=a}}}}Calendar=function(d,c,g,a,f){this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=g||null;this.onClose=a||null;this.dragging=false;this.hidden=false;this.minYear=1970;this.maxYear=2050;this.dateFormat=Calendar._TT.DEF_DATE_FORMAT;this.ttDateFormat=Calendar._TT.TT_DATE_FORMAT;this.isPopup=true;this.weekNumbers=false;this.firstDayOfWeek=typeof d=="number"?d:Calendar._FD;this.showsOtherMonths=false;this.dateStr=c;this.ar_days=null;this.showsTime=false;this.time24=true;this.yearStep=2;this.hiliteToday=true;this.multiple=null;this.table=null;this.element=null;this.tbody=null;this.firstdayname=null;this.monthsCombo=null;this.yearsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.hilitedYear=null;this.activeYear=null;this.dateClicked=false;this.onUnSelected=f||null;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined"){Calendar._SDN_len=3}var b=new Array();for(var e=8;e>0;){b[--e]=Calendar._DN[e].substr(0,Calendar._SDN_len)}Calendar._SDN=b;if(typeof Calendar._SMN_len=="undefined"){Calendar._SMN_len=3}b=new Array();for(var e=12;e>0;){b[--e]=Calendar._MN[e].substr(0,Calendar._SMN_len)}Calendar._SMN=b}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos=function(e){var a=0,d=0;var c=/^div$/i.test(e.tagName);if(c&&e.scrollLeft){a=e.scrollLeft}if(c&&e.scrollTop){d=e.scrollTop}var f={x:e.offsetLeft-a,y:e.offsetTop-d};if(e.offsetParent){var b=this.getAbsolutePos(e.offsetParent);f.x+=b.x;f.y+=b.y}return f};Calendar.isRelated=function(c,a){var d=a.relatedTarget;if(!d){var b=a.type;if(b=="mouseover"){d=a.fromElement}else{if(b=="mouseout"){d=a.toElement}}}while(d){if(d==c){return true}d=d.parentNode}return false};Calendar.removeClass=function(e,d){if(!(e&&e.className)){return}var a=e.className.split(" ");var b=new Array();for(var c=a.length;c>0;){if(a[--c]!=d){b[b.length]=a[c]}}e.className=b.join(" ")};Calendar.addClass=function(b,a){Calendar.removeClass(b,a);b.className+=" "+a};Calendar.getElement=function(a){var b=Calendar.is_ie?window.event.srcElement:a.currentTarget;while(b.nodeType!=1||/^div$/i.test(b.tagName)){b=b.parentNode}return b};Calendar.getTargetElement=function(a){var b=Calendar.is_ie?window.event.srcElement:a.target;while(b.nodeType!=1){b=b.parentNode}return b};Calendar.stopEvent=function(a){a||(a=window.event);if(Calendar.is_ie){a.cancelBubble=true;a.returnValue=false}else{a.preventDefault();a.stopPropagation()}return false};Calendar.addEvent=function(a,c,b){if(a.attachEvent){a.attachEvent("on"+c,b)}else{if(a.addEventListener){a.addEventListener(c,b,true)}else{a["on"+c]=b}}};Calendar.removeEvent=function(a,c,b){if(a.detachEvent){a.detachEvent("on"+c,b)}else{if(a.removeEventListener){a.removeEventListener(c,b,true)}else{a["on"+c]=null}}};Calendar.createElement=function(c,b){var a=null;if(document.createElementNS){a=document.createElementNS("http://www.w3.org/1999/xhtml",c)}else{a=document.createElement(c)}if(typeof b!="undefined"){b.appendChild(a)}return a};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true)}}};Calendar.findMonth=function(a){if(typeof a.month!="undefined"){return a}else{if(typeof a.parentNode.month!="undefined"){return a.parentNode}}return null};Calendar.findYear=function(a){if(typeof a.year!="undefined"){return a}else{if(typeof a.parentNode.year!="undefined"){return a.parentNode}}return null};Calendar.showMonthsCombo=function(){var e=Calendar._C;if(!e){return false}var e=e;var f=e.activeDiv;var d=e.monthsCombo;if(e.hilitedMonth){Calendar.removeClass(e.hilitedMonth,"hilite")}if(e.activeMonth){Calendar.removeClass(e.activeMonth,"active")}var c=e.monthsCombo.getElementsByTagName("div")[e.date.getMonth()];Calendar.addClass(c,"active");e.activeMonth=c;var b=d.style;b.display="block";if(f.navtype<0){b.left=f.offsetLeft+"px"}else{var a=d.offsetWidth;if(typeof a=="undefined"){a=50}b.left=(f.offsetLeft+f.offsetWidth-a)+"px"}b.top=(f.offsetTop+f.offsetHeight)+"px"};Calendar.showYearsCombo=function(d){var a=Calendar._C;if(!a){return false}var a=a;var c=a.activeDiv;var f=a.yearsCombo;if(a.hilitedYear){Calendar.removeClass(a.hilitedYear,"hilite")}if(a.activeYear){Calendar.removeClass(a.activeYear,"active")}a.activeYear=null;var b=a.date.getFullYear()+(d?1:-1);var j=f.firstChild;var h=false;for(var e=12;e>0;--e){if(b>=a.minYear&&b<=a.maxYear){j.innerHTML=b;j.year=b;j.style.display="block";h=true}else{j.style.display="none"}j=j.nextSibling;b+=d?a.yearStep:-a.yearStep}if(h){var m=f.style;m.display="block";if(c.navtype<0){m.left=c.offsetLeft+"px"}else{var g=f.offsetWidth;if(typeof g=="undefined"){g=50}m.left=(c.offsetLeft+c.offsetWidth-g)+"px"}m.top=(c.offsetTop+c.offsetHeight)+"px"}};Calendar.tableMouseUp=function(ev){var cal=Calendar._C;if(!cal){return false}if(cal.timeout){clearTimeout(cal.timeout)}var el=cal.activeDiv;if(!el){return false}var target=Calendar.getTargetElement(ev);ev||(ev=window.event);Calendar.removeClass(el,"active");if(target==el||target.parentNode==el){Calendar.cellClick(el,ev)}var mon=Calendar.findMonth(target);var date=null;if(mon){date=new Date(cal.date);if(mon.month!=date.getMonth()){date.setMonth(mon.month);cal.setDate(date);cal.dateClicked=false;cal.callHandler()}}else{var year=Calendar.findYear(target);if(year){date=new Date(cal.date);if(year.year!=date.getFullYear()){date.setFullYear(year.year);cal.setDate(date);cal.dateClicked=false;cal.callHandler()}}}with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);cal._hideCombos();_C=null;return stopEvent(ev)}};Calendar.tableMouseOver=function(p){var a=Calendar._C;if(!a){return}var c=a.activeDiv;var j=Calendar.getTargetElement(p);if(j==c||j.parentNode==c){Calendar.addClass(c,"hilite active");Calendar.addClass(c.parentNode,"rowhilite")}else{if(typeof c.navtype=="undefined"||(c.navtype!=50&&(c.navtype==0||Math.abs(c.navtype)>2))){Calendar.removeClass(c,"active")}Calendar.removeClass(c,"hilite");Calendar.removeClass(c.parentNode,"rowhilite")}p||(p=window.event);if(c.navtype==50&&j!=c){var o=Calendar.getAbsolutePos(c);var r=c.offsetWidth;var q=p.clientX;var s;var n=true;if(q>o.x+r){s=q-o.x-r;n=false}else{s=o.x-q}if(s<0){s=0}var f=c._range;var h=c._current;var g=Math.floor(s/10)%f.length;for(var e=f.length;--e>=0;){if(f[e]==h){break}}while(g-->0){if(n){if(--e<0){e=f.length-1}}else{if(++e>=f.length){e=0}}}var b=f[e];c.innerHTML=b;a.onUpdateTime()}var d=Calendar.findMonth(j);if(d){if(d.month!=a.date.getMonth()){if(a.hilitedMonth){Calendar.removeClass(a.hilitedMonth,"hilite")}Calendar.addClass(d,"hilite");a.hilitedMonth=d}else{if(a.hilitedMonth){Calendar.removeClass(a.hilitedMonth,"hilite")}}}else{if(a.hilitedMonth){Calendar.removeClass(a.hilitedMonth,"hilite")}var m=Calendar.findYear(j);if(m){if(m.year!=a.date.getFullYear()){if(a.hilitedYear){Calendar.removeClass(a.hilitedYear,"hilite")}Calendar.addClass(m,"hilite");a.hilitedYear=m}else{if(a.hilitedYear){Calendar.removeClass(a.hilitedYear,"hilite")}}}else{if(a.hilitedYear){Calendar.removeClass(a.hilitedYear,"hilite")}}}return Calendar.stopEvent(p)};Calendar.tableMouseDown=function(a){if(Calendar.getTargetElement(a)==Calendar.getElement(a)){return Calendar.stopEvent(a)}};Calendar.calDragIt=function(b){var c=Calendar._C;if(!(c&&c.dragging)){return false}var e;var d;if(Calendar.is_ie){d=window.event.clientY+document.body.scrollTop;e=window.event.clientX+document.body.scrollLeft}else{e=b.pageX;d=b.pageY}c.hideShowCovered();var a=c.element.style;a.left=(e-c.xOffs)+"px";a.top=(d-c.yOffs)+"px";return Calendar.stopEvent(b)};Calendar.calDragEnd=function(ev){var cal=Calendar._C;if(!cal){return false}cal.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(ev)}cal.hideShowCovered()};Calendar.dayMouseDown=function(ev){var el=Calendar.getElement(ev);if(el.disabled){return false}var cal=el.calendar;cal.activeDiv=el;Calendar._C=cal;if(el.navtype!=300){with(Calendar){if(el.navtype==50){el._current=el.innerHTML;addEvent(document,"mousemove",tableMouseOver)}else{addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver)}addClass(el,"hilite active");addEvent(document,"mouseup",tableMouseUp)}}else{if(cal.isPopup){cal._dragStart(ev)}}if(el.navtype==-1||el.navtype==1){if(cal.timeout){clearTimeout(cal.timeout)}cal.timeout=setTimeout("Calendar.showMonthsCombo()",250)}else{if(el.navtype==-2||el.navtype==2){if(cal.timeout){clearTimeout(cal.timeout)}cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250)}else{cal.timeout=null}}return Calendar.stopEvent(ev)};Calendar.dayMouseDblClick=function(a){Calendar.cellClick(Calendar.getElement(a),a||window.event);if(Calendar.is_ie){document.selection.empty()}};Calendar.dayMouseOver=function(b){var a=Calendar.getElement(b);if(Calendar.isRelated(a,b)||Calendar._C||a.disabled){return false}if(a.ttip){if(a.ttip.substr(0,1)=="_"){a.ttip=a.caldate.print(a.calendar.ttDateFormat)+a.ttip.substr(1)}a.calendar.tooltips.innerHTML=a.ttip}if(a.navtype!=300){Calendar.addClass(a,"hilite");if(a.caldate){}}return Calendar.stopEvent(b)};Calendar.dayMouseOut=function(ev){with(Calendar){var el=getElement(ev);if(isRelated(el,ev)||_C||el.disabled){return false}removeClass(el,"hilite");if(el.caldate){removeClass(el.parentNode,"rowhilite")}if(el.calendar){el.calendar.tooltips.innerHTML=_TT.SEL_DATE}return stopEvent(ev)}};Calendar.cellClick=function(e,q){var c=e.calendar;var h=false;var n=false;var f=null;if(typeof e.navtype=="undefined"){if(c.currentDateEl){Calendar.removeClass(c.currentDateEl,"selected");h=(c.currentDateEl==e);if(!h){c.currentDateEl=e}}c.date.setDateOnly(e.caldate);f=c.date;var b=!(c.dateClicked=!e.otherMonth);if(!b&&!c.currentDateEl){c._toggleMultipleDate(new Date(f))}else{n=!e.disabled}if(b){c._init(c.firstDayOfWeek,f)}}else{if(e.navtype==200){Calendar.removeClass(e,"hilite");c.callCloseHandler();return}f=new Date(c.date);if(e.navtype==0){f.setDateOnly(new Date())}c.dateClicked=false;var p=f.getFullYear();var g=f.getMonth();function a(u){var v=f.getDate();var s=f.getMonthDays(u);if(v>s){f.setDate(s)}f.setMonth(u)}switch(e.navtype){case 400:Calendar.removeClass(e,"hilite");var r=Calendar._TT.ABOUT;if(typeof r!="undefined"){r+=c.showsTime?Calendar._TT.ABOUT_TIME:""}else{r='Help and about box text is not translated into this language.\nIf you know this language and you feel generous please update\nthe corresponding file in "lang" subdir to match calendar-en.js\nand send it back to <mihai_bazon@yahoo.com> to get it into the distribution  ;-)\n\nThank you!\nhttp://dynarch.com/mishoo/calendar.epl\n'}alert(r);return;case -2:if(p>c.minYear){f.setFullYear(p-1)}break;case -1:if(g>0){a(g-1)}else{if(p-->c.minYear){f.setFullYear(p);a(11)}}break;case 1:if(g<11){a(g+1)}else{if(p<c.maxYear){f.setFullYear(p+1);a(0)}}break;case 2:if(p<c.maxYear){f.setFullYear(p+1)}break;case 100:c.setFirstDayOfWeek(e.fdow);return;case 50:var m=e._range;var o=e.innerHTML;for(var j=m.length;--j>=0;){if(m[j]==o){break}}if(q&&q.shiftKey){if(--j<0){j=m.length-1}}else{if(++j>=m.length){j=0}}var d=m[j];e.innerHTML=d;c.onUpdateTime();return;case 0:if((typeof c.getDateStatus=="function")&&c.getDateStatus(f,f.getFullYear(),f.getMonth(),f.getDate())){return false}break}if(!f.equalsTo(c.date)){c.setDate(f);n=true}else{if(e.navtype==0){n=h=true}}}if(n){q&&c.callHandler()}if(h){Calendar.removeClass(e,"hilite");q&&c.callCloseHandler()}else{if(n!=true){c.callHandler()}}};Calendar.prototype.create=function(p){var o=null;if(!p){o=document.getElementsByTagName("body")[0];this.isPopup=true}else{o=p;this.isPopup=false}this.date=this.dateStr?new Date(this.dateStr):new Date();var s=Calendar.createElement("table");this.table=s;if(!p){s.style.width="200px";s.style.height="200px"}s.cellSpacing=0;s.cellPadding=0;s.calendar=this;Calendar.addEvent(s,"mousedown",Calendar.tableMouseDown);var a=Calendar.createElement("div");this.element=a;a.className="JSCal2_calendar";a.style.position="absolute";if(this.isPopup){a.style.position="absolute";a.style.display="none"}a.appendChild(s);var m=Calendar.createElement("thead",s);var q=null;var u=null;var b=this;var e=function(w,v,j){q=Calendar.createElement("td",u);q.colSpan=v;q.className="button";if(j!=0&&Math.abs(j)<=2){q.className+=" nav"}Calendar._add_evs(q);q.calendar=b;q.navtype=j;q.innerHTML="<div unselectable='on'>"+w+"</div>";return q};u=Calendar.createElement("tr",m);var c=7;(this.isPopup)&&--c;(this.weekNumbers)&&++c;this.title=e("",c,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT.DRAG_TO_MOVE;this.title.style.cursor="move";e("&#x00d7;",1,200).ttip=Calendar._TT.CLOSE}u=Calendar.createElement("tr",m);u.className="headrow";this._nav_py=e("&#x00ab;",1,-2);this._nav_py.ttip=Calendar._TT.PREV_YEAR;this._nav_pm=e("&#x2039;",1,-1);this._nav_pm.ttip=Calendar._TT.PREV_MONTH;this._nav_now=e(Calendar._TT.TODAY,this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT.GO_TODAY;this._nav_nm=e("&#x203a;",1,1);this._nav_nm.ttip=Calendar._TT.NEXT_MONTH;this._nav_ny=e("&#x00bb;",1,2);this._nav_ny.ttip=Calendar._TT.NEXT_YEAR;u=Calendar.createElement("tr",m);u.className="daynames";if(this.weekNumbers){q=Calendar.createElement("td",u);q.className="name wn";q.innerHTML=Calendar._TT.WK}for(var h=7;h>0;--h){q=Calendar.createElement("td",u);if(!h){q.navtype=100;q.calendar=this;Calendar._add_evs(q)}}this.firstdayname=(this.weekNumbers)?u.firstChild.nextSibling:u.firstChild;this._displayWeekdays();var g=Calendar.createElement("tbody",s);this.tbody=g;for(h=6;h>0;--h){u=Calendar.createElement("tr",g);if(this.weekNumbers){q=Calendar.createElement("td",u)}for(var f=7;f>0;--f){q=Calendar.createElement("td",u);q.calendar=this;Calendar._add_evs(q)}}if(this.showsTime){u=Calendar.createElement("tr",g);u.className="time";q=Calendar.createElement("td",u);q.className="time";q.colSpan=2;q.innerHTML=Calendar._TT.TIME||"&nbsp;";q=Calendar.createElement("td",u);q.className="time";q.colSpan=this.weekNumbers?4:3;(function(){function y(H,J,I,K){var F=Calendar.createElement("span",q);F.className=H;F.innerHTML=J;F.calendar=b;F.ttip=Calendar._TT.TIME_PART;F.navtype=50;F._range=[];if(typeof I!="number"){F._range=I}else{for(var G=I;G<=K;++G){var E;if(G<10&&K>=10){E="0"+G}else{E=""+G}F._range[F._range.length]=E}}Calendar._add_evs(F);return F}var C=b.date.getHours();var j=b.date.getMinutes();var D=!b.time24;var v=(C>12);if(D&&v){C-=12}var A=y("hour",C,D?1:0,D?12:23);var z=Calendar.createElement("span",q);z.innerHTML=":";z.className="colon";var w=y("minute",j,0,59);var B=null;q=Calendar.createElement("td",u);q.className="time";q.colSpan=2;if(D){B=y("ampm",v?"pm":"am",["am","pm"])}else{q.innerHTML="&nbsp;"}b.onSetTime=function(){var F,E=this.date.getHours(),G=this.date.getMinutes();if(D){F=(E>=12);if(F){E-=12}if(E==0){E=12}B.innerHTML=F?"pm":"am"}A.innerHTML=(E<10)?("0"+E):E;w.innerHTML=(G<10)?("0"+G):G};b.onUpdateTime=function(){var F=this.date;var G=parseInt(A.innerHTML,10);if(D){if(/pm/i.test(B.innerHTML)&&G<12){G+=12}else{if(/am/i.test(B.innerHTML)&&G==12){G=0}}}var H=F.getDate();var E=F.getMonth();var I=F.getFullYear();F.setHours(G);F.setMinutes(parseInt(w.innerHTML,10));F.setFullYear(I);F.setMonth(E);F.setDate(H);this.dateClicked=false;this.callHandler()}})()}else{this.onSetTime=this.onUpdateTime=function(){}}var n=Calendar.createElement("tfoot",s);u=Calendar.createElement("tr",n);u.className="footrow";q=e(Calendar._TT.SEL_DATE,this.weekNumbers?8:7,300);q.className="ttip";if(this.isPopup){q.ttip=Calendar._TT.DRAG_TO_MOVE;q.style.cursor="move"}this.tooltips=q;a=Calendar.createElement("div",this.element);this.monthsCombo=a;a.className="combo";for(h=0;h<Calendar._MN.length;++h){var d=Calendar.createElement("div");d.className=Calendar.is_ie?"label-IEfix":"label";d.month=h;d.innerHTML=Calendar._SMN[h];a.appendChild(d)}a=Calendar.createElement("div",this.element);this.yearsCombo=a;a.className="combo";for(h=12;h>0;--h){var r=Calendar.createElement("div");r.className=Calendar.is_ie?"label-IEfix":"label";a.appendChild(r)}this._init(this.firstDayOfWeek,this.date);o.appendChild(this.element)};Calendar._keyEvent=function(n){var a=window._dynarch_popupCalendar;if(!a||a.multiple){return false}(Calendar.is_ie)&&(n=window.event);var j=(Calendar.is_ie||n.type=="keypress"),o=n.keyCode;if(n.ctrlKey){switch(o){case 37:j&&Calendar.cellClick(a._nav_pm);break;case 38:j&&Calendar.cellClick(a._nav_py);break;case 39:j&&Calendar.cellClick(a._nav_nm);break;case 40:j&&Calendar.cellClick(a._nav_ny);break;default:return false}}else{switch(o){case 32:Calendar.cellClick(a._nav_now);break;case 27:j&&a.callCloseHandler();break;case 37:case 38:case 39:case 40:if(j){var e,p,m,g,c,d;e=o==37||o==38;d=(o==37||o==39)?1:7;function b(){c=a.currentDateEl;var q=c.pos;p=q&15;m=q>>4;g=a.ar_days[m][p]}b();function f(){var q=new Date(a.date);q.setDate(q.getDate()-d);a.setDate(q)}function h(){var q=new Date(a.date);q.setDate(q.getDate()+d);a.setDate(q)}while(1){switch(o){case 37:if(--p>=0){g=a.ar_days[m][p]}else{p=6;o=38;continue}break;case 38:if(--m>=0){g=a.ar_days[m][p]}else{f();b()}break;case 39:if(++p<7){g=a.ar_days[m][p]}else{p=0;o=40;continue}break;case 40:if(++m<a.ar_days.length){g=a.ar_days[m][p]}else{h();b()}break}break}if(g){if(!g.disabled){Calendar.cellClick(g)}else{if(e){f()}else{h()}}}}break;case 13:if(j){Calendar.cellClick(a.currentDateEl,n)}break;default:return false}}return Calendar.stopEvent(n)};Calendar.prototype._init=function(p,B){var A=new Date(),u=A.getFullYear(),D=A.getMonth(),b=A.getDate();this.table.style.visibility="hidden";var h=B.getFullYear();if(h<this.minYear){h=this.minYear;B.setFullYear(h)}else{if(h>this.maxYear){h=this.maxYear;B.setFullYear(h)}}this.firstDayOfWeek=p;this.date=new Date(B);var C=B.getMonth();var F=B.getDate();var E=B.getMonthDays();B.setDate(1);var v=(B.getDay()-this.firstDayOfWeek)%7;if(v<0){v+=7}B.setDate(-v);B.setDate(B.getDate()+1);var e=this.tbody.firstChild;var n=Calendar._SMN[C];var r=this.ar_days=new Array();var q=Calendar._TT.WEEKEND;var d=this.multiple?(this.datesCells={}):null;for(var y=0;y<6;++y,e=e.nextSibling){var a=e.firstChild;if(this.weekNumbers){a.className="day wn";a.innerHTML=B.getWeekNumber();a=a.nextSibling}e.className="daysrow";var z=false,f,c=r[y]=[];for(var w=0;w<7;++w,a=a.nextSibling,B.setDate(f+1)){f=B.getDate();var g=B.getDay();a.className="day";a.pos=y<<4|w;c[w]=a;var o=(B.getMonth()==C);if(!o){if(this.showsOtherMonths){a.className+=" othermonth";a.otherMonth=true}else{a.className="emptycell";a.innerHTML="&nbsp;";a.disabled=true;continue}}else{a.otherMonth=false;z=true}a.disabled=false;a.innerHTML=this.getDateText?this.getDateText(B,f):f;if(d){d[B.print("%Y%m%d")]=a}if(this.getDateStatus){var s=this.getDateStatus(B,h,C,f);if(this.getDateToolTip){var m=this.getDateToolTip(B,h,C,f);if(m){a.title=m}}if(s===true){a.className+=" disabled";a.disabled=true}else{if(/disabled/i.test(s)){a.disabled=true}a.className+=" "+s}}if(!a.disabled){a.caldate=new Date(B);a.ttip="_";if(!this.multiple&&o&&f==F&&this.hiliteToday){a.className+=" selected";this.currentDateEl=a}if(B.getFullYear()==u&&B.getMonth()==D&&f==b){a.className+=" today";a.ttip+=Calendar._TT.PART_TODAY}if(q.indexOf(g.toString())!=-1){a.className+=a.otherMonth?" oweekend":" weekend"}}}if(!(z||this.showsOtherMonths)){e.className="emptyrow"}}this.title.innerHTML=Calendar._MN[C]+", "+h;this.onSetTime();this.table.style.visibility="visible";this.monthsCombo.style.display="none";this._initMultipleDates()};Calendar.prototype._initMultipleDates=function(){if(this.multiple){for(var b in this.multiple){var a=this.datesCells[b];var c=this.multiple[b];if(!c){continue}if(a){a.className+=" selected"}}}};Calendar.prototype._toggleMultipleDate=function(b){if(this.multiple){var c=b.print("%Y%m%d");var a=this.datesCells[c];if(a){var e=this.multiple[c];if(!e){}else{}}}};Calendar.prototype.setDateToolTipHandler=function(a){this.getDateToolTip=a};Calendar.prototype.setDate=function(a){if(!a.equalsTo(this.date)){this._init(this.firstDayOfWeek,a)}};Calendar.prototype.refresh=function(){this._init(this.firstDayOfWeek,this.date)};Calendar.prototype.setFirstDayOfWeek=function(a){this._init(a,this.date);this._displayWeekdays()};Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(a){this.getDateStatus=a};Calendar.prototype.setRange=function(b,c){this.minYear=b;this.maxYear=c};Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.date.print(this.dateFormat))}};Calendar.prototype.callCloseHandler=function(){if(this.onClose){this.onClose(this)}this.hideShowCovered()};Calendar.prototype.destroy=function(){var a=this.element.parentNode;a.removeChild(this.element);Calendar._C=null;window._dynarch_popupCalendar=null};Calendar.prototype.reparent=function(b){var a=this.element;a.parentNode.removeChild(a);b.appendChild(a)};Calendar._checkCalendar=function(b){var c=window._dynarch_popupCalendar;if(!c){return false}var a=Calendar.is_ie?Calendar.getElement(b):Calendar.getTargetElement(b);for(;a!=null&&a!=c.element;a=a.parentNode){}if(a==null){window._dynarch_popupCalendar.callCloseHandler();return Calendar.stopEvent(b)}};Calendar.prototype.show=function(){var e=this.table.getElementsByTagName("tr");for(var d=e.length;d>0;){var f=e[--d];Calendar.removeClass(f,"rowhilite");var c=f.getElementsByTagName("td");for(var b=c.length;b>0;){var a=c[--b];Calendar.removeClass(a,"hilite");Calendar.removeClass(a,"active")}}this.element.style.display="block";this.hidden=false;if(this.isPopup){window._dynarch_popupCalendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document,"mousedown",Calendar._checkCalendar)}this.hideShowCovered()};Calendar.prototype.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar)}this.element.style.display="none";this.hidden=true;this.hideShowCovered()};Calendar.prototype.showAt=function(a,c){var b=this.element.style;b.left=a+"px";b.top=c+"px";this.show()};Calendar.prototype.showAtElement=function(c,d){var a=this;var e=Calendar.getAbsolutePos(c);if(!d||typeof d!="string"){this.showAt(e.x,e.y+c.offsetHeight);return true}function b(j){if(j.x<0){j.x=0}if(j.y<0){j.y=0}var m=document.createElement("div");var h=m.style;h.position="absolute";h.right=h.bottom=h.width=h.height="0px";document.body.appendChild(m);var g=Calendar.getAbsolutePos(m);document.body.removeChild(m);if(Calendar.is_ie){g.y+=document.body.scrollTop;g.x+=document.body.scrollLeft}else{g.y+=window.scrollY;g.x+=window.scrollX}var f=j.x+j.width-g.x;if(f>0){j.x-=f}f=j.y+j.height-g.y;if(f>0){j.y-=f}}this.element.style.display="block";Calendar.continuation_for_the_fucking_khtml_browser=function(){var f=a.element.offsetWidth;var j=a.element.offsetHeight;a.element.style.display="none";var g=d.substr(0,1);var m="l";if(d.length>1){m=d.substr(1,1)}switch(g){case"T":e.y-=j;break;case"B":e.y+=c.offsetHeight;break;case"C":e.y+=(c.offsetHeight-j)/2;break;case"t":e.y+=c.offsetHeight-j;break;case"b":break}switch(m){case"L":e.x-=f;break;case"R":e.x+=c.offsetWidth;break;case"C":e.x+=(c.offsetWidth-f)/2;break;case"l":e.x+=c.offsetWidth-f;break;case"r":break}e.width=f;e.height=j+40;a.monthsCombo.style.display="none";b(e);a.showAt(e.x,e.y)};if(Calendar.is_khtml){setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()",10)}else{Calendar.continuation_for_the_fucking_khtml_browser()}};Calendar.prototype.setDateFormat=function(a){this.dateFormat=a};Calendar.prototype.setTtDateFormat=function(a){this.ttDateFormat=a};Calendar.prototype.parseDate=function(b,a){if(!a){a=this.dateFormat}this.setDate(Date.parseDate(b,a))};Calendar.prototype.hideShowCovered=function(){if(!Calendar.is_ie&&!Calendar.is_opera){return}function b(v){var p=v.style.visibility;if(!p){if(document.defaultView&&typeof(document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml){p=document.defaultView.getComputedStyle(v,"").getPropertyValue("visibility")}else{p=""}}else{if(v.currentStyle){p=v.currentStyle.visibility}else{p=""}}}return p}var u=new Array("applet","iframe","select");var c=this.element;var a=Calendar.getAbsolutePos(c);var f=a.x;var d=c.offsetWidth+f;var s=a.y;var r=c.offsetHeight+s;for(var h=u.length;h>0;){var g=document.getElementsByTagName(u[--h]);var e=null;for(var m=g.length;m>0;){e=g[--m];a=Calendar.getAbsolutePos(e);var q=a.x;var o=e.offsetWidth+q;var n=a.y;var j=e.offsetHeight+n;if(this.hidden||(q>d)||(o<f)||(n>r)||(j<s)){if(!e.__msh_save_visibility){e.__msh_save_visibility=b(e)}e.style.visibility=e.__msh_save_visibility}else{if(!e.__msh_save_visibility){e.__msh_save_visibility=b(e)}e.style.visibility="hidden"}}}};Calendar.prototype._displayWeekdays=function(){var b=this.firstDayOfWeek;var a=this.firstdayname;var d=Calendar._TT.WEEKEND;for(var c=0;c<7;++c){a.className="day name";var e=(c+b)%7;if(c){a.ttip=Calendar._TT.DAY_FIRST.replace("%s",Calendar._DN[e]);a.navtype=100;a.calendar=this;a.fdow=e;Calendar._add_evs(a)}if(d.indexOf(e.toString())!=-1){Calendar.addClass(a,"weekend")}a.innerHTML=Calendar._SDN[(c+b)%7];a=a.nextSibling}};Calendar.prototype._hideCombos=function(){this.monthsCombo.style.display="none";this.yearsCombo.style.display="none"};Calendar.prototype._dragStart=function(ev){if(this.dragging){return}this.dragging=false;var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft}else{posY=ev.clientY+window.scrollY;posX=ev.clientX+window.scrollX}var st=this.element.style;this.xOffs=posX-parseInt(st.left);this.yOffs=posY-parseInt(st.top);with(Calendar){addEvent(document,"mousemove",calDragIt);addEvent(document,"mouseup",calDragEnd)}};Date._MD=new Array(31,28,31,30,31,30,31,31,30,31,30,31);Date.SECOND=1000;Date.MINUTE=60*Date.SECOND;Date.HOUR=60*Date.MINUTE;Date.DAY=24*Date.HOUR;Date.WEEK=7*Date.DAY;Date.parseDate=function(o,c){var p=new Date();var q=0;var e=-1;var n=0;var s=o.split(/\W+/);var r=c.match(/%./g);var h=0,g=0;var u=0;var f=0;for(h=0;h<s.length;++h){if(!s[h]){continue}switch(r[h]){case"%d":case"%e":n=parseInt(s[h],10);break;case"%m":e=parseInt(s[h],10)-1;break;case"%Y":case"%y":q=parseInt(s[h],10);(q<100)&&(q+=(q>29)?1900:2000);break;case"%b":case"%B":for(g=0;g<12;++g){if(Calendar._MN[g].substr(0,s[h].length).toLowerCase()==s[h].toLowerCase()){e=g;break}}break;case"%H":case"%I":case"%k":case"%l":u=parseInt(s[h],10);break;case"%P":case"%p":if(/pm/i.test(s[h])&&u<12){u+=12}else{if(/am/i.test(s[h])&&u>=12){u-=12}}break;case"%M":f=parseInt(s[h],10);break}}if(isNaN(q)){q=p.getFullYear()}if(isNaN(e)){e=p.getMonth()}if(isNaN(n)){n=p.getDate()}if(isNaN(u)){u=p.getHours()}if(isNaN(f)){f=p.getMinutes()}if(q!=0&&e!=-1&&n!=0){return new Date(q,e,n,u,f,0)}q=0;e=-1;n=0;for(h=0;h<s.length;++h){if(s[h].search(/[a-zA-Z]+/)!=-1){var v=-1;for(g=0;g<12;++g){if(Calendar._MN[g].substr(0,s[h].length).toLowerCase()==s[h].toLowerCase()){v=g;break}}if(v!=-1){if(e!=-1){n=e+1}e=v}}else{if(parseInt(s[h],10)<=12&&e==-1){e=s[h]-1}else{if(parseInt(s[h],10)>31&&q==0){q=parseInt(s[h],10);(q<100)&&(q+=(q>29)?1900:2000)}else{if(n==0){n=s[h]}}}}}if(q==0){q=p.getFullYear()}if(e!=-1&&n!=0){return new Date(q,e,n,u,f,0)}return p};Date.prototype.getMonthDays=function(b){var a=this.getFullYear();if(typeof b=="undefined"){b=this.getMonth()}if(((0==(a%4))&&((0!=(a%100))||(0==(a%400))))&&b==1){return 29}else{return Date._MD[b]}};Date.prototype.getDayOfYear=function(){var a=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var c=new Date(this.getFullYear(),0,0,0,0,0);var b=a-c;return Math.floor(b/Date.DAY)};Date.prototype.getWeekNumber=function(){var c=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var b=c.getDay();c.setDate(c.getDate()-(b+6)%7+3);var a=c.valueOf();c.setMonth(0);c.setDate(4);return Math.round((a-c.valueOf())/(7*86400000))+1};Date.prototype.equalsTo=function(a){return((this.getFullYear()==a.getFullYear())&&(this.getMonth()==a.getMonth())&&(this.getDate()==a.getDate())&&(this.getHours()==a.getHours())&&(this.getMinutes()==a.getMinutes()))};Date.prototype.setDateOnly=function(a){var b=new Date(a);this.setDate(1);this.setFullYear(b.getFullYear());this.setMonth(b.getMonth());this.setDate(b.getDate())};Date.prototype.print=function(o){var b=this.getMonth();var n=this.getDate();var p=this.getFullYear();var r=this.getWeekNumber();var u=this.getDay();var B={};var v=this.getHours();var c=(v>=12);var h=(c)?(v-12):v;var A=this.getDayOfYear();if(h==0){h=12}var e=this.getMinutes();var j=this.getSeconds();B["%a"]=Calendar._SDN[u];B["%A"]=Calendar._DN[u];B["%b"]=Calendar._SMN[b];B["%B"]=Calendar._MN[b];B["%C"]=1+Math.floor(p/100);B["%d"]=(n<10)?("0"+n):n;B["%e"]=n;B["%H"]=(v<10)?("0"+v):v;B["%I"]=(h<10)?("0"+h):h;B["%j"]=(A<100)?((A<10)?("00"+A):("0"+A)):A;B["%k"]=v;B["%l"]=h;B["%m"]=(b<9)?("0"+(1+b)):(1+b);B["%M"]=(e<10)?("0"+e):e;B["%n"]="\n";B["%p"]=c?"PM":"AM";B["%P"]=c?"pm":"am";B["%s"]=Math.floor(this.getTime()/1000);B["%S"]=(j<10)?("0"+j):j;B["%t"]="\t";B["%U"]=B["%W"]=B["%V"]=(r<10)?("0"+r):r;B["%u"]=u+1;B["%w"]=u;B["%y"]=(""+p).substr(2,2);B["%Y"]=p;B["%%"]="%";var z=/%./g;if(!Calendar.is_ie5&&!Calendar.is_khtml){return o.replace(z,function(a){return B[a]||a})}var q=o.match(z);for(var g=0;g<q.length;g++){var f=B[q[g]];if(f){z=new RegExp(q[g],"g");o=o.replace(z,f)}}return o};Date.prototype.__msh_oldSetFullYear=Date.prototype.setFullYear;Date.prototype.setFullYear=function(b){var a=new Date(this);a.__msh_oldSetFullYear(b);if(a.getMonth()!=this.getMonth()){this.setDate(28)}this.__msh_oldSetFullYear(b)};window._dynarch_popupCalendar=null;Calendar._DN=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");Calendar._SDN=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun");Calendar._FD=0;Calendar._MN=new Array("January","February","March","April","May","June","July","August","September","October","November","December");Calendar._SMN=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");Calendar._TT={};Calendar._TT.INFO="About the calendar";Calendar._TT.ABOUT="DHTML Date/Time Selector\n(c) dynarch.com 2002-2005 / Author: Mihai Bazon\nFor latest version visit: http://www.dynarch.com/projects/calendar/\nDistributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details.\n\nDate selection:\n- Use the \xab, \xbb buttons to select year\n- Use the "+String.fromCharCode(8249)+", "+String.fromCharCode(8250)+" buttons to select month\n- Hold mouse button on any of the above buttons for faster selection.";Calendar._TT.ABOUT_TIME="\n\nTime selection:\n- Click on any of the time parts to increase it\n- or Shift-click to decrease it\n- or click and drag for faster selection.";Calendar._TT.PREV_YEAR="Prev. year (hold for menu)";Calendar._TT.PREV_MONTH="Prev. month (hold for menu)";Calendar._TT.GO_TODAY="Go Today";Calendar._TT.NEXT_MONTH="Next month (hold for menu)";Calendar._TT.NEXT_YEAR="Next year (hold for menu)";Calendar._TT.SEL_DATE="Select date";Calendar._TT.PART_TODAY=" (today)";Calendar._TT.DAY_FIRST="Display %s first";Calendar._TT.WEEKEND="0,6";Calendar._TT.CLOSE="Close";Calendar._TT.TODAY="Today";Calendar._TT.TIME_PART="(Shift-)Click or drag to change value";Calendar._TT.DEF_DATE_FORMAT="%Y-%m-%d";Calendar._TT.TT_DATE_FORMAT="%a, %b %e";Calendar._TT.WK="wk";Calendar._TT.TIME="Time:";Calendar.setup=function(c){function g(d,n){if(typeof c[d]=="undefined"){c[d]=n}}g("inputField",null);g("displayArea",null);g("button",null);g("eventName","click");g("ifFormat","%m/%d/%Y");g("daFormat","%Y/%m/%d");g("singleClick",true);g("disableFunc",null);g("dateStatusFunc",c.disableFunc);g("dateText",null);g("firstDay",null);g("align","Br");g("range",[1900,2999]);g("weekNumbers",false);g("flat",null);g("flatCallback",null);g("onSelect",null);g("onClose",null);g("onUpdate",null);g("date",null);g("showsTime",false);g("timeFormat","24");g("electric",true);g("step",2);g("position",null);g("cache",false);g("showOthers",false);g("multiple",null);var e=["inputField","displayArea","button"];if(!(c.flat||c.multiple||c.inputField||c.displayArea||c.button)){alert("Calendar.setup:\n  Nothing to setup (no fields found).  Please check your code");return false}function j(n){var d=n.params;var o=(n.dateClicked||d.electric);if(o&&d.inputField){d.inputField.value=n.date.print(d.ifFormat);if(typeof d.inputField.onchange=="function"){d.inputField.onchange()}}if(o&&d.displayArea){d.displayArea.innerHTML=n.date.print(d.daFormat)}if(o&&typeof d.onUpdate=="function"){d.onUpdate(n)}if(o&&d.flat){if(typeof d.flatCallback=="function"){d.flatCallback(n)}}if(o&&d.singleClick&&n.dateClicked){n.callCloseHandler()}}if(c.flat!=null){if(typeof c.flat=="string"){c.flat=document.getElementById(c.flat)}if(!c.flat){alert("Calendar.setup:\n  Flat specified but can't find parent.");return false}var a=new Calendar(c.firstDay,c.date,c.onSelect||j);a.showsOtherMonths=c.showOthers;a.showsTime=c.showsTime;a.time24=(c.timeFormat=="24");a.params=c;a.weekNumbers=c.weekNumbers;a.setRange(c.range[0],c.range[1]);a.setDateStatusHandler(c.dateStatusFunc);a.getDateText=c.dateText;if(c.ifFormat){a.setDateFormat(c.ifFormat)}if(c.inputField&&typeof c.inputField.value=="string"){a.parseDate(c.inputField.value)}if(c.flat){if(c.multiple){a.multiple={};for(var f=c.multiple.length;--f>=0;){var h=c.multiple[f];var b=h.print("%Y%m%d");a.multiple[b]=h}}}a.create(c.flat);if(c.flat){if(c.width){a.table.style.width=c.width+"px"}else{a.table.style.width="250px"}if(c.height){a.table.style.height=c.height+"px"}}a.show();return false}var m;m=c.button||c.displayArea||c.inputField;m["on"+c.eventName]=function(){var n=c.inputField||c.displayArea;var p=c.inputField?c.ifFormat:c.daFormat;var u=false;var r=window.calendar;if(n){c.date=Date.parseDate(n.value||n.innerHTML,p)}if(!(r&&c.cache)){window.calendar=r=new Calendar(c.firstDay,c.date,c.onSelect||j,c.onClose||function(d){d.hide()});r.showsTime=c.showsTime;r.time24=(c.timeFormat=="24");r.weekNumbers=c.weekNumbers;u=true}else{if(c.date){r.setDate(c.date)}r.hide()}if(c.multiple){r.multiple={};for(var o=c.multiple.length;--o>=0;){var s=c.multiple[o];var q=s.print("%Y%m%d");r.multiple[q]=s}}r.showsOtherMonths=c.showOthers;r.yearStep=c.step;r.setRange(c.range[0],c.range[1]);r.params=c;r.setDateStatusHandler(c.dateStatusFunc);r.getDateText=c.dateText;r.setDateFormat(p);if(u){r.create()}r.refresh();if(!c.position){r.showAtElement(c.button||c.displayArea||c.inputField,c.align)}else{r.showAt(c.position[0],c.position[1])}return false};Calendar.ShowPopupCal=function(){var n=c.inputField||c.displayArea;var p=c.inputField?c.ifFormat:c.daFormat;var u=false;var r=window.calendar;if(n){c.date=Date.parseDate(n.value||n.innerHTML,p)}if(!(r&&c.cache)){window.calendar=r=new Calendar(c.firstDay,c.date,c.onSelect||j,c.onClose||function(d){d.hide()});r.showsTime=c.showsTime;r.time24=(c.timeFormat=="24");r.weekNumbers=c.weekNumbers;u=true}else{if(c.date){r.setDate(c.date)}r.hide()}if(c.multiple){r.multiple={};for(var o=c.multiple.length;--o>=0;){var s=c.multiple[o];var q=s.print("%Y%m%d");r.multiple[q]=s}}r.showsOtherMonths=c.showOthers;r.yearStep=c.step;r.setRange(c.range[0],c.range[1]);r.params=c;r.setDateStatusHandler(c.dateStatusFunc);r.getDateText=c.dateText;r.setDateFormat(p);if(u){r.create()}r.refresh();if(!c.position){r.showAtElement(c.button||c.displayArea||c.inputField,c.align)}else{if(arguments.length>1){r.showAt(arguments[0],arguments[1])}else{r.showAt(c.position[0],c.position[1])}}return false};return a};ThePortRegisterNS("ThePortCalendar.Utility");ThePortCalendar.Utility=function(){this.m_textID="";this.m_imageID=""};ThePortCalendar.Utility.prototype.Initialize=function(b,a){this.m_textID=b;this.m_imageID=a};ThePortCalendar.Utility.prototype.onSelect=function(c){var b=c.params;var a=document.getElementById("StartDate");if(a!=null){a.value=c.date.print(b.ifFormat)}var d=(c.dateClicked||b.electric);if(d&&b.inputField){b.inputField.value=c.date.print(b.ifFormat);if(typeof b.inputField.onchange=="function"){b.inputField.onchange()}}if(d&&b.displayArea){b.displayArea.innerHTML=c.date.print(b.daFormat)}if(d&&typeof b.onUpdate=="function"){b.onUpdate(c)}if(d&&b.flat){if(typeof b.flatCallback=="function"){b.flatCallback(c)}}if(d&&b.singleClick&&c.dateClicked){c.callCloseHandler()}};ThePortCalendar.Utility.prototype.BindControlToCalendar=function(e,b,d,c){var a=[];a[0]=d;a[1]=c+19;Calendar.setup({align:"BR",showOthers:true,onClose:closed,button:b,inputField:e,position:a})};ThePortCalendar.Utility.prototype.BindControlToCalendarOverride=function(e,b,d,c){var a=[];a[0]=d;a[1]=c+19;Calendar.setup({align:"BR",showOthers:true,onClose:closed,button:b,inputField:e,position:a,eventName:"onfocus",onSelect:ThePortCalendar.Utility.prototype.onSelect})};ThePortCalendar.Utility.prototype.ShowPopupCal=function(a){a=window.event||a;Calendar.ShowPopupCal(a.clientX,a.clientY)};ThePortCalendar.Utility.prototype.BindSingleDateControl=function(d,c){var b;var e;var f;var a;var b=document.getElementById(d);var e=document.getElementById(c);f=ThePortCalendar.Utility.prototype.getElementTop(c);a=ThePortCalendar.Utility.prototype.getElementLeft(c);ThePortCalendar.Utility.prototype.BindControlToCalendarOverride(b,e,a,f)};ThePortCalendar.Utility.prototype.CreateDateRow=function(){var e=document.getElementById("divEventDates");var d=0;var h=ThePortCalendar.Utility.prototype.FormatDate(new Date());if(e.childNodes.length>0){d=e.childNodes.length-1;oEventDate=e.childNodes.item(d);var j=oEventDate.getAttribute("id");d=parseInt(j.substring(j.length-1,j.length));d+=1}var b=document.createElement("div");b.setAttribute("id","EventDate-"+d);b.setAttribute("class","tp_Event_DateTime_Row_Div");b.innerHTML="<input  type='checkbox' id='CheckBox-"+d+"'/>&nbsp;<label><b>Begins:</b></label> <input style='width:77px;' type='text' id='StartDate-"+d+"' readonly='readonly' value='"+h+"' /><!--<span>&nbsp;&nbsp;</span>--><img id='StartDateImage-"+d+"' src='/images/calendar/btn_calendar.gif' class='calendar_button'/> <span><b>at</b></span> <select id='ddhr-"+d+"'><option value='1'>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7' selected='selected'>7</option><option value='8'>8</option><option value='9'>9</option><option value='10'>10</option><option value='11'>11</option><option value='12'>12</option></select><select id='ddMin-"+d+"'><option value='00' selected='selected'>00</option><option value='01'>01</option><option value='02'>02</option><option value='03'>03</option><option value='04'>04</option><option value='05'>05</option><option value='06'>06</option><option value='07'>07</option><option value='08'>08</option><option value='09'>09</option><option value='10'>10</option><option value='11'>11</option><option value='12'>12</option><option value='13'>13</option><option value='14'>14</option><option value='15'>15</option><option value='16'>16</option><option value='17'>17</option><option value='18'>18</option><option value='19'>19</option><option value='20'>20</option><option value='21'>21</option><option value='22'>22</option><option value='23'>23</option><option value='24'>24</option><option value='25'>25</option><option value='26'>26</option><option value='27'>27</option><option value='28'>28</option><option value='29'>29</option><option value='30'>30</option><option value='31'>31</option><option value='32'>32</option><option value='33'>33</option><option value='34'>34</option><option value='35'>35</option><option value='36'>36</option><option value='37'>37</option><option value='38'>38</option><option value='39'>39</option><option value='40'>40</option><option value='41'>41</option><option value='42'>42</option><option value='43'>43</option><option value='44'>44</option><option value='45'>45</option><option value='46'>46</option><option value='47'>47</option><option value='48'>48</option><option value='49'>49</option><option value='50'>50</option><option value='51'>51</option><option value='52'>52</option><option value='53'>53</option><option value='54'>54</option><option value='55'>55</option><option value='56'>56</option><option value='57'>57</option><option value='58'>58</option><option value='59'>59</option></select><select id='ddAMPM-"+d+"'><option value='AM'>AM</option><option value='PM' selected='selected'>PM</option></select><span>&nbsp; for:</span><span>&nbsp;Days:</span><input id='DurationDays-"+d+"' type='text' style='width:23px' value='0'/><span>&nbsp;Hours:</span><input id='DurationHours-"+d+"' type='text' style='width:23px' value='1'/><span>&nbsp;Minutes:</span><input id='DurationMinutes-"+d+"' type='text' style='width:23px' value='0'/><input id='EventID-"+d+"' type='hidden' value='' /></div>";e.appendChild(b);var g=document.getElementById("StartDate-"+d);var f=document.getElementById("StartDateImage-"+d);var c;var a;c=ThePortCalendar.Utility.prototype.getElementTop("StartDateImage-"+d);a=ThePortCalendar.Utility.prototype.getElementLeft("StartDateImage-"+d);ThePortCalendar.Utility.prototype.BindControlToCalendar(g,f,a,c)};ThePortCalendar.Utility.prototype.RemoveDateRows=function(){var j=document.getElementById("divEventDates");var d=j.childNodes.length;var f=0;var h=0;var c=document.getElementById("EventDateDataRemove");var b;var a;c.value="";for(f=0;f<=d-1;f++){var e=document.getElementById("CheckBox-"+f);var g=e.checked;if(g==true){h+=1}}if(h<d){for(f=0;f<=d-1;f++){var e=document.getElementById("CheckBox-"+f);var g=e.checked;if(g==true){b=document.getElementById("EventID-"+f);c.value=c.value+b.value+"|";a=document.getElementById("EventDate-"+f);j.removeChild(a)}}if(c.value.length>0){c.value=c.value.substring(0,c.value.length-1)}ThePortCalendar.Utility.prototype.RecalibrateControls(d)}else{alert("There must be a minimum of one event date.")}};ThePortCalendar.Utility.prototype.SaveDates=function(){var o=document.getElementById("divEventDates");var e=o.childNodes.length;var m=document.getElementById("EventDateData");var s;var u;var f;var a;var d;var p;var w;var v;var y;var j;var b;var n;var g;m.value="";for(i=0;i<=e-1;i++){s=document.getElementById("EventID-"+i);u=document.getElementById("StartDate-"+i);f=document.getElementById("ddMin-"+i);j=f.options[f.selectedIndex];a=document.getElementById("ddhr-"+i);b=a.options[a.selectedIndex];v=document.getElementById("ddAMPM-"+i);n=v.options[v.selectedIndex];d=document.getElementById("DurationDays-"+i);p=document.getElementById("DurationHours-"+i);w=document.getElementById("DurationMinutes-"+i);if(d.value.length==0&&p.value.length==0&&w.value.length==0){alert("All dates must have a duration.");return false}if(d.value=="0"&&p.value=="0"&&w.value=="0"){alert("Duration must be greater than 0");return false}if(ThePortCalendar.Utility.prototype.IsNumeric(d.value)==false||d.value==""){alert("Duration for days must be numeric");return false}if(ThePortCalendar.Utility.prototype.IsNumeric(p.value)==false||p.value==""){alert("Duration for hours must be numeric");return false}if(ThePortCalendar.Utility.prototype.IsNumeric(w.value)==false||w.value==""){alert("Duration for minutes must be numeric");return false}dtToday=new Date();dtToday=new Date(dtToday.getFullYear(),dtToday.getMonth(),dtToday.getDate(),dtToday.getHours(),dtToday.getMinutes(),0);var r=parseInt(u.value.substring(6,10),10);var q=parseInt(u.value.substring(3,5),10);var h=parseInt(u.value.substring(0,2),10)-1;var z;var c=parseInt(j.value);if(v.value=="AM"){if(b.value==12){z=0}else{z=parseInt(b.value)}}else{if(b.value==12){z=12}else{z=parseInt(b.value)+12}}dtTempStartDate=new Date(r,h,q,z,c,0);if(dtTempStartDate<dtToday){alert("Event Date cannot be in the past.");return false}m.value=m.value+s.value+"^"+u.value+"^"+b.value+"^"+j.value+"^"+n.value+"^"+d.value+"^"+p.value+"^"+w.value+"|"}m.value=m.value.substring(0,m.value.length-1);return true};ThePortCalendar.Utility.prototype.ConvertToISO8601Date=function(e,c){var g="YYYY-MM-DDT00:00:00Z";var a=new Date();a=new Date(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0);var j;var f;var d;var h=0;var b;if(e==""){j=a.getFullYear();f=a.getDate();d=a.getMonth();b=new Date(j,d,f,0,0,0);d=d+1}else{j=parseInt(e.substring(6,10),10);f=parseInt(e.substring(3,5),10);d=parseInt(e.substring(0,2),10);b=new Date(j,d-1,f,0,0,0)}if(c=="true"){ThePortCalendar.Utility.prototype.DateAdd(b,"h",28);ThePortCalendar.Utility.prototype.DateAdd(a,"h",28);j=b.getFullYear();f=b.getDate();d=b.getMonth();d=d+1;h=b.getHours();if(e==""){g="*"}else{g="YYYY-MM-DDTHH:59:59Z"}}if(b<a){j=3000;f=1;d=1}if(d.toString().length==1){d="0"+d}if(h.toString().length==1){h="0"+h}g=g.replace("MM",d);g=g.replace("YYYY",j);g=g.replace("DD",f);g=g.replace("HH",h);return g};ThePortCalendar.Utility.prototype.DateAdd=function(c,b,a){switch(b){case"M":c.setMonth(parseInt(c.getMonth())+parseInt(a));break;case"D":c.setDate(parseInt(c.getDate())+parseInt(a));break;case"Y":c.setYear(parseInt(c.getYear())+parseInt(a));break;case"h":c.setHours(parseInt(c.getHours())+parseInt(a));break;case"m":c.setMinutes(parseInt(c.getMinutes())+parseInt(a));break;case"s":c.setSeconds(parseInt(c.getSeconds())+parseInt(a));break;case"uM":c.setUTCMonth(parseInt(c.getUTCMonth())+parseInt(a));break;case"uD":c.setUTCDate(parseInt(c.getUTCDate())+parseInt(a));break;case"uY":c.setUTCFullYear(parseInt(c.getUTCFullYear())+parseInt(a));break;case"uh":c.setUTCHours(parseInt(c.getUTCHours())+parseInt(a));break;case"um":c.setUTCMinutes(parseInt(c.getUTCMinutes())+parseInt(a));break;case"us":c.setUTCSeconds(parseInt(c.getUTCSeconds())+parseInt(a));break}return c};ThePortCalendar.Utility.prototype.RecalibrateControls=function(d){var p=document.getElementById("divEventDates");var c;var b;var a;var h;var e;var m;var q;var o;var n;var r;var g;var f=0;for(i=0;i<=d-1;i++){n=document.getElementById("EventDate-"+i);c=document.getElementById("EventID-"+i);b=document.getElementById("StartDate-"+i);a=document.getElementById("ddMin-"+i);h=document.getElementById("ddhr-"+i);o=document.getElementById("ddAMPM-"+i);e=document.getElementById("DurationDays-"+i);m=document.getElementById("DurationHours-"+i);q=document.getElementById("DurationMinutes-"+i);r=document.getElementById("StartDateImage-"+i);CheckBox=document.getElementById("CheckBox-"+i);if(n!=null){n.setAttribute("id","EventDate-"+f);c.setAttribute("id","EventID-"+f);b.setAttribute("id","StartDate-"+f);a.setAttribute("id","ddMin-"+f);h.setAttribute("id","ddhr-"+f);o.setAttribute("id","ddAMPM-"+f);e.setAttribute("id","DurationDays-"+f);m.setAttribute("id","DurationHours-"+f);q.setAttribute("id","DurationMinutes-"+f);r.setAttribute("id","StartDateImage-"+f);CheckBox.setAttribute("id","CheckBox-"+f);f+=1}}};ThePortCalendar.Utility.prototype.IsNumeric=function(b){var d="0123456789";var c=true;var a;for(k=0;k<b.length;k++){a=b.charAt(k);if(d.indexOf(a)==-1){c=false;break}}return c};ThePortCalendar.Utility.prototype.FormatDate=function(b){var e="MM/dd/yyyy";var d=b.getMonth()+1;var c=b.getFullYear();var a=b.getDate();if(d.toString().length==1){d="0"+d}if(a.toString().length==1){a="0"+a}e=e.replace("MM",d);e=e.replace("yyyy",c.toString());e=e.replace("dd",a);return e};ThePortCalendar.Utility.prototype.BindAllControls=function(){try{var d=document.getElementById("divEventDates");var h=d.childNodes.length;var c;var b;var g;var a;for(i=0;i<=h-1;i++){c=document.getElementById("StartDate-"+i);b=document.getElementById("StartDateImage-"+i);g=ThePortCalendar.Utility.prototype.getElementTop("StartDateImage-"+i);a=ThePortCalendar.Utility.prototype.getElementLeft("StartDateImage-"+i);ThePortCalendar.Utility.prototype.BindControlToCalendar(c,b,a,g)}}catch(f){}};ThePortCalendar.Utility.prototype.getElementTop=function(a){if(document.getElementById){var b=document.getElementById(a)}else{if(document.all){var b=document.all[a]}}yPos=b.offsetTop;tempEl=b.offsetParent;while(tempEl!=null){yPos+=tempEl.offsetTop;tempEl=tempEl.offsetParent}return yPos};ThePortCalendar.Utility.prototype.getElementLeft=function(a){if(document.getElementById){var b=document.getElementById(a)}else{if(document.all){var b=document.all[a]}}xPos=b.offsetLeft;tempEl=b.offsetParent;while(tempEl!=null){xPos+=tempEl.offsetLeft;tempEl=tempEl.offsetParent}return xPos};ThePortCalendar.Utility.prototype.Bind=function(){if(document.addEventListener){document.addEventListener("DOMContentLoaded",ThePortCalendar.Utility.prototype.BindAllControls,false)}else{window.onload=ThePortCalendar.Utility.prototype.BindAllControls}};ThePortCalendar.Utility.prototype.BindSingle=function(){if(document.addEventListener){document.addEventListener("DOMContentLoaded",this.BindSingleDateControl,false)}else{window.onload=this.BindSingleDateControl}};ThePortRegisterNS("ThePort.CommunityCalendar");ThePort.CommunityCalendar=function(){ThePort.CommunityCalendar.CalDates=[];ThePort.CommunityCalendar.CalendarDivID="";ThePort.CommunityCalendar.Width="";ThePort.CommunityCalendar.Height="";ThePort.CommunityCalendar.PartnerID="";ThePort.CommunityCalendar.prototype.TargetDiv="";ThePort.CommunityCalendar.prototype.PopupDiv=""};ThePort.CommunityCalendar.prototype.Initialize=function(f,b,d,a,c,e){ThePort.CommunityCalendar.prototype.CalDates=b.split(";");ThePort.CommunityCalendar.prototype.CalendarDivID=d;ThePort.CommunityCalendar.prototype.Width=a;ThePort.CommunityCalendar.prototype.Height=c;ThePort.CommunityCalendar.prototype.PartnerID=f;ThePort.CommunityCalendar.prototype.PopupDiv=e};ThePort.CommunityCalendar.prototype.Bind=function(){if(document.addEventListener){document.addEventListener("DOMContentLoaded",ThePort.CommunityCalendar.prototype.ShowFlatCalendar,false)}else{window.onload=ThePort.CommunityCalendar.prototype.ShowFlatCalendar}};ThePort.CommunityCalendar.prototype.ShowFlatCalendar=function(){var a=document.getElementById(ThePort.CommunityCalendar.prototype.CalendarDivID);ThePort.CommunityCalendar.prototype.BindFlatCalendar(a)},ThePort.CommunityCalendar.prototype.BindFlatCalendar=function(b){var a=[];for(i=0;i<=ThePort.CommunityCalendar.prototype.CalDates.length-1;i++){a[i]=new Date(ThePort.CommunityCalendar.prototype.CalDates[i])}Calendar.setup({align:"BR",showOthers:true,multiple:a,flat:b,width:ThePort.CommunityCalendar.prototype.Width,height:ThePort.CommunityCalendar.prototype.Height,onSelect:ThePort.CommunityCalendar.prototype.GetEventsForDate})};ThePort.CommunityCalendar.prototype.GetEventsForDate=function(b){if(b.dateClicked==true){var a=new ThePort.SMEventDateFetch();a.Initialize(ThePort.CommunityCalendar.prototype.PopupDiv);a.GetEventDates(ThePortCalendar.Utility.prototype.FormatDate(b.date),ThePort.CommunityCalendar.prototype.PartnerID)}};ThePortRegisterNS("ThePort.SMEventDateFetch");ThePort.SMEventDateFetch=function(){ThePort.SMEventDateFetch.prototype.PopupDiv=""};ThePort.SMEventDateFetch.prototype.Initialize=function(a){ThePort.SMEventDateFetch.prototype.PopupDiv=a};ThePort.SMEventDateFetch.prototype.GetEventDates=function(c,d){var a="";var b;b=encodeURI("/apis/services/socialobject/SOEventDateService.asmx/GetSOCommunityEventsByBeginDate");a+="BeginDate="+c;a+="&PartnerID="+d;ThePort.Utils.Ajax("POST",b,ThePort.Utils.Bind(this,"OnGetEventDatesResponse"),a)};ThePort.SMEventDateFetch.prototype.OnGetEventDatesResponse=function(c){try{var d=false;var b=new ThePort.ReplyObject(c.responseXML);var a=false;if((b.Response=="true")||(b.Response=="yes")||(b.Response=="1")){a=true}ThePort.SMEventDateFetch.prototype.EventDates_InResponse(a,b.Data)}catch(f){}return d};ThePort.SMEventDateFetch.prototype.EventDates_InResponse=function(a,b){if(a){ThePort.UI.PopWindow.OpenModalWindow(encodeURI("/app/render/pop.aspx?dict="+b),550,550)}else{}};ThePortRegisterNS("ThePort.UserCalendar");ThePort.UserCalendar=function(){ThePort.UserCalendar.CalDates=[];ThePort.UserCalendar.CalendarDivID="";ThePort.UserCalendar.Width="";ThePort.UserCalendar.Height="";ThePort.UserCalendar.PartnerID="";ThePort.UserCalendar.prototype.TargetDiv="";ThePort.UserCalendar.prototype.PopupDiv=""};ThePort.UserCalendar.prototype.Initialize=function(f,b,d,a,c,e){ThePort.UserCalendar.prototype.CalDates=b.split(";");ThePort.UserCalendar.prototype.CalendarDivID=d;ThePort.UserCalendar.prototype.Width=a;ThePort.UserCalendar.prototype.Height=c;ThePort.UserCalendar.prototype.PartnerID=f;ThePort.UserCalendar.prototype.PopupDiv=e};ThePort.UserCalendar.prototype.Bind=function(){if(document.addEventListener){document.addEventListener("DOMContentLoaded",ThePort.UserCalendar.prototype.ShowFlatCalendar,false)}else{window.onload=ThePort.UserCalendar.prototype.ShowFlatCalendar}};ThePort.UserCalendar.prototype.ShowFlatCalendar=function(){var a=document.getElementById(ThePort.UserCalendar.prototype.CalendarDivID);ThePort.UserCalendar.prototype.BindFlatCalendar(a)},ThePort.UserCalendar.prototype.BindFlatCalendar=function(b){var a=[];for(i=0;i<=ThePort.UserCalendar.prototype.CalDates.length-1;i++){a[i]=new Date(ThePort.UserCalendar.prototype.CalDates[i])}Calendar.setup({align:"BR",showOthers:true,multiple:a,flat:b,width:ThePort.UserCalendar.prototype.Width,height:ThePort.UserCalendar.prototype.Height,onSelect:ThePort.UserCalendar.prototype.GetEventsForDate})};var ourInterval;var origColor="";var overColor="";var scrollSpeed=30;var scrollHeight=5;function scrollStart(c,a,b){document.getElementById(b).style.backgroundColor=overColor;ourInterval=setInterval("scroll"+c+"('"+a+"')",scrollSpeed)}function scrollEnd(a){document.getElementById(a).style.backgroundColor=origColor;clearInterval(ourInterval)}function scrollUp(a){document.getElementById(a).scrollTop=document.getElementById(a).scrollTop-scrollHeight}function scrollDown(a){document.getElementById(a).scrollTop=document.getElementById(a).scrollTop+scrollHeight}var cbbLite={init:function(){if(!document.getElementById||!document.createElement||!document.appendChild){return false}var f,a,e,b,d;var g=document.getElementsByTagName("*");var h=new RegExp("(^|\\s)cbbLite(\\s|$)");for(var c=0;c<g.length;c++){f=g[c];if(h.test(f.className)){a=document.createElement("div");a.className=f.className.replace(h,"$1cb$2");if(f.getAttribute("id")){d=f.id;f.removeAttribute("id");a.setAttribute("id","");a.id=d}f.className="i3Lite";f.parentNode.replaceChild(a,f);e=document.createElement("div");e.className="i1Lite";a.appendChild(e);b=document.createElement("div");b.className="i2Lite";e.appendChild(b);b.appendChild(f);cbbLite.insertTop(a);cbbLite.insertBottom(a)}}},insertTop:function(b){var a,c;a=document.createElement("div");a.className="btLite";c=document.createElement("div");a.appendChild(c);b.insertBefore(a,b.firstChild)},insertBottom:function(b){var a,c;a=document.createElement("div");a.className="bbLite";c=document.createElement("div");a.appendChild(c);b.appendChild(a)},addEvent:function(c,b,a){if(c.addEventListener){c.addEventListener(b,a,false)}else{if(c.attachEvent){c["e"+b+a]=a;c[b+a]=function(){c["e"+b+a](window.event)};c.attachEvent("on"+b,c[b+a])}}}};cbbLite.addEvent(window,"load",cbbLite.init);var cbb={init:function(){if(!document.getElementById||!document.createElement||!document.appendChild){return false}var f,a,e,b,d;var g=document.getElementsByTagName("*");var h=new RegExp("(^|\\s)cbb(\\s|$)");for(var c=0;c<g.length;c++){f=g[c];if(h.test(f.className)){a=document.createElement("div");a.className=f.className.replace(h,"$1cb$2");if(f.getAttribute("id")){d=f.id;f.removeAttribute("id");a.setAttribute("id","");a.id=d}f.className="i3";f.parentNode.replaceChild(a,f);e=document.createElement("div");e.className="i1";a.appendChild(e);b=document.createElement("div");b.className="i2";e.appendChild(b);b.appendChild(f);cbb.insertTop(a);cbb.insertBottom(a)}}},insertTop:function(b){var a,c;a=document.createElement("div");a.className="bt";c=document.createElement("div");a.appendChild(c);b.insertBefore(a,b.firstChild)},insertBottom:function(b){var a,c;a=document.createElement("div");a.className="bb";c=document.createElement("div");a.appendChild(c);b.appendChild(a)},addEvent:function(c,b,a){if(c.addEventListener){c.addEventListener(b,a,false)}else{if(c.attachEvent){c["e"+b+a]=a;c[b+a]=function(){c["e"+b+a](window.event)};c.attachEvent("on"+b,c[b+a])}}}};cbb.addEvent(window,"load",cbb.init);