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.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_PARENTID:"sParentID",QS_CACHE_RESET:"SYS_CACHE_RESET",QS_MODKEY:"SYS_ModKey",QS_ACTIVITYID:"sActivityID",QS_ACTIVITYTYPEID:"sActivityTypeID",QS_OBJECTID:"sObjectID",QS_PROFILEID:"sProfileID",QS_OBJECTTYPEID:"sObjectTypeID",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",QS_USEBUSY:"iUseBusy",QS_SHOWCOMMENTINPUT:"iShowCommentInput",QS_EMPTYCOMMENTID:"sEmptyCommentID",CONST_DIV_TAG:"div",CONST_SPAN_TAG:"span",CONST_ANCHOR_TAG:"a",CONST_LISTITEM_TAG:"li",CONST_IMAGE_TAG:"img",CONST_STYLE_PX:"px",CONST_TRUE:"true",CONST_FALSE:"false",CONST_NUMERIC_FALSE:0,CONST_NUMERIC_TRUE:1,CONST_NUMERIC_TXT_FALSE:"0",CONST_NUMERIC_TXT_TRUE:"1",CONST_EVENT_MOUSEOVER:"mouseover",CONST_EVENT_MOUSEOUT:"mouseout",CONST_EVENT_CLICK:"click",CONST_SPACE:" ",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_INLINE:"inline",CONST_STYLE_DISPLAY_OFF:"none",CONST_URL_AJAX_REST_PROCESS:"/apis/Rest/RestService.ashx",CONST_URL_AJAX_XSLT_PROCESS:"/XSLT/Process.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}return ThePort.Utils.ReplaceQSVariable(c,a,d)},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(a,b){var c;if(typeof a==ThePort.Common.CONST_OBJECT_TYPE){c=a}else{c=ThePort.Utils.GetObj(a)}if(c){c.innerHTML=b}},SetNodeText:function(a,b){var c;if(typeof a==ThePort.Common.CONST_OBJECT_TYPE){c=a}else{c=ThePort.Utils.GetObj(a)}if(c!=null){if(document.all){c.innerText=b}else{c.textContent=b}}},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}},InsertAfter:function(b,c,a){b.insertBefore(c,a.nextSibling)},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)},AddHeadScriptTagSource:function(c){var b=document.getElementsByTagName("head")[0];var a=document.createElement("script");a.type=ThePort.Common.CONST_CONTENTTYPE_TXTJS;a.src=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)}},ReGenID:function(a){var b=ThePort.Utils.GetObj(a);if(b){b.id=ThePort.Utils.GenerateRandomID("ID");return b.id}return a},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(oNode,content,bAddModifier){var search=content;var script;if(!oNode){return}if(bAddModifier==true){oNode.innerHTML+=content}else{oNode.innerHTML=content}while(script=search.match(/(<script(.*?)>\s*(<!--)?)/i)){search=search.substr(search.indexOf(RegExp.$1)+RegExp.$1.length);if(!(endscript=search.match(/((-->)?\s*<\/script>)/))){break}block=search.substr(0,search.indexOf(RegExp.$1));search=search.substring(block.length+RegExp.$1.length);if(block.length>0){if(!ThePort.Utils.StringToBoolean(ThePort.Common.CONST_AJAXDEBUG,false)){var oScript=document.createElement("script");oScript.text=block;document.getElementsByTagName("head").item(0).appendChild(oScript)}else{eval(block)}}}ThePort.XSL.CallAllModuleFunction("StartVisibilityInterval")},LoadHTMLIntoNode:function(c,a){try{ThePort.Debug.LogModuleMsg("Replacing innerHTML & Executing ajax payload scripts.");ThePort.Utils.UpdateNode(c,a,false)}catch(b){ThePort.Debug.Log("Exception occured while processing ajax scripts.");ThePort.Debug.LogExx(b)}},AddHTMLIntoNode:function(c,a){try{ThePort.Debug.LogModuleMsg("Adding to innerHTML & Executing ajax payload scripts.");ThePort.Utils.UpdateNode(c,a,true)}catch(b){ThePort.Debug.Log("Exception occured while processing ajax scripts.");ThePort.Debug.LogExx(b)}},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(a){sCurrentURL=location.href;sHref="/login.aspx?rd="+sCurrentURL;if((typeof a!="undefined")&&(a.length>0)){sHref+="#"+a}location.href=sHref},RedirectToLoginAndBackToCurrentURL:function(){ThePort.Utils.RedirectToLoginPage()},RedirectToLoginAndBackToCurrentURLWithAnchor:function(a){ThePort.Utils.RedirectToLoginPage(a)},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},IntToBoolean:function(a){if(a==0){return false}return true},BooleanToString:function(a){if(a==true){return"true"}return"false"},BooleanToInt:function(a){if(a){return 1}return 0},UpdateObjectID:function(a,c){var b=ThePort.Utils.GetObj(a);if(b){b.id=c}},UpdateEntireObjectIDs:function(a,d){var b=ThePort.Utils.GetObj(a);if(b){var e=b.innerHTML;var c=e.replaceAll(a,d);b.id=d;b.innerHTML=c}},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()},GetClientAreaWidth:function(){var a=0;if(typeof(window.innerWidth)=="number"){a=window.innerWidth}else{if(document.documentElement&&(document.documentElement.clientWidth)){a=document.documentElement.clientWidth}else{if((document.body)&&(document.body.clientWidth)){a=document.body.clientWidth}}}return a},GetClientAreaHeight:function(){var a=0;if(typeof(window.innerHeight)=="number"){a=window.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){a=document.documentElement.clientHeight}else{if((document.body)&&(document.body.clientHeight)){a=document.body.clientHeight}}}return a}}}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_URL_AJAX_REST_PROCESS,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_URL_AJAX_REST_PROCESS,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.Dict=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");this.Dict=ThePort.Utils.GetTagValue(a,"Dict")}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;this.m_iUseAjaxPaging=1};ThePort.UI.Paging.prototype.DoNotUseAjax=function(){this.m_iUseAjaxPaging=0};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);if(this.m_iResultStart>((this.m_iCurrentPage-1)*this.m_iNumResults)+1){this.m_iCurrentPage++}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-2)*this.m_iNumResults+1,"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)*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}if(this.m_iUseAjaxPaging==1){oNode.onclick=ThePort.Utils.BinderNP(this,a,b)}else{try{oNode.href=ThePort.Utils.AddQueryStringParam(window.location.href,j,encodeURIComponent(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){if(a==(this.m_iCurrentPage-1)*this.m_iNumResults+1){return false}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(b==null){return}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};ThePort.Dictionary.prototype.GetKeyArray=function(){var a=new Array();for(key in this.sValues){if(typeof this.sValues[key]!=ThePort.Common.CONST_TYPE_FUNCTION){a.push(key)}}return a};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){sDebug=ThePort.Utils.GetQueryVariable(window.location.href,"tp_debug");if((sDebug!=null)&&(sDebug=="1")){ThePort.Debug.Enable()}}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=ThePort.Common.CONST_URL_AJAX_XSLT_PROCESS;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(ThePort.Utils.StringToBoolean(g.oDict.GetDictionaryKey(ThePort.Common.QS_USEBUSY),true)==false){return false}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{if(!a.m_busy){return}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){try{a.StopTimeout()}catch(b){}try{a.StopInterval()}catch(b){}try{a.NoBusy()}catch(b){}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(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;a.getviewpoint();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_URL_AJAX_REST_PROCESS};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(ThePort.Label.Get("WIDGET_ADMIN_ERROR_REDUCING_COLUMN_COUNT_MESSAGE")+(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.generateCommunityCreationXML=function(){var c,b,a;this.collectGarbage();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();return d};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("Data",this.m_dObj[a].GetDictionarySerializeString());xml.EndNode()}}}xml.EndNode()}catch(f){return false}var d=xml.ToString();this.generateCommunityCreationXML();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},ShowCommunityCreationXML:function(d){var b="";try{oLOM=ThePort.Layout.Manager.Utils.GetManagerPointer(d);if(oLOM){b=oLOM.generateCommunityCreationXML();content=b;var a=window.open("","myxmloutput","width=600,height=400,menubar=0,toolbar=1,status=0,scrollbars=1,resizable=1");a.document.writeln('<html><head><title>XML</title></head><body bgcolor="white" onLoad="self.focus()">'+ThePort.XSL.EscapeXML(b)+"</body></html>");a.document.close()}else{ThePort.Debug.Log("ERROR::Cannot ShowCommunityCreationXML on Manager Layout '"+d+"'.")}}catch(c){ThePort.Debug.LogExx(c)}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=ThePort.Common.CONST_URL_AJAX_XSLT_PROCESS+"?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=ThePort.Label.Get("WIDGET_ADMINTAB_LOCK_A_WIDGET_LABEL")}}else{ThePort.Utils.Hide(h);var b=this.findChildId("widgetAdminLockedMessage");if(b){b.innerHTML=ThePort.Label.Get("WIDGET_ADMINTAB_CANNOT_LOCK_WIDGET_LABEL")}}}else{if(this.m_fnUnLockable(this.m_sID)){ThePort.Utils.Show(h);var b=this.findChildId("widgetAdminLockedMessage");if(b){b.innerHTML=ThePort.Label.Get("WIDGET_ADMINTAB_LOCK_A_WIDGET_LABEL")}}else{ThePort.Utils.Hide(h);var b=this.findChildId("widgetAdminLockedMessage");if(b){b.innerHTML=ThePort.Label.Get("WIDGET_ADMIN_TAB_CANNOT_UNLOCK_TAB_LABEL")}}}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(ThePort.Label.Get("WIDGET_PROMPT_USER_TO_REMOVE_WIDGET_MESSAGE"))){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.GetDictionarySerializeString=function(){var a=new ThePort.Dictionary(this.m_oDict.ToCSV());a.RemoveDictionaryKey(ThePort.Common.QS_ID);a.RemoveDictionaryKey(ThePort.Common.QS_MODULEID);a.RemoveDictionaryKey(ThePort.Common.QS_PARENTID);return a.ToCSV()};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("widgetAdminConfigBtnSave"),"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='0' ";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=ThePort.Label.Get("WIDGET_ADD_WIDGETS_TEXT")}else{document.getElementById(a).style.display="block";c.innerHTML=ThePort.Label.Get("WIDGET_CLOSE_WIDGETS_TEXT");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)){ThePort.Scroll.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.Label")){ThePort.Label={oDict:new ThePort.Dictionary(),Add:function(a,b){ThePort.Label.oDict.PutDictionaryKey(a,b)},Get:function(a){return ThePort.Label.oDict.GetDictionaryKey(a)}}}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=0;var c=f.m_elem;var b=(c.contentDocument)?c.contentDocument:c.contentWindow.document;if((!this.m_IE)&&(b!=ThePort.Common.CONST_UNDEFINED)&&(b.documentElement!=ThePort.Common.CONST_UNDEFINED)&&(b.documentElement.offsetHeight!=ThePort.Common.CONST_UNDEFINED)){a=b.documentElement.offsetHeight}else{if((b.body)&&(b.body.offsetHeight)){a=0;if(typeof b.body.clientHeight!=ThePort.Common.CONST_UNDEFINED){a+=parseInt(b.body.clientHeight,10)}if(typeof b.body.topMargin!=ThePort.Common.CONST_UNDEFINED){a+=parseInt(b.body.topMargin,10)}else{if(typeof b.body.margin-top!=ThePort.Common.CONST_UNDEFINED){a+=parseInt(b.body.margin-top,10)}}if(typeof b.body.bottomMargin!=ThePort.Common.CONST_UNDEFINED){a+=parseInt(b.body.bottomMargin,10)}else{if(typeof b.body.margin-bottom!=ThePort.Common.CONST_UNDEFINED){a+=parseInt(b.body.margin-bottom,10)}}}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,e,d){var a=ThePort.Utils.GetObj(b);if(a.value==ThePort.Common.CONST_EMPTY_STRING){alert(d)}else{ThePort.XSL.CallModuleFunction(c,e,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}},SetLikeTextControls:function(q,d,e,g,n,a){var o;var j;var b="tp_likeBtnImg";var m=ThePort.Label.Get("GLOBAL_LIKE_TERM");var h=ThePort.Label.Get("GLOBAL_UNLIKE_TERM");var c="";var f;if(n==true){b="tp_likeBtnImgLiked";switch(a){case 1:o=ThePort.Label.Get("GLOBAL_YOU_LIKE_THIS_LABEL");break;case 2:o=ThePort.Label.Get("GLOBAL_YOU_AND_1_OTHER_LIKE_THIS_LABEL");break;default:o=ThePort.Label.Get("GLOBAL_YOU_AND_X_OTHERS_LIKE_THIS_LABEL").format(a-1);break}f=false;c=h}else{switch(a){case 0:o=m;break;case 1:o=ThePort.Label.Get("GLOBAL_1_USER_LIKES_THIS_LABEL");break;default:o=ThePort.Label.Get("GLOBAL_X_USERS_LIKE_THIS_LABEL").format(a);break}f=true;c=m}if(a==0){ThePort.Utils.SetInnerHTML(e,ThePort.Common.CONST_EMPTY_STRING)}else{ThePort.Utils.SetInnerHTML(e,a)}ThePort.Utils.GetObj(d).title=o;ThePort.Utils.SetClassName(g,b);var p=ThePort.Utils.GetObj(d);if(p){p.onclick=function(){ThePort.XSL.CallModuleFunction(q,"SetLike",f)}}}}}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";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};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.monthnames){Calendar._MN=c.monthnames}if(c.monthnamesabvr){Calendar._SMN=c.monthnamesabvr}if(c.daynames){Calendar._SDN=c.daynames}if(c.todaytext){Calendar._TT.TODAY=c.todaytext}if(c.selectdatetext){Calendar._TT.SEL_DATE=c.selectdatetext}if(c.prevyear){Calendar._TT.PREV_YEAR=c.prevyear}if(c.prevmonth){Calendar._TT.PREV_MONTH=c.prevmonth}if(c.nextmonth){Calendar._TT.NEXT_MONTH=c.nextmonth}if(c.nextyear){Calendar._TT.NEXT_YEAR=c.nextyear}if(c.partday){Calendar._TT.PART_TODAY=c.partday}if(c.gotoday){Calendar._TT.GO_TODAY=c.gotoday}if(c.daynamesfull){Calendar._DN=c.daynamesfull}if(c.displaytext&&c.firsttext){Calendar._TT.DAY_FIRST=c.displaytext+" %s "+c.firsttext}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(){ThePortCalendar.Utility.prototype.MonthNames=[];ThePortCalendar.Utility.prototype.DayNames=[];ThePortCalendar.Utility.TodayText="";ThePortCalendar.Utility.SelectDateText="";ThePortCalendar.Utility.PrevYear="";ThePortCalendar.Utility.PrevMonth="";ThePortCalendar.Utility.NextMonth="";ThePortCalendar.Utility.NextYear="";ThePortCalendar.Utility.MonthNamesAbvr=[];ThePortCalendar.Utility.PartDay="";ThePortCalendar.Utility.GoToday="";ThePortCalendar.Utility.DayNamesFull=[];ThePortCalendar.Utility.DisplayText="";ThePortCalendar.Utility.FirstText="";ThePortCalendar.Utility.DateDurationMsg="";ThePortCalendar.Utility.DurationGreaterThanZeroMsg="";ThePortCalendar.Utility.DurationDaysNumericMsg="";ThePortCalendar.Utility.DurationHoursNumericMsg="";ThePortCalendar.Utility.DurationMinutesNumeicMsg="";ThePortCalendar.Utility.DateNotInPastMsg="";ThePortCalendar.Utility.DateRequiredMsg="";ThePortCalendar.Utility.BeginsText="";ThePortCalendar.Utility.AtText="";ThePortCalendar.Utility.AMText="";ThePortCalendar.Utility.PMText="";ThePortCalendar.Utility.DaysText="";ThePortCalendar.Utility.HoursText="";ThePortCalendar.Utility.MinutesText="";ThePortCalendar.Utility.ForText="";ThePortCalendar.Utility.StartTextBoxID="";ThePortCalendar.Utility.ImageID=""};ThePortCalendar.Utility.prototype.Initialize=function(m,w,J,n,h,D,H,B,F,g,b,y,r,a,v,E,q,A,e,j,I,G,C,z,u,s,o,d,c,f,p){ThePortCalendar.Utility.prototype.MonthNames=m.split(";");ThePortCalendar.Utility.prototype.DayNames=w.split(";");ThePortCalendar.Utility.prototype.TodayText=J;ThePortCalendar.Utility.prototype.SelectDateText=n;ThePortCalendar.Utility.prototype.PrevYear=h;ThePortCalendar.Utility.prototype.PrevMonth=D;ThePortCalendar.Utility.prototype.NextMonth=H;ThePortCalendar.Utility.prototype.NextYear=B;ThePortCalendar.Utility.prototype.MonthNamesAbvr=F.split(";");ThePortCalendar.Utility.prototype.PartDay=g;ThePortCalendar.Utility.prototype.GoToday=b;ThePortCalendar.Utility.prototype.DayNamesFull=y.split(";");ThePortCalendar.Utility.prototype.DisplayText=r;ThePortCalendar.Utility.prototype.FirstText=a;ThePortCalendar.Utility.prototype.DateDurationMsg=v;ThePortCalendar.Utility.prototype.DurationGreaterThanZeroMsg=E;ThePortCalendar.Utility.prototype.DurationDaysNumericMsg=q;ThePortCalendar.Utility.prototype.DurationHoursNumericMsg=A;ThePortCalendar.Utility.prototype.DurationMinutesNumeicMsg=e;ThePortCalendar.Utility.prototype.DateNotInPastMsg=j;ThePortCalendar.Utility.prototype.DateRequiredMsg=I;ThePortCalendar.Utility.prototype.BeginsText=G;ThePortCalendar.Utility.prototype.AtText=C;ThePortCalendar.Utility.prototype.AMText=z;ThePortCalendar.Utility.prototype.PMText=u;ThePortCalendar.Utility.prototype.DaysText=s;ThePortCalendar.Utility.prototype.HoursText=o;ThePortCalendar.Utility.prototype.MinutesText=d;ThePortCalendar.Utility.prototype.ForText=c;ThePortCalendar.Utility.prototype.StartTextBoxID=f;ThePortCalendar.Utility.prototype.ImageID=p};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,monthnames:ThePortCalendar.Utility.prototype.MonthNames,daynames:ThePortCalendar.Utility.prototype.DayNames,todaytext:ThePortCalendar.Utility.prototype.TodayText,selectdatetext:ThePortCalendar.Utility.prototype.SelectDateText,prevyear:ThePortCalendar.Utility.prototype.PrevYear,prevmonth:ThePortCalendar.Utility.prototype.PrevMonth,nextmonth:ThePortCalendar.Utility.prototype.NextMonth,nextyear:ThePortCalendar.Utility.prototype.NextYear,monthnamesabvr:ThePortCalendar.Utility.prototype.MonthNamesAbvr,partday:ThePortCalendar.Utility.prototype.PartDay,gotoday:ThePortCalendar.Utility.prototype.GoToday,daynamesfull:ThePortCalendar.Utility.prototype.DayNamesFull,displaytext:ThePortCalendar.Utility.prototype.DisplayText,sfirsttext:ThePortCalendar.Utility.prototype.FirstText,userid:ThePort.UserCalendar.prototype.UserID})};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,monthnames:ThePortCalendar.Utility.prototype.MonthNames,daynames:ThePortCalendar.Utility.prototype.DayNames,todaytext:ThePortCalendar.Utility.prototype.TodayText,selectdatetext:ThePortCalendar.Utility.prototype.SelectDateText,prevyear:ThePortCalendar.Utility.prototype.PrevYear,prevmonth:ThePortCalendar.Utility.prototype.PrevMonth,nextmonth:ThePortCalendar.Utility.prototype.NextMonth,nextyear:ThePortCalendar.Utility.prototype.NextYear,monthnamesabvr:ThePortCalendar.Utility.prototype.MontNamesAbvr,partday:ThePortCalendar.Utility.prototype.PartDay,gotoday:ThePortCalendar.Utility.prototype.GoToday,daynamesfull:ThePortCalendar.Utility.prototype.DayNamesFull,displaytext:ThePortCalendar.Utility.prototype.DisplayText,sfirsttext:ThePortCalendar.Utility.prototype.FirstText,userid:ThePort.UserCalendar.prototype.UserID})};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.BindSingleDateControlOverride=function(){var b;var c;var d;var a;var b=document.getElementById(ThePortCalendar.Utility.prototype.StartTextBoxID);var c=document.getElementById(ThePortCalendar.Utility.prototype.ImageID);d=ThePortCalendar.Utility.prototype.getElementTop(ThePortCalendar.Utility.prototype.ImageID);a=ThePortCalendar.Utility.prototype.getElementLeft(ThePortCalendar.Utility.prototype.ImageID);ThePortCalendar.Utility.prototype.BindControlToCalendar(b,c,a,d)};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>"+ThePortCalendar.Utility.prototype.BeginsText+"</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>"+ThePortCalendar.Utility.prototype.AtText+"</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'>"+ThePortCalendar.Utility.prototype.AMText+"</option><option value='PM' selected='selected'>"+ThePortCalendar.Utility.prototype.PMText+"</option></select><span>&nbsp; "+ThePortCalendar.Utility.prototype.ForText+" </span><span>&nbsp;"+ThePortCalendar.Utility.prototype.DaysText+"</span><input id='DurationDays-"+d+"' type='text' style='width:23px' value='0'/><span>&nbsp;"+ThePortCalendar.Utility.prototype.HoursText+"</span><input id='DurationHours-"+d+"' type='text' style='width:23px' value='1'/><span>&nbsp;"+ThePortCalendar.Utility.prototype.MinutesText+"</span><input id='DurationMinutes-"+d+"' type='text' style='width:23px' value='0'/><input id='EventID-"+d+"' type='hidden' value='' /></div><br/>";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(ThePortCalendar.Utility.prototype.DateRequiredMsg)}};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(ThePortCalendar.Utility.prototype.DateDurationMsg);return false}if(d.value=="0"&&p.value=="0"&&w.value=="0"){alert(ThePortCalendar.Utility.prototype.DurationGreaterThanZeroMsg);return false}if(ThePortCalendar.Utility.prototype.IsNumeric(d.value)==false||d.value==""){alert(ThePortCalendar.Utility.prototype.DurationDaysNumericMsg);return false}if(ThePortCalendar.Utility.prototype.IsNumeric(p.value)==false||p.value==""){alert(ThePortCalendar.Utility.prototype.DurationHoursNumericMsg);return false}if(ThePortCalendar.Utility.prototype.IsNumeric(w.value)==false||w.value==""){alert(ThePortCalendar.Utility.prototype.DurationMinutesNumeicMsg);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(ThePortCalendar.Utility.prototype.DateNotInPastMsg);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.SaveDatesStreamlined=function(){var o=document.getElementById("divEventDates");var e=1;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(ThePortCalendar.Utility.prototype.DateDurationMsg);return false}if(d.value=="0"&&p.value=="0"&&w.value=="0"){alert(ThePortCalendar.Utility.prototype.DurationGreaterThanZeroMsg);return false}if(ThePortCalendar.Utility.prototype.IsNumeric(d.value)==false||d.value==""){alert(ThePortCalendar.Utility.prototype.DurationDaysNumericMsg);return false}if(ThePortCalendar.Utility.prototype.IsNumeric(p.value)==false||p.value==""){alert(ThePortCalendar.Utility.prototype.DurationHoursNumericMsg);return false}if(ThePortCalendar.Utility.prototype.IsNumeric(w.value)==false||w.value==""){alert(ThePortCalendar.Utility.prototype.DurationMinutesNumeicMsg);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(ThePortCalendar.Utility.prototype.DateNotInPastMsg);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",ThePortCalendar.Utility.prototype.BindSingleDateControl,false)}else{window.onload=ThePortCalendar.Utility.prototype.BindSingleDateControl}};ThePortCalendar.Utility.prototype.BindSingleOverride=function(){if(document.addEventListener){document.addEventListener("DOMContentLoaded",ThePortCalendar.Utility.prototype.BindSingleDateControlOverride,false)}else{window.onload=ThePortCalendar.Utility.prototype.BindSingleDateControlOverride}};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.MonthNames=[];ThePort.CommunityCalendar.DayNames=[];ThePort.CommunityCalendar.TodayText="";ThePort.CommunityCalendar.SelectDateText="";ThePort.CommunityCalendar.PrevYear="";ThePort.CommunityCalendar.PrevMonth="";ThePort.CommunityCalendar.NextMonth="";ThePort.CommunityCalendar.NextYear="";ThePort.CommunityCalendar.MontNamesAbvr=[];ThePort.CommunityCalendar.PartDay="";ThePort.CommunityCalendar.GoToday="";ThePort.CommunityCalendar.DayNamesFull=[];ThePort.CommunityCalendar.DisplayText="";ThePort.CommunityCalendar.FirstText=""};ThePort.CommunityCalendar.prototype.Initialize=function(j,e,p,o,d,m,g,q,y,h,f,u,w,s,v,c,b,r,n,a){ThePort.CommunityCalendar.prototype.CalDates=e.split(";");ThePort.CommunityCalendar.prototype.CalendarDivID=p;ThePort.CommunityCalendar.prototype.Width=o;ThePort.CommunityCalendar.prototype.Height=d;ThePort.CommunityCalendar.prototype.PartnerID=j;ThePort.CommunityCalendar.prototype.PopupDiv=m;ThePort.CommunityCalendar.prototype.MonthNames=g.split(";");ThePort.CommunityCalendar.prototype.DayNames=q.split(";");ThePort.CommunityCalendar.prototype.TodayText=y;ThePort.CommunityCalendar.prototype.SelectDateText=h;ThePort.CommunityCalendar.prototype.PrevYear=f;ThePort.CommunityCalendar.prototype.PrevMonth=u;ThePort.CommunityCalendar.prototype.NextMonth=w;ThePort.CommunityCalendar.prototype.NextYear=s;ThePort.CommunityCalendar.prototype.MontNamesAbvr=v.split(";");ThePort.CommunityCalendar.prototype.PartDay=c;ThePort.CommunityCalendar.prototype.GoToday=b;ThePort.CommunityCalendar.prototype.DayNamesFull=r.split(";");ThePort.CommunityCalendar.prototype.DisplayText=n;ThePort.CommunityCalendar.prototype.FirstText=a;ThePort.CommunityCalendar.prototype.UserID=null};ThePort.CommunityCalendar.prototype.InitializeByUserID=function(j,e,q,p,d,n,g,r,z,h,f,v,y,u,w,c,b,s,o,a,m){ThePort.CommunityCalendar.prototype.CalDates=e.split(";");ThePort.CommunityCalendar.prototype.CalendarDivID=q;ThePort.CommunityCalendar.prototype.Width=p;ThePort.CommunityCalendar.prototype.Height=d;ThePort.CommunityCalendar.prototype.PartnerID=j;ThePort.CommunityCalendar.prototype.PopupDiv=n;ThePort.CommunityCalendar.prototype.MonthNames=g.split(";");ThePort.CommunityCalendar.prototype.DayNames=r.split(";");ThePort.CommunityCalendar.prototype.TodayText=z;ThePort.CommunityCalendar.prototype.SelectDateText=h;ThePort.CommunityCalendar.prototype.PrevYear=f;ThePort.CommunityCalendar.prototype.PrevMonth=v;ThePort.CommunityCalendar.prototype.NextMonth=y;ThePort.CommunityCalendar.prototype.NextYear=u;ThePort.CommunityCalendar.prototype.MontNamesAbvr=w.split(";");ThePort.CommunityCalendar.prototype.PartDay=c;ThePort.CommunityCalendar.prototype.GoToday=b;ThePort.CommunityCalendar.prototype.DayNamesFull=s.split(";");ThePort.CommunityCalendar.prototype.DisplayText=o;ThePort.CommunityCalendar.prototype.FirstText=a;ThePort.CommunityCalendar.prototype.UserID=m};ThePort.CommunityCalendar.prototype.Bind=function(){this.ShowFlatCalendar();return;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(this.CalendarDivID);this.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,monthnames:ThePort.CommunityCalendar.prototype.MonthNames,daynames:ThePort.CommunityCalendar.prototype.DayNames,todaytext:ThePort.CommunityCalendar.prototype.TodayText,selectdatetext:ThePort.CommunityCalendar.prototype.SelectDateText,prevyear:ThePort.CommunityCalendar.prototype.PrevYear,prevmonth:ThePort.CommunityCalendar.prototype.PrevMonth,nextmonth:ThePort.CommunityCalendar.prototype.NextMonth,nextyear:ThePort.CommunityCalendar.prototype.NextYear,monthnamesabvr:ThePort.CommunityCalendar.prototype.MontNamesAbvr,partday:ThePort.CommunityCalendar.prototype.PartDay,gotoday:ThePort.CommunityCalendar.prototype.GoToday,daynamesfull:ThePort.CommunityCalendar.prototype.DayNamesFull,displaytext:ThePort.CommunityCalendar.prototype.DisplayText,firsttext:ThePort.CommunityCalendar.prototype.FirstText,userid:ThePort.UserCalendar.prototype.UserID})};ThePort.CommunityCalendar.prototype.GetEventsForDate=function(b){if(b.dateClicked==true){if(ThePort.CommunityCalendar.prototype.UserID==null){var a=new ThePort.SMEventDateFetch();a.Initialize(ThePort.CommunityCalendar.prototype.PopupDiv);a.GetEventDates(ThePortCalendar.Utility.prototype.FormatDate(b.date),ThePort.CommunityCalendar.prototype.PartnerID)}else{var a=new ThePort.SMEventDateFetch();a.Initialize(ThePort.CommunityCalendar.prototype.PopupDiv);a.GetEventDatesByUser(ThePortCalendar.Utility.prototype.FormatDate(b.date),ThePort.CommunityCalendar.prototype.PartnerID,ThePort.CommunityCalendar.prototype.UserID)}}};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.GetEventDatesByUser=function(d,e,b){var a="";var c;c=encodeURI("/apis/services/socialobject/SOEventDateService.asmx/GetUserSOEventsByBeginDateByUser");a+="BeginDate="+d;a+="&PartnerID="+e;a+="&UserID="+b;ThePort.Utils.Ajax("POST",c,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.prototype.TargetDiv="";ThePort.UserCalendar.MonthNames=[];ThePort.UserCalendar.DayNames=[];ThePort.UserCalendar.StartDate="";ThePort.UserCalendar.TodayText="";ThePort.UserCalendar.SelectDateText="";ThePort.UserCalendar.PrevYear="";ThePort.UserCalendar.PrevMonth="";ThePort.UserCalendar.NextMonth="";ThePort.UserCalendar.NextYear="";ThePort.UserCalendar.MontNamesAbvr=[];ThePort.UserCalendar.PartDay="";ThePort.UserCalendar.GoToday="";ThePort.UserCalendar.DayNamesFull=[];ThePort.UserCalendar.DisplayText="";ThePort.UserCalendar.FirstText="";ThePort.UserCalendara.UserID=null};ThePort.UserCalendar.prototype.Initialize=function(e,o,n,d,g,p,m,w,h,f,s,v,r,u,c,b,q,j,a){ThePort.UserCalendar.prototype.CalDates=e.split(";");ThePort.UserCalendar.prototype.CalendarDivID=o;ThePort.UserCalendar.prototype.Width=n;ThePort.UserCalendar.prototype.Height=d;ThePort.UserCalendar.prototype.MonthNames=g.split(";");ThePort.UserCalendar.prototype.DayNames=p.split(";");ThePort.UserCalendar.prototype.StartDate=m;ThePort.UserCalendar.prototype.TodayText=w;ThePort.UserCalendar.prototype.SelectDateText=h;ThePort.UserCalendar.prototype.PrevYear=f;ThePort.UserCalendar.prototype.PrevMonth=s;ThePort.UserCalendar.prototype.NextMonth=v;ThePort.UserCalendar.prototype.NextYear=r;ThePort.UserCalendar.prototype.MontNamesAbvr=u.split(";");ThePort.UserCalendar.prototype.PartDay=c;ThePort.UserCalendar.prototype.GoToday=b;ThePort.UserCalendar.prototype.DayNamesFull=q.split(";");ThePort.UserCalendar.prototype.DisplayText=j;ThePort.UserCalendar.prototype.FirstText=a;ThePort.UserCalendar.prototype.UserID=null};ThePort.UserCalendar.prototype.InitializeByUserID=function(e,p,o,d,g,q,n,y,h,f,u,w,s,v,c,b,r,m,a,j){ThePort.UserCalendar.prototype.CalDates=e.split(";");ThePort.UserCalendar.prototype.CalendarDivID=p;ThePort.UserCalendar.prototype.Width=o;ThePort.UserCalendar.prototype.Height=d;ThePort.UserCalendar.prototype.MonthNames=g.split(";");ThePort.UserCalendar.prototype.DayNames=q.split(";");ThePort.UserCalendar.prototype.StartDate=n;ThePort.UserCalendar.prototype.TodayText=y;ThePort.UserCalendar.prototype.SelectDateText=h;ThePort.UserCalendar.prototype.PrevYear=f;ThePort.UserCalendar.prototype.PrevMonth=u;ThePort.UserCalendar.prototype.NextMonth=w;ThePort.UserCalendar.prototype.NextYear=s;ThePort.UserCalendar.prototype.MontNamesAbvr=v.split(";");ThePort.UserCalendar.prototype.PartDay=c;ThePort.UserCalendar.prototype.GoToday=b;ThePort.UserCalendar.prototype.DayNamesFull=r.split(";");ThePort.UserCalendar.prototype.DisplayText=m;ThePort.UserCalendar.prototype.FirstText=a;ThePort.UserCalendar.prototype.UserID=j};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,monthnames:ThePort.UserCalendar.prototype.MonthNames,daynames:ThePort.UserCalendar.prototype.DayNames,onSelect:ThePort.UserCalendar.prototype.PostSelectedDate,date:ThePort.UserCalendar.prototype.StartDate,todaytext:ThePort.UserCalendar.prototype.TodayText,selectdatetext:ThePort.UserCalendar.prototype.SelectDateText,prevyear:ThePort.UserCalendar.prototype.PrevYear,prevmonth:ThePort.UserCalendar.prototype.PrevMonth,nextmonth:ThePort.UserCalendar.prototype.NextMonth,nextyear:ThePort.UserCalendar.prototype.NextYear,monthnamesabvr:ThePort.UserCalendar.prototype.MontNamesAbvr,partday:ThePort.UserCalendar.prototype.PartDay,gotoday:ThePort.UserCalendar.prototype.GoToday,daynamesfull:ThePort.UserCalendar.prototype.DayNamesFull,displaytext:ThePort.UserCalendar.prototype.DisplayText,firsttext:ThePort.UserCalendar.prototype.FirstText,userid:ThePort.UserCalendar.prototype.UserID})};ThePort.UserCalendar.prototype.PostSelectedDate=function(b){if(b.dateClicked==true){__doPostBack("CalendarClick",ThePortCalendar.Utility.prototype.FormatDate(b.date))}else{var a=new Date();__doPostBack("NonCalendarClick",ThePortCalendar.Utility.prototype.FormatDate(b.date))}};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}ThePortRegisterNS("ThePort.BlogPostHelper");ThePortRegisterNS("ThePort.BlogPostHelper.Category");ThePort.BlogPostHelper.Category=function(){this.m_sAddCategoryURL="/apis/Services/Blogs/PostCategory.ashx";this.oAjaxDict=new ThePort.Dictionary("");this.oCheckedDict=new ThePort.Dictionary("");this.oAllDict=new ThePort.Dictionary("");this.m_sCategoryRowTemplate=null;this.m_oCatList=null;this.m_oCatCheckedList=null;this.m_oCatDiv=null};ThePort.BlogPostHelper.Category.prototype.AddCategory=function(c,a){oNode=ThePort.Utils.GetObj(c);if(typeof oNode==ThePort.Common.CONST_UNDEFINED){return}if(oNode.value==""){alert("Please enter a category.");return}this.oAjaxDict.AddStringPair("sBlogCategory",oNode.value);oNode.value=ThePort.Common.CONST_EMPTY_STRING;this.oAjaxDict.AddStringPair("sBlogID",a);sPostData=ThePort.Utils.GetVariablePair(ThePort.Common.QS_DATA,this.oAjaxDict.ToCSV());ThePort.XSL.AjaxPost(this.m_sAddCategoryURL,sPostData,ThePort.Utils.AjaxBind(this,"onAddCategory"))};ThePort.BlogPostHelper.Category.prototype.onAddCategory=function(c){var a=new ThePort.ReplyObject(c.responseXML);if(a.Response!="true"){alert(a.Message);return}var d=new ThePort.XMLProcessor();d.loadXMLText(a.Data);var e=d.getTagValue("ID");var b=d.getTagValue("Category");this.AddCategoryToList(e,b)};ThePort.BlogPostHelper.Category.prototype.Initialize=function(c,d,b,a){this.m_oCatList=ThePort.Utils.GetObj(c);this.m_oCatCheckedList=ThePort.Utils.GetObj(b);this.m_oCatDiv=ThePort.Utils.GetObj(d);this.m_sCategoryRowTemplate=a;this.BuildCategoryList()};ThePort.BlogPostHelper.Category.prototype.BuildCategoryList=function(){if(typeof this.m_oCatList==ThePort.Common.CONST_UNDEFINED){return}if(this.m_oCatList.value==""){return}this.oAllDict.ResetDictionary();this.oAllDict.FromCSV(this.m_oCatList.value);var a=this.oAllDict.GetArraySortedByValue();var c="";for(var b=0;b<a.length;b++){c+=this.m_sCategoryRowTemplate.replace(/%id%/g,a[b][0]).replace(/%title%/g,a[b][1])}this.m_oCatDiv.innerHTML=c;if(typeof this.m_oCatCheckedList==ThePort.Common.CONST_UNDEFINED){return}this.oCheckedDict.ResetDictionary();this.oCheckedDict.KeysFromCSV(this.m_oCatCheckedList.value);for(key in this.oCheckedDict.Items()){if(typeof this.oCheckedDict.Items()[key]!=ThePort.Common.CONST_TYPE_FUNCTION){var d=ThePort.Utils.GetObj("tp_cb_cat_"+key);if(typeof d!=ThePort.Common.CONST_UNDEFINED){if(d){d.checked=true}}}}};ThePort.BlogPostHelper.Category.prototype.AddCategoryToCheckedList=function(a){if(typeof this.m_oCatCheckedList==ThePort.Common.CONST_UNDEFINED){return}if(this.m_oCatCheckedList.value==""){this.m_oCatCheckedList.value=a}else{this.oCheckedDict.ResetDictionary();this.oCheckedDict.KeysFromCSV(this.m_oCatCheckedList.value);this.oCheckedDict.AddStringPair(a,a);this.m_oCatCheckedList.value=this.oCheckedDict.KeysToCSV()}};ThePort.BlogPostHelper.Category.prototype.RemoveCategoryFromCheckedList=function(a){if(typeof this.m_oCatCheckedList==ThePort.Common.CONST_UNDEFINED){return}if(this.m_oCatCheckedList.value==""){return}else{this.oCheckedDict.ResetDictionary();this.oCheckedDict.KeysFromCSV(this.m_oCatCheckedList.value);this.oCheckedDict.RemoveDictionaryKey(a);this.m_oCatCheckedList.value=this.oCheckedDict.KeysToCSV()}};ThePort.BlogPostHelper.Category.prototype.AdjustCategoryCheckedList=function(a,b){if(a.checked){this.AddCategoryToCheckedList(b)}else{this.RemoveCategoryFromCheckedList(b)}};ThePort.BlogPostHelper.Category.prototype.AddCategoryToList=function(a,b){if(typeof this.m_oCatList==ThePort.Common.CONST_UNDEFINED){return}this.oAllDict.ResetDictionary();this.oAllDict.FromCSV(this.m_oCatList.value);this.oAllDict.AddStringPair(a,b);this.m_oCatList.value=this.oAllDict.ToCSV();this.AddCategoryToCheckedList(a);this.BuildCategoryList()};ThePortRegisterNS("ThePort.BlogPostHelper.Title");ThePort.BlogPostHelper.Title=function(){this.m_sLinkContainer=null;this.m_sLinkTextbox=null;this.m_sAddLink=null};ThePort.BlogPostHelper.Title.prototype.Initialize=function(){this.m_sLinkContainer=ThePort.Utils.GetObj(arguments[0]);this.m_sLinkTextbox=ThePort.Utils.GetObj(arguments[1]);this.m_sAddLink=ThePort.Utils.GetObj(arguments[2])};ThePort.BlogPostHelper.Title.prototype.Open=function(){ThePort.Utils.Show(this.m_sLinkContainer.id);ThePort.Utils.Hide(this.m_sAddLink.id)};ThePort.BlogPostHelper.Title.prototype.OnBlur=function(){if(this.m_sLinkTextbox.value.trim()==ThePort.Common.CONST_EMPTY_STRING){this.m_sLinkTextbox.value=ThePort.Common.CONST_EMPTY_STRING;ThePort.Utils.Hide(this.m_sLinkContainer.id);ThePort.Utils.Show(this.m_sAddLink.id)}};ThePortRegisterNS("ThePort.BlogPostHelper.PubDate");ThePort.BlogPostHelper.PubDate=function(){this.m_sPubDayDropdown=null;this.m_sPubMonthDropdown=null;this.m_sPubYearDropdown=null;this.m_sPubHourDropdown=null;this.m_sPubMinuteDropdown=null;this.m_sPubAMPMDropdown=null;this.m_sPubDateAction=null;this.m_sPubButtonId=null;this.m_sPubButton=null;this.m_sPubDateDescription=null;this.m_sPubDateMgtSection=null;this.m_sPubNewDate=null;this.m_sPubEditLink=null;this.m_sPubImmediateDate=null;this.m_sSavePost=null;this.m_sPublishPost=null;this.m_sAt=null;this.m_sPublishOn=null;this.m_sScheduledFor=null;this.m_sPublishColon=null;this.m_sImmediately=null;this.m_sJan=null;this.m_sFeb=null;this.m_sMar=null;this.m_sApr=null;this.m_sMay=null;this.m_sJun=null;this.m_sJul=null;this.m_sAug=null;this.m_sSept=null;this.m_sOct=null;this.m_sNov=null;this.m_sDec=null};ThePort.BlogPostHelper.PubDate.prototype.IsPublishDateMgtOpen=function(){if(this.m_sPubDateMgtSection.style.display!="none"){return true}return false};ThePort.BlogPostHelper.PubDate.prototype.Initialize=function(){var a=arguments[0].split(",");this.m_sPubDayDropdown=ThePort.Utils.GetObj(a[0]);this.m_sPubMonthDropdown=ThePort.Utils.GetObj(a[1]);this.m_sPubYearDropdown=ThePort.Utils.GetObj(a[2]);this.m_sPubHourDropdown=ThePort.Utils.GetObj(a[3]);this.m_sPubMinuteDropdown=ThePort.Utils.GetObj(a[4]);this.m_sPubAMPMDropdown=ThePort.Utils.GetObj(a[5]);this.m_sPubDateAction=ThePort.Utils.GetObj(a[6]);this.m_sPubButton=ThePort.Utils.GetObj(a[7]);this.m_sPubDateDescription=ThePort.Utils.GetObj(a[8]);this.m_sPubDateMgtSection=ThePort.Utils.GetObj(a[9]);this.m_sPubNewDate=ThePort.Utils.GetObj(a[10]);this.m_sPubEditLink=ThePort.Utils.GetObj(a[11]);this.m_sPubImmediateDate=ThePort.Utils.GetObj(a[12]);this.m_sSavePost=a[13];this.m_sPublishPost=a[14];this.m_sAt=a[15];this.m_sPublishOn=a[16];this.m_sScheduledFor=a[17];this.m_sPublishColon=a[18];this.m_sImmediately=a[19];this.m_sJan=a[20];this.m_sFeb=a[21];this.m_sMar=a[22];this.m_sApr=a[23];this.m_sMay=a[24];this.m_sJun=a[25];this.m_sJul=a[26];this.m_sAug=a[27];this.m_sSept=a[28];this.m_sOct=a[29];this.m_sNov=a[30];this.m_sDec=a[31];var b=new Date(this.m_sPubImmediateDate.value);var c=new Date(this.m_sPubNewDate.value);if(c>b){this.m_sPubButton.value=this.m_sSavePost}else{this.m_sPubButton.value=this.m_sPublishPost}};ThePort.BlogPostHelper.PubDate.prototype.SetPubDate=function(){var a=this.AssemblePubDate();this.m_sPubNewDate.value=a;ThePort.Utils.Hide(this.m_sPubDateMgtSection.id);this.m_sPubDateDescription.innerHTML=a.replace(/ /," "+this.m_sAt+" ");ThePort.Utils.Show(this.m_sPubEditLink.id);var b=new Date(this.m_sPubImmediateDate.value);var c=new Date(this.m_sPubNewDate.value);this.m_sPubButton.value=this.m_sPublishPost;this.m_sPubDateAction.innerHTML=this.m_sPublishOn;if(c>b){this.m_sPubButton.value=this.m_sSavePost;this.m_sPubDateAction.innerHTML=this.m_sScheduledFor+" "}};ThePort.BlogPostHelper.PubDate.prototype.EditPubDate=function(){this.PopulatePubDate(this.m_sPubNewDate.value);ThePort.Utils.Toggle(this.m_sPubDateMgtSection.id);ThePort.Utils.Hide(this.m_sPubEditLink.id)};ThePort.BlogPostHelper.PubDate.prototype.CancelPubDate=function(){this.m_sPubNewDate.value=this.m_sPubImmediateDate.value;ThePort.Utils.Hide(this.m_sPubDateMgtSection.id);this.m_sPubDateAction.innerHTML=this.m_sPublishColon;this.m_sPubDateDescription.innerHTML=this.m_sImmediately;this.m_sPubButton.value=this.m_sPublishPost;ThePort.Utils.Show(this.m_sPubEditLink.id)};ThePort.BlogPostHelper.PubDate.prototype.AssemblePubDate=function(){var c=this.m_sPubDayDropdown.selectedIndex+1;var g=this.m_sPubMonthDropdown.selectedIndex+1;var e=this.m_sPubYearDropdown.options[this.m_sPubYearDropdown.selectedIndex].value;var b=0;if(this.m_sPubHourDropdown){b=this.m_sPubHourDropdown.selectedIndex+1}var h=0;if(this.m_sPubMinuteDropdown){h=this.m_sPubMinuteDropdown.selectedIndex}var f="AM";if(this.m_sPubAMPMDropdown){f=this.m_sPubAMPMDropdown.options[this.m_sPubAMPMDropdown.selectedIndex].value}var d=new Date(g+"/"+c+"/"+e+"/ "+b+":"+h+" "+f);var a=(d.getMonth()+1)+"/"+d.getDate()+"/"+d.getFullYear();h=d.getMinutes();if(h<10){h="0"+h}if(d.getHours()>11){a=a+" "+(d.getHours()==12?12:d.getHours()-12)+":"+h+" pm"}else{a=a+" "+(d.getHours()==0?12:d.getHours())+":"+h+" am"}return a};ThePort.BlogPostHelper.PubDate.prototype.PopulatePubDate=function(b){var g=[this.m_sJan,this.m_sFeb,this.m_sMar,this.m_sApr,this.m_sMay,this.m_sJun,this.m_sJul,this.m_sAug,this.m_sSept,this.m_sOct,this.m_sNov,this.m_sDec];var q=[2007,2008,2009,2010,2011,2012,2013,2014,2015];var d=["AM","PM"];var c=new Date(b);var j=this.m_sPubDayDropdown;var s=this.m_sPubMonthDropdown;var n=this.m_sPubYearDropdown;if(this.m_sPubHourDropdown){var p=this.m_sPubHourDropdown}if(this.m_sPubMinuteDropdown){var o=this.m_sPubMinuteDropdown}if(this.m_sPubAMPMDropdown){var e=this.m_sPubAMPMDropdown}for(var h=0;h<31;h++){j.options[h]=new Option(h+1,h+1)}for(var h=0;h<31;h++){if(j.options[h].value==c.getDate()){j.options[h].selected=true}}for(var a=0;a<12;a++){s.options[a]=new Option(g[a],a+1)}for(var a=0;a<12;a++){if(s.options[a].value==c.getMonth()+1){s.options[a].selected=true}}for(var r=0;r<q.length;r++){n.options[r]=new Option(q[r],q[r])}for(var r=0;r<q.length;r++){if(n.options[r].value==c.getFullYear()){n.options[r].selected=true}}if(this.m_sPubHourDropdown){for(var h=0;h<12;h++){p.options[h]=new Option(h+1,h+1)}var u=c.getHours();if(u>12){u=u-12}if(u==0){u=12}for(var h=0;h<12;h++){if(p.options[h].value==u){p.options[h].selected=true}}}if(this.m_sPubMinuteDropdown){for(var h=0;h<60;h++){var f=h;if(h<10){f="0"+h}o.options[h]=new Option(f,h+1)}for(var h=0;h<60;h++){if(o.options[h].value==c.getMinutes()+1){o.options[h].selected=true}}}if(this.m_sPubAMPMDropdown){e.options[0]=new Option(d[0],d[0]);e.options[1]=new Option(d[1],d[1]);if(c.getHours()>11){e.selectedIndex=1}}};ThePortRegisterNS("ThePort.BlogCategoryHelper");ThePort.BlogCategoryHelper=function(a,b){this.m_sEditCategoryUrl="/editor/app/blog/windows/editcategory.aspx";this.m_oActiveWindow=null;this.m_oHdnPagerIndex=null;this.m_iCurrentPage=null};ThePort.BlogCategoryHelper.prototype.Initialize=function(b,a){this.m_oHdnPagerIndex=ThePort.Utils.GetObj(b);this.m_iCurrentPage=a};ThePort.BlogCategoryHelper.prototype.ConfirmDelete=function(a){return confirm(a)};ThePort.BlogCategoryHelper.prototype.EditCategory=function(a,c){ThePort.UI.PopWindow.OpenModalWindow(this.m_sEditCategoryUrl+"?sBlogId"+a+"&sCategoryId="+c,350,200)};ThePort.BlogCategoryHelper.prototype.CloseCategoryEdit=function(){ThePort.UI.PopWindow.CloseWindow();this.m_oHdnPagerIndex.value=this.m_iCurrentPage;__doPostBack("addCat","")};if(ThePortRegisterNS("ThePort.BlogCategoryHelper.Constants")){ThePort.BlogCategoryHelper.Constants={CONST_PAGE_UPLOAD_IMAGE:"/editor/app/photos/uploadimage.aspx",CONST_POPUP_WINDOW_NAME:"tp_Win",CONST_POPUP_WINDOW_IFRAME:"iframe",CONST_POPUP_WINDOW_IFRAME_200_400:"width=400px,height=200px,center=1,resize=1,scrolling=1"}}if(ThePortRegisterNS("ThePort.Login")){ThePort.Login=function(a){if(typeof a=="undefined"){this.m_oCallback=null}else{this.m_oCallback=a}this.m_sLoginServiceURL="/apis/login/LoginService.asmx/";this.m_oPublicNameNode=null;this.m_oWelcomeNode=null;this.m_oInputNode=null};ThePort.Login.prototype.SendLoginUser=function(e,g,d){var b=ThePort.Utils.GetObj("txtLoginEmail");var a=ThePort.Utils.GetObj("pwLoginPassword");var c=ThePort.Label.Get("GLOBAL_ENTER_EMAIL_ADDRESS_MESSAGE");var j=ThePort.Label.Get("GLOBAL_ENTER_A_PASSWORD_MESSAGE");if(b.value==ThePort.Common.CONST_EMPTY_STRING){alert(c);return}if(a.value==ThePort.Common.CONST_EMPTY_STRING){alert(j);return}var h=ThePort.Utils.GetObj("cbLoginRemember");this.m_oPublicNameNode=d;this.m_oWelcomeNode=e;this.m_oInputNode=g;this.OutputMessage(ThePort.Common.CONST_EMPTY_STRING);var f=ThePort.Common.CONST_EMPTY_STRING;f+="sLoginEmail="+encodeURIComponent(b.value);f+="&sLoginPassword="+encodeURIComponent(a.value);f+="&sLoginRememberMe="+encodeURIComponent(String(h.checked));eUrl=encodeURI(this.m_sLoginServiceURL+"SendLoginUser");this.OutputMessage(ThePort.Common.CONST_EMPTY_STRING);ThePort.Utils.Ajax("POST",eUrl,ThePort.Utils.Bind(this,"onSendLoginUserResponse"),f)};ThePort.Login.prototype.onSendLoginUserResponse=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}if(this.m_oCallback){this.m_oCallback.LogInResponse(a,b.Data)}}catch(f){}return d};ThePort.Login.prototype.SendEmailPassword=function(a){var b=ThePort.Utils.GetObj("txtLoginEmail");var c=ThePort.Label.Get("GLOBAL_ENTER_EMAIL_ADDRESS_MESSAGE");if(b.value==ThePort.Common.CONST_EMPTY_STRING){alert(c)}else{eUrl=encodeURI(this.m_sLoginServiceURL+"SendEmailPassword?sLoginEmail="+b.value+"&sXSLEmailPasswordFileName="+a);ThePort.Utils.Ajax("GET",eUrl,ThePort.Utils.Bind(this,"onSendEmailPasswordResponse"),null)}};ThePort.Login.prototype.onSendEmailPasswordResponse=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}if(this.m_oCallback){this.m_oCallback.SendEmailPasswordResponse(a,b.Data)}}catch(f){}return d};ThePort.Login.prototype.SendResetPasswordEmail=function(a){var b=ThePort.Utils.GetObj("txtLoginEmail");var c=ThePort.Label.Get("GLOBAL_ENTER_EMAIL_ADDRESS_MESSAGE");if(b.value==ThePort.Common.CONST_EMPTY_STRING){alert(c)}else{eUrl=encodeURI(this.m_sLoginServiceURL+"SendResetPasswordEmail?sLoginEmail="+b.value+"&sXSLEmailResetFileName="+a);ThePort.Utils.Ajax("GET",eUrl,ThePort.Utils.Bind(this,"onSendResetPasswordEmailResponse"),null)}};ThePort.Login.prototype.onSendResetPasswordEmailResponse=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}if(this.m_oCallback){this.m_oCallback.SendResetPasswordEmailResponse(a,b.Data)}}catch(f){}return d};ThePort.Login.prototype.SendPasswordReminder=function(){var a=ThePort.Utils.GetObj("txtLoginEmail");var b=ThePort.Label.Get("GLOBAL_ENTER_EMAIL_ADDRESS_MESSAGE");if(a.value==ThePort.Common.CONST_EMPTY_STRING){alert(b)}else{eUrl=encodeURI(this.m_sLoginServiceURL+"SendPasswordReminder?sLoginEmail="+a.value);ThePort.Utils.Ajax("GET",eUrl,ThePort.Utils.Bind(this,"onSendPasswordReminderResponse"),null)}};ThePort.Login.prototype.onSendPasswordReminderResponse=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}if(this.m_oCallback){this.m_oCallback.SendPasswordReminderResponse(a,b.Data)}}catch(f){}return d};ThePort.Login.prototype.OutputMessage=function(a){try{var b=ThePort.Utils.GetObj("loginOutputMessage");b.innerHTML=a;b.style.display="block"}catch(c){}};ThePort.Login.prototype.Register=function(){window.location="/community/app/reg/tptwiz/step.aspx"};ThePort.Login.prototype.KeyDownHandler=function(b,d){var a=b||window.event;if(a.keyCode==13){a.returnValue=false;ThePort.Utils.StopEvent(a);document.getElementById(d).click()}}}if(!String.prototype.format){String.format=String.prototype.format=function(){var b=arguments[0];for(var a=0;a<arguments.length;a++){b=this.replace(/\{\d+?\}/,arguments[a])}return b}}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.trimToSpace==null){String.prototype.trimToSpace=function(b){if(typeof b==ThePort.Common.CONST_UNDEFINED){return}if(this.length>b){var a=b;while((a>0)&&(this.charAt(a)!=ThePort.Common.CONST_SPACE)){a--}if(a==0){a=b}return this.substr(0,a)+"..."}return this}}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(String.prototype.replaceAll==null){String.prototype.replaceAll=function(a,c){var b=this;var d=b.indexOf(a);while(d!=-1){b=b.replace(a,c);d=b.indexOf(a)}return(b)}}if(ThePortRegisterNS("ThePort.BreadCrumbs")){ThePort.BreadCrumbs={AddCrumbUrl:function(b,h,a,e){var d=ThePort.Utils.GetObj(b);if(d==null){return false}if(typeof e=="undefined"){e=30}if(h.length>e){var c=e;while((c>0)&&(h.charAt(c)!=" ")){c--}if(c==0){c=e}h=h.substr(0,c)+"..."}var g=document.createElement("li");if(document.all){g.innerText=h}else{g.textContent=h}g.setAttribute("hrefSave",a);if(d.childNodes.length>0){var f=document.createElement("a");f.setAttribute("href",d.childNodes[d.childNodes.length-1].getAttribute("hrefSave"));if(document.all){f.innerText=d.childNodes[d.childNodes.length-1].innerText;d.childNodes[d.childNodes.length-1].innerText=""}else{f.textContent=d.childNodes[d.childNodes.length-1].textContent;d.childNodes[d.childNodes.length-1].textContent=""}d.childNodes[d.childNodes.length-1].appendChild(f)}d.appendChild(g)},AddCrumbUrlIncrement:function(a,e,d){var b=ThePort.Utils.GetObj(a);if(b==null){return false}var c="";if(b.childNodes.length>0){c=b.childNodes[b.childNodes.length-1].getAttribute("hrefSave")}if(d.charAt(0)=="/"){d=d.substr(1)}if((c.charAt(c.length-1)!="/")&&(d.charAt(0)!="/")){c=c+"/"+d}else{c=c+d}return ThePort.BreadCrumbs.AddCrumbUrl(a,e,c)}}}if(ThePortRegisterNS("ThePort.UI.TabSet")){ThePort.UI.TabSet={CONST_TAB_STRIP:"TabStrip",CONST_TAB_AREA:"TabArea",CleanString:function(a){return a.replace(/[^a-zA-Z 0-9]+/g,"")},AddTabSet:function(b,d,c,e){if(ThePortRegisterNS("ThePort.TabSetModuleArray")){ThePort.TabSetModuleArray.Array=new Array()}var a=ThePort.UI.TabSet.GetTabSetModule(b);if(a==null){ThePort.TabSetModuleArray.Array.push(new ThePort.UI.TabSetModule(b,d,c,e))}},IsTabSetModule:function(a){if(ThePort.TabSet.GetTabSetModule(a)!=null){return true}Nor;return false},GetTabSetModule:function(a){if((typeof ThePort.TabSetModuleArray==ThePort.Common.CONST_UNDEFINED)||(typeof ThePort.TabSetModuleArray.Array==ThePort.Common.CONST_UNDEFINED)){return null}for(var b=0;b<ThePort.TabSetModuleArray.Array.length;b++){if(ThePort.TabSetModuleArray.Array[b].m_sTabSetName==a){return ThePort.TabSetModuleArray.Array[b]}}return null},AddTabNavigationItem:function(b,d,a,c){ThePort.UI.TabSet.AddTab(b,d,null,a,c)},AddTabWithClickHandler:function(b,d,a,c){ThePort.UI.TabSet.AddTab(b,d,null,null,c,a)},AddTabItem:function(a,d,c,b){ThePort.UI.TabSet.AddTab(a,d,c,null,b)},AddTab:function(a,m,o,c,n,d){var e=ThePort.Utils.GetObj(ThePort.UI.TabSet.CONST_TAB_STRIP+a);if(e==null){return false}if(typeof n==ThePort.Common.CONST_UNDEFINED){iLength=30}else{iLength=n}m.trimToSpace(iLength);sTabID=ThePort.UI.TabSet.CleanString(m);var g=document.createElement(ThePort.Common.CONST_LISTITEM_TAG);var h=document.createElement(ThePort.Common.CONST_ANCHOR_TAG);g.appendChild(h);var f=ThePort.UI.TabSet.GetTabSetModule(a);if(f){if((typeof d!=ThePort.Common.CONST_UNDEFINED)&&(d!=null)){f.AddTabOnClick(m,d)}else{if(c!=null){f.AddTabUrl(m,c)}else{f.AddTab(m)}}}h.id=ThePort.UI.TabSet.CONST_TAB_STRIP+a+f.m_iTabCount.toString();ThePort.Event.AddHandler(h,ThePort.Common.CONST_EVENT_MOUSEOVER,function(){ThePort.UI.TabSet.OnMouseOver(a,m);return false});ThePort.Event.AddHandler(h,ThePort.Common.CONST_EVENT_MOUSEOUT,function(){ThePort.UI.TabSet.OnMouseOut(a,m);return false});ThePort.Event.AddHandler(h,ThePort.Common.CONST_EVENT_CLICK,function(){ThePort.UI.TabSet.OnClick(a,m);return false});ThePort.Utils.SetNodeText(h,m);e.appendChild(g);if(o==null){return}var j=ThePort.Utils.GetObj(ThePort.UI.TabSet.CONST_TAB_AREA+a);if(j==null){return false}var b=document.createElement(ThePort.Common.CONST_DIV_TAG);b.id=ThePort.UI.TabSet.CleanString(ThePort.UI.TabSet.CONST_TAB_AREA+a+f.m_iTabCount.toString());ThePort.Utils.Hide(b);j.appendChild(b);ThePort.Utils.LoadHTMLIntoNode(b,o)},AddTabNavigationItem:function(a,d,c,b){ThePort.UI.TabSet.AddTab(a,d,null,null,b)},AddTabDataItem:function(a,d){var b=ThePort.Utils.GetObj(ThePort.UI.TabSet.CONST_TAB_STRIP+a);if(b==null){return false}var c=document.createElement(ThePort.Common.CONST_LISTITEM_TAG);b.appendChild(c);ThePort.Utils.LoadHTMLIntoNode(c,d)},OnMouseOver:function(b,c){var a=ThePort.UI.TabSet.GetTabSetModule(b);if(a!=null){a.OnMouseOver(c)}},OnMouseOut:function(b,c){var a=ThePort.UI.TabSet.GetTabSetModule(b);if(a!=null){a.OnMouseOut(c)}},Activate:function(b,c){var a=ThePort.UI.TabSet.GetTabSetModule(b);if(a!=null){a.Activate(c)}},OnClick:function(b,c){var a=ThePort.UI.TabSet.GetTabSetModule(b);if(a!=null){a.OnClick(c)}}}}if(ThePortRegisterNS("ThePort.UI.TabSetModule")){ThePort.UI.TabSetModule=function(c,b,a,d){this.m_sTabSetName=c;this.m_iTabCount=0;this.m_iTabStartIdx=-1;this.m_iActiveTab=-1;this.m_iMouseOver=-1;this.m_sTabLabels=new Array();this.m_sTabUrls=new Array();this.m_sTabFn=new Array();this.TabClassNormal=b;this.TabClassActive=a;this.TabClassHilight=d},ThePort.UI.TabSetModule.prototype.AddTab=function(a){this.m_iTabCount++;this.m_sTabLabels.push(a);this.m_sTabUrls.push(ThePort.Common.CONST_EMPTY_STRING);this.m_sTabFn.push(null)},ThePort.UI.TabSetModule.prototype.AddTabUrl=function(b,a){this.m_iTabCount++;this.m_sTabLabels.push(b);this.m_sTabUrls.push(a);this.m_sTabFn.push(null)},ThePort.UI.TabSetModule.prototype.AddTabOnClick=function(b,a){this.m_iTabCount++;this.m_sTabLabels.push(b);this.m_sTabUrls.push(ThePort.Common.CONST_EMPTY_STRING);this.m_sTabFn.push(a)},ThePort.UI.TabSetModule.prototype.SetStartIndex=function(a){if((a>=0)&&(a<this.m_sTabLabels.length)){this.m_iTabStartIdx=a}},ThePort.UI.TabSetModule.prototype.GetLabelIndex=function(b){var a=0;if(this.m_sTabLabels.length<=0){return -1}while(a<this.m_sTabLabels.length){if(this.m_sTabLabels[a]==b){return a}a++}return -1},ThePort.UI.TabSetModule.prototype.SetStart=function(a){this.SetStartIndex(this.GetLabelIndex(a))},ThePort.UI.TabSetModule.prototype.Activate=function(f){try{var a=this.GetLabelIndex(f)+1;if(a<=0){return}this.m_iActiveTab=a;for(var c=1;c<=this.m_sTabLabels.length;c++){var b=ThePort.UI.TabSet.CleanString(ThePort.UI.TabSet.CONST_TAB_STRIP+this.m_sTabSetName+c.toString());if(c!=a){ThePort.Utils.SetClassName(b,this.TabClassNormal)}else{ThePort.Utils.SetClassName(b,this.TabClassActive)}}}catch(d){}},ThePort.UI.TabSetModule.prototype.OnClick=function(g){try{var a=this.GetLabelIndex(g)+1;if(a<=0){return}for(var c=1;c<=this.m_sTabLabels.length;c++){var b=ThePort.UI.TabSet.CleanString(ThePort.UI.TabSet.CONST_TAB_STRIP+this.m_sTabSetName+c.toString());var d=ThePort.UI.TabSet.CleanString(ThePort.UI.TabSet.CONST_TAB_AREA+this.m_sTabSetName+c.toString());if(c!=a){ThePort.Utils.SetClassName(b,this.TabClassNormal);ThePort.Utils.Hide(d)}else{this.m_iActiveTab=c;ThePort.Utils.SetClassName(b,this.TabClassActive);try{if(this.m_sTabFn[c-1]!=null){this.m_sTabFn[c-1]();return}if(this.m_sTabUrls[c-1].length>0){ThePort.Utils.GotoURL(this.m_sTabUrls[c-1])}}catch(f){}ThePort.Utils.Show(d)}}}catch(f){}this.m_iMouseOver=-1},ThePort.UI.TabSetModule.prototype.OnMouseOver=function(d){try{var a=this.GetLabelIndex(d)+1;if(a<=0){return}if((this.m_iActiveTab==a)||(this.m_iMouseOver==a)){return}if(this.m_iMouseOver>=0){var b=ThePort.UI.TabSet.CleanString(ThePort.UI.TabSet.CONST_TAB_STRIP+this.m_sTabSetName+this.m_iMouseOver.toString());ThePort.Utils.SetClassName(b,this.TabClassNormal)}var b=ThePort.UI.TabSet.CleanString(ThePort.UI.TabSet.CONST_TAB_STRIP+this.m_sTabSetName+a.toString());ThePort.Utils.SetClassName(b,this.TabClassHilight);this.m_iMouseOver=a}catch(c){}},ThePort.UI.TabSetModule.prototype.OnMouseOut=function(d){try{var a=this.GetLabelIndex(d)+1;if(a<=0){return}if(a==this.m_iActiveTab){return}var b=ThePort.UI.TabSet.CleanString(ThePort.UI.TabSet.CONST_TAB_STRIP+this.m_sTabSetName+a.toString());ThePort.Utils.SetClassName(b,this.TabClassNormal);this.m_iMouseOver=-1}catch(c){}}}if(ThePortRegisterNS("ThePort.FlyOut")){ThePort.FlyOut={CONST_FLYOUT_ELEMENT_ID:"ThePortFlyOutDiv",CONST_FLYOUT_ID_SUFFIX:"__flyout",CONST_FLYOUT_TOP_POSITION:"top",CONST_FLYOUT_BOTTOM_POSITION:"bottom",CONST_FLYOUT_CLASS:"tp_flyoutContainer",CONST_FLYOUT_CLOSE_BUTTON:"<img class='closeXimg' onclick='ThePort.FlyOut.Close();' src='/images/blank.gif'>",Context:new Object(),OpenFromElement:function(c,f,b,a,e){var d=ThePort.Utils.GetObj(f+ThePort.FlyOut.CONST_FLYOUT_ID_SUFFIX);if(!d){d=document.createElement(f+ThePort.FlyOut.CONST_FLYOUT_ID_SUFFIX)}else{d.innerHTML=""}d.innerHTML=ThePort.Utils.GetObj(f).innerHTML;for(i=0;i<=d.childNodes.length-1;i++){if(d.childNodes[i].id){d.childNodes[i].id=d.childNodes[i].id+ThePort.FlyOut.CONST_FLYOUT_ID_SUFFIX}}ThePort.FlyOut.Open(c,d.innerHTML,b,a,e)},Open:function(o,n,m,d,j){var f=ThePort.FlyOut.CONST_FLYOUT_BOTTOM_POSITION;if(arguments[2]){if(arguments[2]==ThePort.FlyOut.CONST_FLYOUT_TOP_POSITION){f=ThePort.FlyOut.CONST_FLYOUT_TOP_POSITION}}if(arguments[3]){ThePort.FlyOut.Context.ID=d}var b=ThePort.FlyOut.CONST_FLYOUT_CLOSE_BUTTON+n;if(!o){try{if(typeof o!=ThePort.Common.CONST_OBJECT_TYPE){o=ThePort.Utils.GetObj(o)}}catch(h){return}}if(!o){return}if(document.getElementById(ThePort.FlyOut.CONST_FLYOUT_ELEMENT_ID)){if(ThePort.FlyOut.Close(n)){return}}var p=document.createElement(ThePort.Common.CONST_SPAN_TAG);p.id=ThePort.FlyOut.CONST_FLYOUT_ELEMENT_ID;if(!j){p.className=ThePort.FlyOut.CONST_FLYOUT_CLASS}else{p.className=ThePort.FlyOut.CONST_FLYOUT_CLASS+" "+j}ThePort.Utils.SetInnerHTML(p,b);var g=ThePort.Utils.findPosY(o);var a=ThePort.Utils.findPosX(o);var c=document.body.clientWidth;if(c-a<200){p.style.right="1"+ThePort.Common.CONST_STYLE_PX}else{p.style.left=(a-1)+ThePort.Common.CONST_STYLE_PX}if(f==ThePort.FlyOut.CONST_FLYOUT_TOP_POSITION){p.style.top=(g)+ThePort.Common.CONST_STYLE_PX}else{p.style.top=(1+g+o.offsetHeight)+ThePort.Common.CONST_STYLE_PX}document.body.appendChild(p)},Close:function(b){ThePort.FlyOut.Context=new Object();bRetVal=false;try{var a=document.getElementById(ThePort.FlyOut.CONST_FLYOUT_ELEMENT_ID);if(ThePort.Utils.GetValueFromNode(a)==b){bRetVal=true}a.parentNode.removeChild(document.getElementById(ThePort.FlyOut.CONST_FLYOUT_ELEMENT_ID))}catch(c){}return bRetVal}}}if(ThePortRegisterNS("ThePort.UI.InlineComment")){ThePort.UI.InlineComment={oModuleArray:new Array(),oULNameArray:new Array(),oActivityIDArray:new Array(),iPostBusy:ThePort.Common.CONST_NUMERIC_FALSE,sBusyModuleID:null,sEmptyComment:null,sEmptyCommentID:null,MakeCommentBlockVisible:function(a){ThePort.Utils.Show(a+"_CommentArea")},MakeCommentBlockHidden:function(a){ThePort.Utils.Hide(a+"_CommentArea")},MakeAllCommentsVisible:function(c){for(var b=0;b<ThePort.UI.InlineComment.oModuleArray.length;b++){sID=ThePort.UI.InlineComment.oModuleArray[b];if(sID==c){oObj=ThePort.Utils.GetObj(ThePort.UI.InlineComment.oULNameArray[b]);if((oObj)&&(oObj.childNodes.length>0)){for(var a=0;a<oObj.childNodes.length;a++){if(oObj.childNodes[a].id!=c+"_InputControl"){ThePort.Utils.Show(oObj.childNodes[a])}}}}}},Exists:function(b){for(var a=0;a<ThePort.UI.InlineComment.oModuleArray.length;a++){sID=ThePort.UI.InlineComment.oModuleArray[a];if(sID==b){return true}}return false},EmitComment:function(a,e){var h=ThePort.UI.InlineComment.sEmptyComment;var d=e.replaceAll("\n","<br/>");var c=h.replace("placeholder_emptycomment",d);var g=document.createElement("li");g.id="IDComment"+ThePort.UI.InlineComment.sEmptyCommentID;g.innerHTML=c;if(a.childNodes.length>0){var f=a.childNodes[a.childNodes.length-1];var b=a.insertBefore(g,a.lastChild)}else{a.appendChild(g)}ThePort.Utils.Hide("IDDelete"+ThePort.UI.InlineComment.sEmptyCommentID);return},UpdateCommentText:function(a,c){var b=c.replaceAll("\n","<br/>");ThePort.Utils.SetInnerHTML("IDCommentText"+a,b)},ShowComment:function(a){ThePort.Utils.Show("IDComment"+a)},HideComment:function(a){ThePort.Utils.Hide("IDComment"+a)},UpdateCommentID:function(b,d){var a=ThePort.Utils.GetObj("IDComment"+b);if(a){var e=a.innerHTML;var c=e.replaceAll(b,d);a.id="IDComment"+d;a.innerHTML=c}},RemoveComment:function(b){var a=ThePort.Utils.GetObj("IDComment"+b);if(a){a.parentNode.removeChild(a)}},AddViewCount:function(b){try{var a=ThePort.Utils.GetObj(b+"viewcount");var d=ThePort.Utils.GetInt(ThePort.Utils.GetValueFromNode(a));d++;ThePort.Utils.SetNodeText(a,d.toString())}catch(c){}},DecViewCount:function(b){try{var a=ThePort.Utils.GetObj(b+"viewcount");var d=ThePort.Utils.GetInt(ThePort.Utils.GetValueFromNode(a));d--;ThePort.Utils.SetNodeText(a,d.toString())}catch(c){}},SetEmptyComment:function(a,b){ThePort.UI.InlineComment.sEmptyCommentID=a;ThePort.UI.InlineComment.sEmptyComment=b},AddListModule:function(a,c,b){if(ThePort.UI.InlineComment.Exists(c)){return}ThePort.UI.InlineComment.oModuleArray.push(c);ThePort.UI.InlineComment.oULNameArray.push(a);ThePort.UI.InlineComment.oActivityIDArray.push(b)},Add:function(a){AddListModule("",a)},ShowCommentsIfListHasElements:function(b,f,c){var e=ThePort.Utils.BooleanToInt(ThePort.Utils.StringToBoolean(c));var a=ThePort.Utils.GetObj(b);if(a){if(a.childNodes.length>e){var d=ThePort.XSL.GetModulePointer(f);if(d){ThePort.Utils.Show(d.oDict.GetDictionaryKey("sParent"))}}}},GetULChildCount:function(b){var a=ThePort.Utils.GetObj(b+"_InputControl");var c=null;while(!c&&a){if(a.nodeName=="UL"){c=a}else{a=a.parentNode}}if(c){return c.childNodes.length}return -1},DeactivateAll:function(){for(var a=0;a<ThePort.UI.InlineComment.oModuleArray.length;a++){ThePort.UI.InlineComment.Deactivate(ThePort.UI.InlineComment.oModuleArray[a])}},Deactivate:function(a){if(ThePort.Utils.GetObj(a+"AddCommentsButton")!=null){if(ThePort.UI.InlineComment.GetULChildCount(a)<=1){ThePort.UI.InlineComment.MakeCommentBlockHidden(a)}}ThePort.Utils.Hide(a+"_InputControl");ThePort.Utils.Show(a+"AddCommentsButton")},Toggle:function(a){if(ThePort.Utils.IsVisible(ThePort.Utils.GetObj(a+"_InputControl"))){ThePort.UI.InlineComment.DeactivateAll(a)}else{ThePort.UI.InlineComment.Activate(a)}},ActivateByActivityID:function(b){for(var a=0;a<ThePort.UI.InlineComment.oActivityIDArray.length;a++){sID=ThePort.UI.InlineComment.oActivityIDArray[a];if(sID==b){ThePort.UI.InlineComment.Activate(ThePort.UI.InlineComment.oModuleArray[a]);try{var d=ThePort.Utils.GetObj("IDActivityFeed"+b);if(d!=null){d.scrollIntoView()}var d=ThePort.Utils.GetObj(ThePort.UI.InlineComment.oModuleArray[a]+"AddCommentsButton");if(d!=null){ThePort.Utils.Hide(d)}}catch(c){}return}}},Activate:function(g){for(var c=0;c<ThePort.UI.InlineComment.oModuleArray.length;c++){sID=ThePort.UI.InlineComment.oModuleArray[c];if(sID!=g){ThePort.UI.InlineComment.Deactivate(sID)}}var d=ThePort.XSL.GetModulePointer(g);if(d){ThePort.Utils.Show(d.oDict.GetDictionaryKey("sParent"))}ThePort.UI.InlineComment.MakeCommentBlockVisible(g);ThePort.Utils.Show(g+"_InputControl");var a=ThePort.Utils.GetObj(g+"CommentCtrlID");try{if(a){a.focus()}}catch(f){}var b=function(h){var q=h||window.event;var p=(q&&q.target)||(event&&event.srcElement);while(p.parentNode){for(var m=0;m<ThePort.UI.InlineComment.oModuleArray.length;m++){var j=ThePort.UI.InlineComment.oModuleArray[m];var o=ThePort.XSL.GetModulePointer(j);if(o){var n=ThePort.Utils.GetObj(j+"AddCommentsButton");if(p==n){return false}}if(p==ThePort.Utils.GetObj(j+"viewall")){return}if(p==ThePort.Utils.GetObj(j+"_InputControl")){return}}p=p.parentNode}ThePort.UI.InlineComment.DeactivateAll();window.onmousedown=null;document.body.onmousedown=null;return};document.body.onmousedown=b},ActivateByQSActivityID:function(){sAID=ThePort.Utils.GetQueryVariable(window.location.href,"sActivityID");if((sAID!=null)&&(sAID.length>0)){ThePort.UI.InlineComment.ActivateByActivityID(sAID)}},SendComment:function(d,b,a){if(ThePort.UI.InlineComment.iPostBusy==ThePort.Common.CONST_NUMERIC_TRUE){return}var e=ThePort.XSL.GetModulePointer(d);if(!e){return}oNode=ThePort.Utils.GetObj(b);if((typeof oNode==ThePort.Common.CONST_UNDEFINED)||(oNode.value=="")){return}ThePort.UI.InlineComment.iPostBusy=ThePort.Common.CONST_NUMERIC_TRUE;ThePort.UI.InlineComment.sBusyModuleID=d;var f=oNode.value;oNode.value=ThePort.Common.CONST_EMPTY_STRING;var c="/Services/Comments/ExtensionComment.ashx";var g=new ThePort.Dictionary(e.oDict.ToCSV());g.AddStringPair(ThePort.Common.QS_COMMENT,f);g.AddStringPair(ThePort.Common.QS_EMPTYCOMMENTID,ThePort.UI.InlineComment.sEmptyCommentID);sPostData=ThePort.Utils.GetVariablePair(ThePort.Common.QS_DATA,g.ToCSV());ThePort.UI.InlineComment.EmitComment(ThePort.Utils.GetObj(a),f);ThePort.XSL.AjaxPost(c,sPostData,ThePort.UI.InlineComment.onCommentUpdate);ThePort.UI.InlineComment.Deactivate(d)},onCommentUpdate:function(c){var m=ThePort.UI.InlineComment.sBusyModuleID;var e=ThePort.XSL.GetModulePointer(m);var g=new ThePort.ReplyObject(c.responseXML);var d=new ThePort.Dictionary(g.Dict);var h=d.GetDictionaryKey(ThePort.Common.QS_EMPTYCOMMENTID);var f=d.GetDictionaryKey(ThePort.Common.QS_COMMENT);var b=d.GetDictionaryKey(ThePort.Common.QS_OBJECTID);if(g.Response!="true"){ThePort.UI.InlineComment.RemoveComment(h);alert(g.Message);ThePort.Debug.Log("Unable to post comment to webservice Error = "+g.Message)}else{ThePort.UI.InlineComment.UpdateCommentText(h,f);ThePort.Utils.Show("IDDelete"+h);ThePort.UI.InlineComment.UpdateCommentID(h,b);var j=new Date();var a=j.getTime();ThePort.Utils.TimerModule.DisplayTime("IDCommentTimer"+b,parseInt(a/1000,10));ThePort.UI.InlineComment.AddViewCount(m)}ThePort.UI.InlineComment.iPostBusy=ThePort.Common.CONST_NUMERIC_FALSE},DeleteComment:function(b,d){if(isNaN(d)){return}if(ThePort.UI.InlineComment.iPostBusy==ThePort.Common.CONST_NUMERIC_TRUE){return}var c=ThePort.XSL.GetModulePointer(b);if(!c){return}ThePort.UI.InlineComment.iPostBusy=ThePort.Common.CONST_NUMERIC_TRUE;ThePort.UI.InlineComment.sBusyModuleID=b;ThePort.UI.InlineComment.HideComment(d);var a="/Services/Comments/ExtensionCommentDelete.ashx";var e=new ThePort.Dictionary(c.oDict.ToCSV());e.AddStringPair(ThePort.Common.QS_OBJECTID,d);sPostData=ThePort.Utils.GetVariablePair(ThePort.Common.QS_DATA,e.ToCSV());ThePort.XSL.AjaxPost(a,sPostData,ThePort.UI.InlineComment.onDeleteComment)},onDeleteComment:function(c){var b=ThePort.UI.InlineComment.sBusyModuleID;var a=new ThePort.ReplyObject(c.responseXML);var e=new ThePort.Dictionary(a.Dict);var d=e.GetDictionaryKey(ThePort.Common.QS_OBJECTID);var a=new ThePort.ReplyObject(c.responseXML);if(a.Response!="true"){ThePort.UI.InlineComment.ShowComment(d)}else{ThePort.UI.InlineComment.RemoveComment(d);ThePort.UI.InlineComment.DecViewCount(b)}ThePort.UI.InlineComment.iPostBusy=ThePort.Common.CONST_NUMERIC_FALSE}}}if(ThePortRegisterNS("ThePort.UI.Activity")){ThePort.UI.Activity={oModuleArray:new Array(),iPostBusy:ThePort.Common.CONST_NUMERIC_FALSE,sBusyModuleID:null,sEmptyComment:null,sEmptyTimerID:0,sEmptyCommentID:"placeholder_emptycomment",SetEmptyComment:function(a,b){ThePort.UI.Activity.sEmptyCommentID=a;ThePort.UI.Activity.sEmptyComment=b},Exists:function(b){for(var a=0;a<ThePort.UI.Activity.oModuleArray.length;a++){sID=ThePort.UI.Activity.oModuleArray[a];if(sID==b){return true}}return false},HideActivity:function(a){ThePort.Utils.Hide("IDActivityFeed"+a)},ShowActivity:function(a){ThePort.Utils.Show("IDActivityFeed"+a)},AddActivityModule:function(a){if(ThePort.UI.Activity.Exists(a)){return}ThePort.UI.Activity.oModuleArray.push(a)},RemoveActivity:function(b){var a=ThePort.Utils.GetObj("IDActivityFeed"+b);if(a){a.parentNode.removeChild(a)}},EmitActivity:function(a,d){var f=ThePort.UI.Activity.sEmptyComment;var c=d.replaceAll("\n","<br/>");var b=f.replace("placeholder_emptycomment",c);var e=document.createElement("li");e.id="IDActivityFeed"+ThePort.UI.Activity.sEmptyCommentID;e.innerHTML=b;if(a.childNodes.length>0){ThePort.Utils.InsertAfter(a,e,a.firstChild)}else{a.appendChild(e)}return},UpdateActivityText:function(a,c){var b=c.replaceAll("\n","<br/>");ThePort.Utils.SetInnerHTML(a+"Comment",b)},SendActivity:function(h,d,j,g,e){if(ThePort.UI.Activity.iPostBusy==ThePort.Common.CONST_NUMERIC_TRUE){return}var b=ThePort.XSL.GetModulePointer(h);if(!b){return}oNode=ThePort.Utils.GetObj(d);if((typeof oNode==ThePort.Common.CONST_UNDEFINED)||(oNode.value=="")||(oNode.value==e)){return}ThePort.UI.Activity.iPostBusy=ThePort.Common.CONST_NUMERIC_TRUE;ThePort.UI.Activity.sBusyModuleID=h;var c=oNode.value;oNode.value=ThePort.Common.CONST_EMPTY_STRING;var a=new ThePort.Dictionary(b.oDict.ToCSV());a.AddStringPair(ThePort.Common.QS_COMMENT,c);if(g=="userprofilecomment"){var f="/apis/Services/Activities/AddProfileCommentActivity.ashx";a.AddStringPair(ThePort.Common.QS_PROFILEID,j)}else{if(g=="socialobjectcomment"){var f="/Services/Comments/ExtensionComment.ashx"}}a.AddStringPair(ThePort.Common.QS_EMPTYCOMMENTID,ThePort.UI.Activity.sEmptyCommentID);sPostData=ThePort.Utils.GetVariablePair(ThePort.Common.QS_DATA,a.ToCSV());ThePort.UI.Activity.EmitActivity(ThePort.Utils.GetObj(h+"ActivityUL"),c);ThePort.XSL.AjaxPost(f,sPostData,ThePort.UI.Activity.onActivityUpdate)},onActivityUpdate:function(d){ThePort.UI.Activity.iPostBusy=ThePort.Common.CONST_NUMERIC_FALSE;var m=ThePort.UI.Activity.sBusyModuleID;var f=ThePort.XSL.GetModulePointer(m);var h=new ThePort.ReplyObject(d.responseXML);var e=new ThePort.Dictionary(h.Dict);var a=e.GetDictionaryKey(ThePort.Common.QS_EMPTYCOMMENTID);var g=e.GetDictionaryKey(ThePort.Common.QS_COMMENT);var c=e.GetDictionaryKey(ThePort.Common.QS_OBJECTID);if(h.Response!=ThePort.Common.CONST_TRUE){ThePort.UI.Activity.RemoveActivity(a);ThePort.Debug.Log("Error POSTING activity comment Removing injected Activity SendActivityComment = "+h.Message);ThePort.Debug.Log("Unable to SendActivityComment to webservice Error = "+h.Message);alert(h.Message)}else{ThePort.UI.Activity.UpdateActivityText(a,g);ThePort.UI.Activity.sEmptyTimerID++;ThePort.Utils.UpdateObjectID(a+"CommentTimer",a+"CommentTimer"+ThePort.UI.Activity.sEmptyTimerID);var j=new Date();var b=j.getTime();ThePort.Utils.TimerModule.DisplayTime(a+"CommentTimer"+ThePort.UI.Activity.sEmptyTimerID,parseInt(b/1000,10))}},DeleteActivity:function(b,c){if(isNaN(c)){return}if(ThePort.UI.Activity.iPostBusy==ThePort.Common.CONST_NUMERIC_TRUE){return}var d=ThePort.XSL.GetModulePointer(b);if(!d){return}ThePort.UI.Activity.iPostBusy=ThePort.Common.CONST_NUMERIC_TRUE;ThePort.UI.Activity.sBusyModuleID=b;ThePort.UI.Activity.HideActivity(c);var a="/apis/Services/Activities/DeleteActivity.ashx";var e=new ThePort.Dictionary(d.oDict.ToCSV());e.AddStringPair(ThePort.Common.QS_ACTIVITYID,c);sPostData=ThePort.Utils.GetVariablePair(ThePort.Common.QS_DATA,e.ToCSV());ThePort.XSL.AjaxPost(a,sPostData,ThePort.UI.Activity.onDeleteActivity)},onDeleteActivity:function(b){ThePort.UI.Activity.iPostBusy=ThePort.Common.CONST_NUMERIC_FALSE;var a=new ThePort.ReplyObject(b.responseXML);var d=new ThePort.Dictionary(a.Dict);var c=d.GetDictionaryKey(ThePort.Common.QS_ACTIVITYID);if(a.Response!=ThePort.Common.CONST_TRUE){ThePort.UI.Activity.ShowActivity(c);ThePort.Debug.Log("Error DELETING activity comment. Now Restoring Activity to display.");ThePort.Debug.Log("Unable to Delete Activity. Webservice Error = "+a.Message);alert(a.Message)}else{ThePort.UI.Activity.RemoveActivity(c)}}}}if(ThePortRegisterNS("ThePort.ClassName")){ThePort.ClassName={HasClassName:function(e,b){if(!e){return false}if(e.className){var c=e.className.split(ThePort.Common.CONST_SPACE);var a=b.toUpperCase();for(var d=0;d<c.length;d++){if(c[d].toUpperCase()==a){return true}}}return false},AddClassName:function(c,a){if(!c){return false}if(ThePort.ClassName.HasClassName(c,a)){return}if(c.className){var b=c.className.split(ThePort.Common.CONST_SPACE);b[b.length]=a;c.className=b.join(ThePort.Common.CONST_SPACE)}else{c.className=a}},RemoveClassName:function(e,b){if(!e){return false}if(e.className){var c=e.className.split(ThePort.Common.CONST_SPACE);var a=b.toUpperCase();for(var d=0;d<c.length;d++){if(c[d].toUpperCase()==a){c.splice(d,1);d--}}e.className=c.join(ThePort.Common.CONST_SPACE)}},Replace:function(c,b,a){ThePort.ClassName.RemoveClassName(c,b);ThePort.ClassName.AddClassName(c,a)},Toggle:function(c,b,a){if(ThePort.ClassName.HasClassName(c,b)){ThePort.ClassName.Replace(c,b,a)}else{if(ThePort.ClassName.HasClassName(c,a)){ThePort.ClassName.Replace(c,a,b)}}}}}if(ThePortRegisterNS("ThePort.Cookies")){ThePort.Cookies={SetCookie:function(b,d,c,a){var g=document;g.cookie=b+"="+d+((a)?"; expires="+a.toGMTString():"")+((c)?"; domain="+c:"")+"; path=/";try{if(top!=self){g=top.document}g.cookie=b+"="+d+((a)?"; expires="+a.toGMTString():"")+((c)?"; domain="+c:"")+"; path=/"}catch(f){}},GetCookie:function(c){var b=document.cookie;var e=c+"=";var d=b.indexOf("; "+e);if(d==-1){d=b.indexOf(e);if(d!=0){return null}}else{d+=2}var a=document.cookie.indexOf(";",d);if(a==-1){a=b.length}return unescape(b.substring(d+e.length,a))},RemoveCookie:function(b){var a=new Date();a.setTime(a.getTime()+(-1*24*60*60*1000));if(ThePort.Utils.IsIE()){ThePort.Cookies.SetCookie(b," ","",a)}else{document.cookie=b+"=; expires=Tue, 1 Jan 1980 00:00:00 UTC; path=/"}}}}if(ThePortRegisterNS("ThePort.Utils.Timer")){ThePort.Utils.Timer=function(a,c){this.m_interval=null;this.m_sNodeID=a;this.m_oTime=new Date();this.m_oTime.setTime(c*1000);this.m_lastInterval=0;var b=ThePort.Utils.GetObj(this.m_sNodeID);if(b){b.title=this.m_oTime.toLocaleString()}this.setTimeInterval(1)};ThePort.Utils.Timer.prototype.setTimeInterval=function(b){if(this.m_lastInterval!=b){this.clearTimeInterval()}if(this.m_interval){return}this.m_lastInterval=b;var a=this;function c(){a.handleTimer(a)}this.m_interval=setInterval(c,b*1000)};ThePort.Utils.Timer.prototype.clearTimeInterval=function(){if(this.m_interval){clearInterval(this.m_interval)}this.m_interval=null};ThePort.Utils.Timer.prototype.handleTimer=function(f){try{var p=ThePort.Utils.GetObj(this.m_sNodeID);if(!p){this.clearTimeInterval();return}var d=new Date();var m=Math.floor((d.getTime()-this.m_oTime.getTime())/1000);var c=Math.floor(m/60);var j=Math.floor(m/3600);var n=Math.floor(m/(3600*24));var a=Math.floor(n/7);var b=Math.floor(n/30);var g=Math.floor(b/12);var o;if(m<60){if(m==1){o=ThePort.Label.Get("GLOBAL_SECOND_PAST_TERM").format(m)}else{o=ThePort.Label.Get("GLOBAL_SECONDS_PAST_TERM").format(m)}}else{if(g>0){this.clearTimeInterval();if(g==1){o=ThePort.Label.Get("GLOBAL_YEAR_PAST_TERM").format(g)}else{o=ThePort.Label.Get("GLOBAL_YEARS_PAST_TERM").format(g)}}else{if(b>0){this.clearTimeInterval();if(b==1){o=ThePort.Label.Get("GLOBAL_MONTH_PAST_TERM").format(b)}else{o=ThePort.Label.Get("GLOBAL_MONTHS_PAST_TERM").format(b)}}else{if(n>0){this.clearTimeInterval();if(n==1){o=ThePort.Label.Get("GLOBAL_DAY_PAST_TERM").format(n)}else{o=ThePort.Label.Get("GLOBAL_DAYS_PAST_TERM").format(n)}}else{if(j>0){this.setTimeInterval(600);if(j==1){o=ThePort.Label.Get("GLOBAL_HOUR_PAST_TERM").format(j)}else{o=ThePort.Label.Get("GLOBAL_HOURS_PAST_TERM").format(j)}}else{if(c>0){this.setTimeInterval(30);if(c==1){o=ThePort.Label.Get("GLOBAL_MINUTE_PAST_TERM").format(c)}else{o=ThePort.Label.Get("GLOBAL_MINUTES_PAST_TERM").format(c)}}else{this.clearTimeInterval()}}}}}}p.innerHTML=o}catch(h){}}}if(ThePortRegisterNS("ThePort.Utils.TimerModule")){ThePort.Utils.TimerModule={DisplayTime:function(a,b){if(b<=0){return}var c=new ThePort.Utils.Timer(a,b)},DisplayDateTime:function(c,d){if(d<=0){return}var b=b;var a=new Date();a.setTime(d*1000);ThePort.Utils.SetInnerHTML(c,a.toLocaleString())}}}if(ThePortRegisterNS("ThePort.UI.Like")){ThePort.UI.Like={oModules:null,AddLike:function(g,e,b,d,j,h,a,c){if(!ThePort.UI.Like.oModules){ThePort.UI.Like.oModules=new Array()}var f=g;ThePort.UI.Like.oModules.push(new ThePort.UI.LikeModule(f,e,g,b,d,j,h,a,c));if((e==1)&&(h==1)){ThePort.UI.Like.SetLikeTextControls(f,true)}else{ThePort.UI.Like.SetLikeTextControls(f,false)}},FindLike:function(b){if(!ThePort.UI.Like.oModules){return null}for(var a=0;a<ThePort.UI.Like.oModules.length;a++){if(ThePort.UI.Like.oModules[a].m_sObjId==b){return ThePort.UI.Like.oModules[a]}}return null},SetLike:function(d,f){var e=ThePort.UI.Like.FindLike(d);if(!e){return}if(e.m_iBusy==1){return}if(e.m_iIsUserLoggedIn!=1){return ThePort.Utils.RedirectToLoginAndBackToCurrentURLWithAnchor(e.sAnchorName)}if(f&&!e.m_bCurrentLike){e.m_iNumLikes++}else{if(!f&&e.m_bCurrentLike){e.m_iNumLikes--}else{return}}e.m_iBusy=1;if(e.m_iNumLikes<0){e.m_iNumLikes=0}e.m_bCurrentLike=f;var c="/apis/Services/Extension/Like.ashx";var b=new ThePort.Dictionary();b.AddStringPair("sObjID",d);b.AddStringPair("bLike",ThePort.Utils.BooleanToString(f));b.AddStringPair("iItemID",e.m_iItemID);b.AddStringPair("iItemTypeID",e.m_iItemTypeID);b.AddStringPair("iItemParentID",e.m_iItemParentID);b.AddStringPair(ThePort.Common.QS_CACHE_RESET,ThePort.Common.CONST_NUMERIC_TXT_TRUE);b.AddStringPair(ThePort.Common.QS_MODKEY,e.m_sCacheKey);ThePort.UI.Like.SetLikeTextControls(d,f);var a=ThePort.Utils.GetVariablePair(ThePort.Common.QS_DATA,b.ToCSV());ThePort.XSL.AjaxPost(c,a,ThePort.UI.Like.OnLikeUpdate)},OnLikeUpdate:function(b){var a=new ThePort.ReplyObject(b.responseXML);var e=new ThePort.Dictionary(a.Dict);var c=e.GetDictionaryKey("sObjID");var d=ThePort.UI.Like.FindLike(c);if(!d){return}d.m_iBusy=0;if(a.Response!="true"){d.m_bCurrentLike=!d.m_bCurrentLike;d.m_iNumLikes=d.m_iOrigNumLikes;ThePort.UI.Like.SetLikeTextControls(c,bLike)}},SetLikeTextControls:function(h,p){var g=ThePort.UI.Like.FindLike(h);if(!g){return}var d=g.m_sAnchorName;var e=g.m_sAnchorName+"_span";var j=g.m_sAnchorName+"_img";var a=g.m_iNumLikes;var q;var n;var b="tp_likeBtnImg";var o=ThePort.Label.Get("GLOBAL_LIKE_TERM");var m=ThePort.Label.Get("GLOBAL_UNLIKE_TERM");var c="";var f;if(p==true){b="tp_likeBtnImgLiked";switch(a){case 1:q=ThePort.Label.Get("GLOBAL_YOU_LIKE_THIS_LABEL");break;case 2:q=ThePort.Label.Get("GLOBAL_YOU_AND_1_OTHER_LIKE_THIS_LABEL");break;default:q=ThePort.Label.Get("GLOBAL_YOU_AND_X_OTHERS_LIKE_THIS_LABEL").format(a-1);break}f=false;c=m}else{switch(a){case 0:q=o;break;case 1:q=ThePort.Label.Get("GLOBAL_1_USER_LIKES_THIS_LABEL");break;default:q=ThePort.Label.Get("GLOBAL_X_USERS_LIKE_THIS_LABEL").format(a);break}f=true;c=o}if(a==0){ThePort.Utils.SetInnerHTML(e,ThePort.Common.CONST_EMPTY_STRING)}else{ThePort.Utils.SetInnerHTML(e,a)}ThePort.Utils.GetObj(d).title=q;ThePort.Utils.SetClassName(j,b);var r=ThePort.Utils.GetObj(d);if(r){r.onclick=function(){ThePort.UI.Like.SetLike(h,f)}}}}}if(ThePortRegisterNS("ThePort.UI.LikeModule")){ThePort.UI.LikeModule=function(a,f,g,c,e,j,h,b,d){this.m_iBusy=0;this.m_sObjId=a;this.m_iIsUserLoggedIn=f;this.m_sAnchorName=g;this.m_iItemID=c;this.m_iItemTypeID=e;this.m_iItemParentID=j;this.m_bCurrentLike=h;this.m_iOrigNumLikes=b;this.m_iNumLikes=b;this.m_sCacheKey=d}}if(ThePortRegisterNS("ThePort.Client")){ThePort.Client={oDict:new ThePort.Dictionary(),iShow:ThePort.Utils.GetQueryVariable(window.location.href,"tp_showcontrols"),sText:"padding:3px;border:2px green solid;display:inline-block;",Clear:function(){ThePort.Client.oDict=null;ThePort.Client.oDict=new ThePort.Dictionary()},Put:function(a,b){ThePort.Client.oDict.PutDictionaryKey(a,b)},Get:function(a){ThePort.Client.oDict.GetDictionaryKey(a)},Test:function(d,e){var b=e.toLowerCase();var a=ThePort.Client.oDict.GetDictionaryKey(d);if(a){var c=a.toLowerCase();if(c==b){return true}}return false},AddDictionary:function(b){var d=new ThePort.Dictionary(b);var c=d.GetKeyArray();for(var a=0;a<c.length;a++){ThePort.Client.Put(c[a],d.GetDictionaryKey(c[a]))}},TestDictionary_AND:function(b){var d=new ThePort.Dictionary(b);var c=d.GetKeyArray();for(var a=0;a<c.length;a++){if(!ThePort.Client.Test(c[a],d.GetDictionaryKey(c[a]))){return false}}return true},TestDictionary_OR:function(b){var d=new ThePort.Dictionary(b);var c=d.GetKeyArray();for(var a=0;a<c.length;a++){if(ThePort.Client.Test(c[a],d.GetDictionaryKey(c[a]))){return true}}return false},ShowNodeTestAND:function(b,c){if(ThePort.Client.TestDictionary_AND(c)){ThePort.Utils.Show(b);if(ThePort.Client.iShow=="1"){var a=ThePort.Utils.GetObj(b);if(a){a.style.cssText=ThePort.Client.sText}}}},ShowNodeTestOR:function(b,c){if(ThePort.Client.TestDictionary_OR(c)){ThePort.Utils.Show(b);if(ThePort.Client.iShow=="1"){var a=ThePort.Utils.GetObj(b);if(a){a.style.cssText=ThePort.Client.sText}}}}}}if(!Date.prototype.IsDayLightSavings){Date.prototype.IsDayLightSavings=function(){return this.getTimezoneOffset()<this.MyTimeZoneOffset()}}if(!Date.prototype.MyTimeZoneOffset){Date.prototype.MyTimeZoneOffset=function(){var a=new Date(this.getFullYear(),0,1);var b=new Date(this.getFullYear(),6,1);return Math.max(a.getTimezoneOffset(),b.getTimezoneOffset())}}if(!Date.prototype.SetUnixTime){Date.prototype.SetUnixTime=function(a){if(this.IsDayLightSavings()){this.setTime(a*1000-(60*60*1000))}else{this.setTime(a*1000)}}}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);var config=new Object();var tt_Debug=false;var tt_Enabled=true;var TagsToTip=true;config.Above=false;config.BgColor="#5497BA";config.BgImg="";config.BorderColor="#003099";config.BorderStyle="solid";config.BorderWidth=1;config.CenterMouse=false;config.ClickClose=false;config.ClickSticky=false;config.CloseBtn=false;config.CloseBtnColors=["#990000","#FFFFFF","#DD3333","#FFFFFF"];config.CloseBtnText="&nbsp;X&nbsp;";config.CopyContent=true;config.Delay=400;config.Duration=0;config.Exclusive=false;config.FadeIn=100;config.FadeOut=100;config.FadeInterval=30;config.Fix=null;config.FollowMouse=true;config.FontColor="#F5F5F5";config.FontFace="Verdana,Geneva,sans-serif";config.FontSize="8pt";config.FontWeight="normal";config.Height=0;config.JumpHorz=false;config.JumpVert=true;config.Left=false;config.OffsetX=14;config.OffsetY=8;config.Opacity=100;config.Padding=3;config.Shadow=false;config.ShadowColor="#C0C0C0";config.ShadowWidth=5;config.Sticky=false;config.TextAlign="left";config.Title="";config.TitleAlign="left";config.TitleBgColor="";config.TitleFontColor="#FFFFFF";config.TitleFontFace="";config.TitleFontSize="";config.TitlePadding=2;config.Width=0;function Tip(){if(tt_initStart==0){tt_Init()}tt_Tip(arguments,null)}function TagToTip(){var a=tt_GetElt(arguments[0]);if(a){tt_Tip(arguments,a)}}function UnTip(){tt_OpReHref();if(tt_aV[DURATION]<0&&(tt_iState&2)){tt_tDurt.Timer("tt_HideInit()",-tt_aV[DURATION],true)}else{if(!(tt_aV[STICKY]&&(tt_iState&2))){tt_HideInit()}}}var tt_aElt=new Array(10),tt_aV=new Array(),tt_sContent,tt_t2t,tt_t2tDad,tt_musX,tt_musY,tt_over,tt_x,tt_y,tt_w,tt_h;function tt_Extension(){tt_ExtCmdEnum();tt_aExt[tt_aExt.length]=this;return this}function tt_SetTipPos(b,d){var c=tt_aElt[0].style;tt_x=b;tt_y=d;c.left=b+"px";c.top=d+"px";if(tt_ie56){var a=tt_aElt[tt_aElt.length-1];if(a){a.style.left=c.left;a.style.top=c.top}}}function tt_HideInit(){if(tt_iState){tt_ExtCallFncs(0,"HideInit");tt_iState&=~(4|8);if(tt_flagOpa&&tt_aV[FADEOUT]){tt_tFade.EndTimer();if(tt_opa){var a=Math.round(tt_aV[FADEOUT]/(tt_aV[FADEINTERVAL]*(tt_aV[OPACITY]/tt_opa)));tt_Fade(tt_opa,tt_opa,0,a);return}}tt_tHide.Timer("tt_Hide();",1,false)}}function tt_Hide(){if(tt_db&&tt_iState){tt_OpReHref();if(tt_iState&2){tt_aElt[0].style.visibility="hidden";tt_ExtCallFncs(0,"Hide")}tt_tShow.EndTimer();tt_tHide.EndTimer();tt_tDurt.EndTimer();tt_tFade.EndTimer();if(!tt_op&&!tt_ie){tt_tWaitMov.EndTimer();tt_bWait=false}if(tt_aV[CLICKCLOSE]||tt_aV[CLICKSTICKY]){tt_RemEvtFnc(document,"mouseup",tt_OnLClick)}tt_ExtCallFncs(0,"Kill");if(tt_t2t&&!tt_aV[COPYCONTENT]){tt_UnEl2Tip()}tt_iState=0;tt_over=null;tt_ResetMainDiv();if(tt_aElt[tt_aElt.length-1]){tt_aElt[tt_aElt.length-1].style.display="none"}}}function tt_GetElt(a){return(document.getElementById?document.getElementById(a):document.all?document.all[a]:null)}function tt_GetDivW(a){return(a?(a.offsetWidth||a.style.pixelWidth||0):0)}function tt_GetDivH(a){return(a?(a.offsetHeight||a.style.pixelHeight||0):0)}function tt_GetScrollX(){return(window.pageXOffset||(tt_db?(tt_db.scrollLeft||0):0))}function tt_GetScrollY(){return(window.pageYOffset||(tt_db?(tt_db.scrollTop||0):0))}function tt_GetClientW(){return tt_GetWndCliSiz("Width")}function tt_GetClientH(){return tt_GetWndCliSiz("Height")}function tt_GetEvtX(a){return(a?((typeof(a.pageX)!=tt_u)?a.pageX:(a.clientX+tt_GetScrollX())):0)}function tt_GetEvtY(a){return(a?((typeof(a.pageY)!=tt_u)?a.pageY:(a.clientY+tt_GetScrollY())):0)}function tt_AddEvtFnc(b,a,c){if(b){if(b.addEventListener){b.addEventListener(a,c,false)}else{b.attachEvent("on"+a,c)}}}function tt_RemEvtFnc(b,a,c){if(b){if(b.removeEventListener){b.removeEventListener(a,c,false)}else{b.detachEvent("on"+a,c)}}}function tt_GetDad(a){return(a.parentNode||a.parentElement||a.offsetParent)}function tt_MovDomNode(b,a,c){if(a){a.removeChild(b)}if(c){c.appendChild(b)}}var tt_aExt=new Array(),tt_initStart=0,tt_db,tt_op,tt_ie,tt_ie56,tt_bBoxOld,tt_body,tt_ovr_,tt_flagOpa,tt_maxPosX,tt_maxPosY,tt_iState=0,tt_opa,tt_bJmpVert,tt_bJmpHorz,tt_elDeHref,tt_tShow=new Number(0),tt_tHide=new Number(0),tt_tDurt=new Number(0),tt_tFade=new Number(0),tt_tWaitMov=new Number(0),tt_bWait=false,tt_u="undefined";function tt_Init(){tt_initStart=1;tt_MkCmdEnum();if(!tt_Browser()||!tt_MkMainDiv()){return}tt_IsW3cBox();tt_OpaSupport();tt_AddEvtFnc(document,"mousemove",tt_Move);if(TagsToTip||tt_Debug){tt_SetOnloadFnc()}tt_AddEvtFnc(window,"unload",tt_Hide)}function tt_MkCmdEnum(){var n=0;for(var i in config){eval("window."+i.toString().toUpperCase()+" = "+n++)}tt_aV.length=n}function tt_Browser(){var n,nv,n6,w3c;n=navigator.userAgent.toLowerCase(),nv=navigator.appVersion;tt_op=(document.defaultView&&typeof(eval("window.opera"))!=tt_u);tt_ie=n.indexOf("msie")!=-1&&document.all&&!tt_op;if(tt_ie){var ieOld=(!document.compatMode||document.compatMode=="BackCompat");tt_db=!ieOld?document.documentElement:(document.body||null);if(tt_db){tt_ie56=parseFloat(nv.substring(nv.indexOf("MSIE")+5))>=5.5&&typeof document.body.style.maxHeight==tt_u}}else{tt_db=document.documentElement||document.body||(document.getElementsByTagName?document.getElementsByTagName("body")[0]:null);if(!tt_op){n6=document.defaultView&&typeof document.defaultView.getComputedStyle!=tt_u;w3c=!n6&&document.getElementById}}tt_body=(document.getElementsByTagName?document.getElementsByTagName("body")[0]:(document.body||null));if(tt_ie||n6||tt_op||w3c){if(tt_body&&tt_db){if(document.attachEvent||document.addEventListener){return true}}else{tt_Err("wz_tooltip.js must be included INSIDE the body section, immediately after the opening <body> tag.",false)}}tt_db=null;return false}function tt_MkMainDiv(){if(tt_body.insertAdjacentHTML){tt_body.insertAdjacentHTML("afterBegin",tt_MkMainDivHtm())}else{if(typeof tt_body.innerHTML!=tt_u&&document.createElement&&tt_body.appendChild){tt_body.appendChild(tt_MkMainDivDom())}}if(window.tt_GetMainDivRefs&&tt_GetMainDivRefs()){return true}tt_db=null;return false}function tt_MkMainDivHtm(){return('<div id="WzTtDiV"></div>'+(tt_ie56?('<iframe id="WzTtIfRm" src="javascript:false" scrolling="no" frameborder="0" style="filter:Alpha(opacity=0);position:absolute;top:0px;left:0px;display:none;"></iframe>'):""))}function tt_MkMainDivDom(){var a=document.createElement("div");if(a){a.id="WzTtDiV"}return a}function tt_GetMainDivRefs(){tt_aElt[0]=tt_GetElt("WzTtDiV");if(tt_ie56&&tt_aElt[0]){tt_aElt[tt_aElt.length-1]=tt_GetElt("WzTtIfRm");if(!tt_aElt[tt_aElt.length-1]){tt_aElt[0]=null}}if(tt_aElt[0]){var a=tt_aElt[0].style;a.visibility="hidden";a.position="absolute";a.overflow="hidden";return true}return false}function tt_ResetMainDiv(){tt_SetTipPos(0,0);tt_aElt[0].innerHTML="";tt_aElt[0].style.width="0px";tt_h=0}function tt_IsW3cBox(){var a=tt_aElt[0].style;a.padding="10px";a.width="40px";tt_bBoxOld=(tt_GetDivW(tt_aElt[0])==40);a.padding="0px";tt_ResetMainDiv()}function tt_OpaSupport(){var a=tt_body.style;tt_flagOpa=(typeof(a.KhtmlOpacity)!=tt_u)?2:(typeof(a.KHTMLOpacity)!=tt_u)?3:(typeof(a.MozOpacity)!=tt_u)?4:(typeof(a.opacity)!=tt_u)?5:(typeof(a.filter)!=tt_u)?1:0}function tt_SetOnloadFnc(){tt_AddEvtFnc(document,"DOMContentLoaded",tt_HideSrcTags);tt_AddEvtFnc(window,"load",tt_HideSrcTags);if(tt_body.attachEvent){tt_body.attachEvent("onreadystatechange",function(){if(tt_body.readyState=="complete"){tt_HideSrcTags()}})}if(/WebKit|KHTML/i.test(navigator.userAgent)){var a=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(a);tt_HideSrcTags()}},10)}}function tt_HideSrcTags(){if(!window.tt_HideSrcTags||window.tt_HideSrcTags.done){return}window.tt_HideSrcTags.done=true;if(!tt_HideSrcTagsRecurs(tt_body)){tt_Err("There are HTML elements to be converted to tooltips.\nIf you want these HTML elements to be automatically hidden, you must edit wz_tooltip.js, and set TagsToTip in the global tooltip configuration to true.",true)}}function tt_HideSrcTagsRecurs(c){var f,e;var b=c.childNodes||c.children||null;for(var d=b?b.length:0;d;){--d;if(!tt_HideSrcTagsRecurs(b[d])){return false}f=b[d].getAttribute?(b[d].getAttribute("onmouseover")||b[d].getAttribute("onclick")):(typeof b[d].onmouseover=="function")?(b[d].onmouseover||b[d].onclick):null;if(f){e=f.toString().match(/TagToTip\s*\(\s*'[^'.]+'\s*[\),]/);if(e&&e.length){if(!tt_HideSrcTag(e[0])){return false}}}}return true}function tt_HideSrcTag(b){var c,a;c=b.replace(/.+'([^'.]+)'.+/,"$1");a=tt_GetElt(c);if(a){if(tt_Debug&&!TagsToTip){return false}else{a.style.display="none"}}else{tt_Err("Invalid ID\n'"+c+"'\npassed to TagToTip(). There exists no HTML element with that ID.",true)}return true}function tt_Tip(a,b){if(!tt_db||(tt_iState&8)){return}if(tt_iState){tt_Hide()}if(!tt_Enabled){return}tt_t2t=b;if(!tt_ReadCmds(a)){return}tt_iState=1|4;tt_AdaptConfig1();tt_MkTipContent(a);tt_MkTipSubDivs();tt_FormatTip();tt_bJmpVert=false;tt_bJmpHorz=false;tt_maxPosX=tt_GetClientW()+tt_GetScrollX()-tt_w-1;tt_maxPosY=tt_GetClientH()+tt_GetScrollY()-tt_h-1;tt_AdaptConfig2();tt_OverInit();tt_ShowInit();tt_Move()}function tt_ReadCmds(b){var d;d=0;for(var c in config){tt_aV[d++]=config[c]}if(b.length&1){for(d=b.length-1;d>0;d-=2){tt_aV[b[d-1]]=b[d]}return true}tt_Err("Incorrect call of Tip() or TagToTip().\nEach command must be followed by a value.",true);return false}function tt_AdaptConfig1(){tt_ExtCallFncs(0,"LoadConfig");if(!tt_aV[TITLEBGCOLOR].length){tt_aV[TITLEBGCOLOR]=tt_aV[BORDERCOLOR]}if(!tt_aV[TITLEFONTCOLOR].length){tt_aV[TITLEFONTCOLOR]=tt_aV[BGCOLOR]}if(!tt_aV[TITLEFONTFACE].length){tt_aV[TITLEFONTFACE]=tt_aV[FONTFACE]}if(!tt_aV[TITLEFONTSIZE].length){tt_aV[TITLEFONTSIZE]=tt_aV[FONTSIZE]}if(tt_aV[CLOSEBTN]){if(!tt_aV[CLOSEBTNCOLORS]){tt_aV[CLOSEBTNCOLORS]=new Array("","","","")}for(var a=4;a;){--a;if(!tt_aV[CLOSEBTNCOLORS][a].length){tt_aV[CLOSEBTNCOLORS][a]=(a&1)?tt_aV[TITLEFONTCOLOR]:tt_aV[TITLEBGCOLOR]}}if(!tt_aV[TITLE].length){tt_aV[TITLE]=" "}}if(tt_aV[OPACITY]==100&&typeof tt_aElt[0].style.MozOpacity!=tt_u&&!Array.every){tt_aV[OPACITY]=99}if(tt_aV[FADEIN]&&tt_flagOpa&&tt_aV[DELAY]>100){tt_aV[DELAY]=Math.max(tt_aV[DELAY]-tt_aV[FADEIN],100)}}function tt_AdaptConfig2(){if(tt_aV[CENTERMOUSE]){tt_aV[OFFSETX]-=((tt_w-(tt_aV[SHADOW]?tt_aV[SHADOWWIDTH]:0))>>1);tt_aV[JUMPHORZ]=false}}function tt_MkTipContent(b){if(tt_t2t){if(tt_aV[COPYCONTENT]){tt_sContent=tt_t2t.innerHTML}else{tt_sContent=""}}else{tt_sContent=b[0]}tt_ExtCallFncs(0,"CreateContentString")}function tt_MkTipSubDivs(){var b="position:relative;margin:0px;padding:0px;border-width:0px;left:0px;top:0px;line-height:normal;width:auto;",a=' cellspacing="0" cellpadding="0" border="0" style="'+b+'"><tbody style="'+b+'"><tr><td ';tt_aElt[0].style.width=tt_GetClientW()+"px";tt_aElt[0].innerHTML=(""+(tt_aV[TITLE].length?('<div id="WzTiTl" style="position:relative;z-index:1;"><table id="WzTiTlTb"'+a+'id="WzTiTlI" style="'+b+'">'+tt_aV[TITLE]+"</td>"+(tt_aV[CLOSEBTN]?('<td align="right" style="'+b+'text-align:right;"><span id="WzClOsE" style="position:relative;left:2px;padding-left:2px;padding-right:2px;cursor:'+(tt_ie?"hand":"pointer")+';" onmouseover="tt_OnCloseBtnOver(1)" onmouseout="tt_OnCloseBtnOver(0)" onclick="tt_HideInit()">'+tt_aV[CLOSEBTNTEXT]+"</span></td>"):"")+"</tr></tbody></table></div>"):"")+'<div id="WzBoDy" style="position:relative;z-index:0;"><table'+a+'id="WzBoDyI" style="'+b+'">'+tt_sContent+"</td></tr></tbody></table></div>"+(tt_aV[SHADOW]?('<div id="WzTtShDwR" style="position:absolute;overflow:hidden;"></div><div id="WzTtShDwB" style="position:relative;overflow:hidden;"></div>'):""));tt_GetSubDivRefs();if(tt_t2t&&!tt_aV[COPYCONTENT]){tt_El2Tip()}tt_ExtCallFncs(0,"SubDivsCreated")}function tt_GetSubDivRefs(){var b=new Array("WzTiTl","WzTiTlTb","WzTiTlI","WzClOsE","WzBoDy","WzBoDyI","WzTtShDwB","WzTtShDwR");for(var a=b.length;a;--a){tt_aElt[a]=tt_GetElt(b[a-1])}}function tt_FormatTip(){var f,m,e,b=tt_aV[PADDING],d,c=tt_aV[BORDERWIDTH],a,g,j=(b+c)<<1;if(tt_aV[TITLE].length){d=tt_aV[TITLEPADDING];f=tt_aElt[1].style;f.background=tt_aV[TITLEBGCOLOR];f.paddingTop=f.paddingBottom=d+"px";f.paddingLeft=f.paddingRight=(d+2)+"px";f=tt_aElt[3].style;f.color=tt_aV[TITLEFONTCOLOR];if(tt_aV[WIDTH]==-1){f.whiteSpace="nowrap"}f.fontFamily=tt_aV[TITLEFONTFACE];f.fontSize=tt_aV[TITLEFONTSIZE];f.fontWeight="bold";f.textAlign=tt_aV[TITLEALIGN];if(tt_aElt[4]){f=tt_aElt[4].style;f.background=tt_aV[CLOSEBTNCOLORS][0];f.color=tt_aV[CLOSEBTNCOLORS][1];f.fontFamily=tt_aV[TITLEFONTFACE];f.fontSize=tt_aV[TITLEFONTSIZE];f.fontWeight="bold"}if(tt_aV[WIDTH]>0){tt_w=tt_aV[WIDTH]}else{tt_w=tt_GetDivW(tt_aElt[3])+tt_GetDivW(tt_aElt[4]);if(tt_aElt[4]){tt_w+=b}if(tt_aV[WIDTH]<-1&&tt_w>-tt_aV[WIDTH]){tt_w=-tt_aV[WIDTH]}}a=-c}else{tt_w=0;a=0}f=tt_aElt[5].style;f.top=a+"px";if(c){f.borderColor=tt_aV[BORDERCOLOR];f.borderStyle=tt_aV[BORDERSTYLE];f.borderWidth=c+"px"}if(tt_aV[BGCOLOR].length){f.background=tt_aV[BGCOLOR]}if(tt_aV[BGIMG].length){f.backgroundImage="url("+tt_aV[BGIMG]+")"}f.padding=b+"px";f.textAlign=tt_aV[TEXTALIGN];if(tt_aV[HEIGHT]){f.overflow="auto";if(tt_aV[HEIGHT]>0){f.height=(tt_aV[HEIGHT]+j)+"px"}else{tt_h=j-tt_aV[HEIGHT]}}f=tt_aElt[6].style;f.color=tt_aV[FONTCOLOR];f.fontFamily=tt_aV[FONTFACE];f.fontSize=tt_aV[FONTSIZE];f.fontWeight=tt_aV[FONTWEIGHT];f.textAlign=tt_aV[TEXTALIGN];if(tt_aV[WIDTH]>0){m=tt_aV[WIDTH]}else{if(tt_aV[WIDTH]==-1&&tt_w){m=tt_w}else{m=tt_GetDivW(tt_aElt[6]);if(tt_aV[WIDTH]<-1&&m>-tt_aV[WIDTH]){m=-tt_aV[WIDTH]}}}if(m>tt_w){tt_w=m}tt_w+=j;if(tt_aV[SHADOW]){tt_w+=tt_aV[SHADOWWIDTH];g=Math.floor((tt_aV[SHADOWWIDTH]*4)/3);f=tt_aElt[7].style;f.top=a+"px";f.left=g+"px";f.width=(tt_w-g-tt_aV[SHADOWWIDTH])+"px";f.height=tt_aV[SHADOWWIDTH]+"px";f.background=tt_aV[SHADOWCOLOR];f=tt_aElt[8].style;f.top=g+"px";f.left=(tt_w-tt_aV[SHADOWWIDTH])+"px";f.width=tt_aV[SHADOWWIDTH]+"px";f.background=tt_aV[SHADOWCOLOR]}else{g=0}tt_SetTipOpa(tt_aV[FADEIN]?0:tt_aV[OPACITY]);tt_FixSize(a,g)}function tt_FixSize(a,g){var j,d,f,m,b=tt_aV[PADDING],c=tt_aV[BORDERWIDTH],e;tt_aElt[0].style.width=tt_w+"px";tt_aElt[0].style.pixelWidth=tt_w;d=tt_w-((tt_aV[SHADOW])?tt_aV[SHADOWWIDTH]:0);j=d;if(!tt_bBoxOld){j-=(b+c)<<1}tt_aElt[5].style.width=j+"px";if(tt_aElt[1]){j=d-((tt_aV[TITLEPADDING]+2)<<1);if(!tt_bBoxOld){d=j}tt_aElt[1].style.width=d+"px";tt_aElt[2].style.width=j+"px"}if(tt_h){f=tt_GetDivH(tt_aElt[5]);if(f>tt_h){if(!tt_bBoxOld){tt_h-=(b+c)<<1}tt_aElt[5].style.height=tt_h+"px"}}tt_h=tt_GetDivH(tt_aElt[0])+a;if(tt_aElt[8]){tt_aElt[8].style.height=(tt_h-g)+"px"}e=tt_aElt.length-1;if(tt_aElt[e]){tt_aElt[e].style.width=tt_w+"px";tt_aElt[e].style.height=tt_h+"px"}}function tt_DeAlt(c){var a;if(c){if(c.alt){c.alt=""}if(c.title){c.title=""}a=c.childNodes||c.children||null;if(a){for(var b=a.length;b;){tt_DeAlt(a[--b])}}}}function tt_OpDeHref(a){if(!tt_op){return}if(tt_elDeHref){tt_OpReHref()}while(a){if(a.hasAttribute&&a.hasAttribute("href")){a.t_href=a.getAttribute("href");a.t_stats=window.status;a.removeAttribute("href");a.style.cursor="hand";tt_AddEvtFnc(a,"mousedown",tt_OpReHref);window.status=a.t_href;tt_elDeHref=a;break}a=tt_GetDad(a)}}function tt_OpReHref(){if(tt_elDeHref){tt_elDeHref.setAttribute("href",tt_elDeHref.t_href);tt_RemEvtFnc(tt_elDeHref,"mousedown",tt_OpReHref);window.status=tt_elDeHref.t_stats;tt_elDeHref=null}}function tt_El2Tip(){var a=tt_t2t.style;tt_t2t.t_cp=a.position;tt_t2t.t_cl=a.left;tt_t2t.t_ct=a.top;tt_t2t.t_cd=a.display;tt_t2tDad=tt_GetDad(tt_t2t);tt_MovDomNode(tt_t2t,tt_t2tDad,tt_aElt[6]);a.display="block";a.position="static";a.left=a.top=a.marginLeft=a.marginTop="0px"}function tt_UnEl2Tip(){var a=tt_t2t.style;a.display=tt_t2t.t_cd;tt_MovDomNode(tt_t2t,tt_GetDad(tt_t2t),tt_t2tDad);a.position=tt_t2t.t_cp;a.left=tt_t2t.t_cl;a.top=tt_t2t.t_ct;tt_t2tDad=null}function tt_OverInit(){if(window.event){tt_over=window.event.target||window.event.srcElement}else{tt_over=tt_ovr_}tt_DeAlt(tt_over);tt_OpDeHref(tt_over)}function tt_ShowInit(){tt_tShow.Timer("tt_Show()",tt_aV[DELAY],true);if(tt_aV[CLICKCLOSE]||tt_aV[CLICKSTICKY]){tt_AddEvtFnc(document,"mouseup",tt_OnLClick)}}function tt_Show(){var a=tt_aElt[0].style;a.zIndex=Math.max((window.dd&&dd.z)?(dd.z+2):0,1010);if(tt_aV[STICKY]||!tt_aV[FOLLOWMOUSE]){tt_iState&=~4}if(tt_aV[EXCLUSIVE]){tt_iState|=8}if(tt_aV[DURATION]>0){tt_tDurt.Timer("tt_HideInit()",tt_aV[DURATION],true)}tt_ExtCallFncs(0,"Show");a.visibility="visible";tt_iState|=2;if(tt_aV[FADEIN]){tt_Fade(0,0,tt_aV[OPACITY],Math.round(tt_aV[FADEIN]/tt_aV[FADEINTERVAL]))}tt_ShowIfrm()}function tt_ShowIfrm(){if(tt_ie56){var a=tt_aElt[tt_aElt.length-1];if(a){var b=a.style;b.zIndex=tt_aElt[0].style.zIndex-1;b.display="block"}}}function tt_Move(a){if(a){tt_ovr_=a.target||a.srcElement}a=a||window.event;if(a){tt_musX=tt_GetEvtX(a);tt_musY=tt_GetEvtY(a)}if(tt_iState&4){if(!tt_op&&!tt_ie){if(tt_bWait){return}tt_bWait=true;tt_tWaitMov.Timer("tt_bWait = false;",1,true)}if(tt_aV[FIX]){tt_iState&=~4;tt_PosFix()}else{if(!tt_ExtCallFncs(a,"MoveBefore")){tt_SetTipPos(tt_Pos(0),tt_Pos(1))}}tt_ExtCallFncs([tt_musX,tt_musY],"MoveAfter")}}function tt_Pos(b){var h,m,c,a,d,f,e,g,j;if(b){m=tt_aV[JUMPVERT];c=ABOVE;a=OFFSETY;d=tt_h;f=tt_maxPosY;e=tt_GetScrollY();g=tt_musY;j=tt_bJmpVert}else{m=tt_aV[JUMPHORZ];c=LEFT;a=OFFSETX;d=tt_w;f=tt_maxPosX;e=tt_GetScrollX();g=tt_musX;j=tt_bJmpHorz}if(m){if(tt_aV[c]&&(!j||tt_CalcPosAlt(b)>=e+16)){h=tt_PosAlt(b)}else{if(!tt_aV[c]&&j&&tt_CalcPosDef(b)>f-16){h=tt_PosAlt(b)}else{h=tt_PosDef(b)}}}else{h=g;if(tt_aV[c]){h-=d+tt_aV[a]-(tt_aV[SHADOW]?tt_aV[SHADOWWIDTH]:0)}else{h+=tt_aV[a]}}if(h>f){h=m?tt_PosAlt(b):f}if(h<e){h=m?tt_PosDef(b):e}return h}function tt_PosDef(a){if(a){tt_bJmpVert=tt_aV[ABOVE]}else{tt_bJmpHorz=tt_aV[LEFT]}return tt_CalcPosDef(a)}function tt_PosAlt(a){if(a){tt_bJmpVert=!tt_aV[ABOVE]}else{tt_bJmpHorz=!tt_aV[LEFT]}return tt_CalcPosAlt(a)}function tt_CalcPosDef(a){return a?(tt_musY+tt_aV[OFFSETY]):(tt_musX+tt_aV[OFFSETX])}function tt_CalcPosAlt(b){var c=b?OFFSETY:OFFSETX;var a=tt_aV[c]-(tt_aV[SHADOW]?tt_aV[SHADOWWIDTH]:0);if(tt_aV[c]>0&&a<=0){a=1}return((b?(tt_musY-tt_h):(tt_musX-tt_w))-a)}function tt_PosFix(){var a,b;if(typeof(tt_aV[FIX][0])=="number"){a=tt_aV[FIX][0];b=tt_aV[FIX][1]}else{if(typeof(tt_aV[FIX][0])=="string"){el=tt_GetElt(tt_aV[FIX][0])}else{el=tt_aV[FIX][0]}a=tt_aV[FIX][1];b=tt_aV[FIX][2];if(!tt_aV[ABOVE]&&el){b+=tt_GetDivH(el)}for(;el;el=el.offsetParent){a+=el.offsetLeft||0;b+=el.offsetTop||0}}if(tt_aV[ABOVE]){b-=tt_h}tt_SetTipPos(a,b)}function tt_Fade(b,c,d,e){if(e){c+=Math.round((d-c)/e);if((d>b)?(c>=d):(c<=d)){c=d}else{tt_tFade.Timer("tt_Fade("+b+","+c+","+d+","+(e-1)+")",tt_aV[FADEINTERVAL],true)}}c?tt_SetTipOpa(c):tt_Hide()}function tt_SetTipOpa(a){tt_SetOpa(tt_aElt[5],a);if(tt_aElt[1]){tt_SetOpa(tt_aElt[1],a)}if(tt_aV[SHADOW]){a=Math.round(a*0.8);tt_SetOpa(tt_aElt[7],a);tt_SetOpa(tt_aElt[8],a)}}function tt_OnCloseBtnOver(b){var a=tt_aElt[4].style;b<<=1;a.background=tt_aV[CLOSEBTNCOLORS][b];a.color=tt_aV[CLOSEBTNCOLORS][b+1]}function tt_OnLClick(a){a=a||window.event;if(!((a.button&&a.button&2)||(a.which&&a.which==3))){if(tt_aV[CLICKSTICKY]&&(tt_iState&4)){tt_aV[STICKY]=true;tt_iState&=~4}else{if(tt_aV[CLICKCLOSE]){tt_HideInit()}}}}function tt_Int(a){var b;return(isNaN(b=parseInt(a))?0:b)}Number.prototype.Timer=function(c,b,a){if(!this.value||a){this.value=window.setTimeout(c,b)}};Number.prototype.EndTimer=function(){if(this.value){window.clearTimeout(this.value);this.value=0}};function tt_GetWndCliSiz(c){var a,f=window["inner"+c],e="client"+c,d="number";if(typeof f==d){var b;return(((a=document.body)&&typeof(b=a[e])==d&&b&&b<=f)?b:((a=document.documentElement)&&typeof(b=a[e])==d&&b&&b<=f)?b:f)}return(((a=document.documentElement)&&(f=a[e]))?f:document.body[e])}function tt_SetOpa(c,a){var b=c.style;tt_opa=a;if(tt_flagOpa==1){if(a<100){if(typeof(c.filtNo)==tt_u){c.filtNo=b.filter}var d=b.visibility!="hidden";b.zoom="100%";if(!d){b.visibility="visible"}b.filter="alpha(opacity="+a+")";if(!d){b.visibility="hidden"}}else{if(typeof(c.filtNo)!=tt_u){b.filter=c.filtNo}}}else{a/=100;switch(tt_flagOpa){case 2:b.KhtmlOpacity=a;break;case 3:b.KHTMLOpacity=a;break;case 4:b.MozOpacity=a;break;case 5:b.opacity=a;break}}}function tt_Err(b,a){if(tt_Debug||!a){alert("Tooltip Script Error Message:\n\n"+b)}}function tt_ExtCmdEnum(){var s;for(var i in config){s="window."+i.toString().toUpperCase();if(eval("typeof("+s+") == tt_u")){eval(s+" = "+tt_aV.length);tt_aV[tt_aV.length]=null}}}function tt_ExtCallFncs(c,d){var a=false;for(var e=tt_aExt.length;e;){--e;var f=tt_aExt[e]["On"+d];if(f&&f(c)){a=true}}return a}if(ThePortRegisterNS("ThePort.UI.Cropper")){ThePort.UI.Cropper=function(){this.crop_script_alwayspreserveAspectRatio=false;this.crop_script_fixedRatio=false;this.crop_script_browserIsOpera=navigator.userAgent.indexOf("Opera")>=0?true:false;this.cropDiv_left=false;this.cropDiv_top=false;this.cropDiv_right=false;this.cropDiv_bottom=false;this.cropDiv_dotted=false;this.crop_currentResizeType=false;this.cropEvent_posX=0;this.cropEvent_posY=0;this.cropEvent_eventX;this.cropEvent_eventY;this.crop_resizeCounter=-1;this.crop_moveCounter=-1;this.crop_imageDiv=false;this.imageDiv_currentWidth=false;this.imageDiv_currentHeight=false;this.imageDiv_currentLeft=false;this.imageDiv_currentTop=false;this.smallSquare_tl=0;this.smallSquare_tc=0;this.smallSquare_tr=0;this.smallSquare_lc=0;this.smallSquare_rc=0;this.smallSquare_bl=0;this.smallSquare_bc=0;this.smallSquare_br=0;this.crop_script_server_file="crop_image.php";this.cropToolBorderWidth=1;this.smallSquareWidth=7;this.offsetSmallSquares=Math.floor(this.smallSquareWidth/2);this.offsetSmallSquares=new Array();this.preserveAspectRatio=false;this.cropWidthRatio=false;this.mouseMoveEventInProgress=false;this.crop_minimumPercent=0;this.crop_maximumPercent=0;this.crop_imageWidth=600;this.crop_imageHeight=450;this.crop_originalImageWidth=2272;this.crop_originalImageHeight=1704;this.crop_minimumPercent=10;this.crop_maximumPercent=200;this.crop_minimumWidthHeight=15;this.updateFormValuesAsYouDrag=true;if(!document.all){this.updateFormValuesAsYouDrag=false}};ThePort.UI.Cropper.prototype.crop_createDivElements=function(){var b=Math.floor(this.smallSquareWidth/2);this.crop_imageDiv=document.getElementById("imageContainer");this.cropDiv_left=document.createElement("DIV");this.cropDiv_left.className="crop_transparentDiv";this.cropDiv_left.style.visibility="visible";this.cropDiv_left.style.left="0px";this.cropDiv_left.style.top="0px";this.cropDiv_left.style.height=this.crop_imageHeight+"px";this.cropDiv_left.style.width="0px";this.cropDiv_left.innerHTML="<span></span>";this.crop_imageDiv.appendChild(this.cropDiv_left);this.cropDiv_top=document.createElement("DIV");this.cropDiv_top.className="crop_transparentDiv";this.cropDiv_top.style.visibility="visible";this.cropDiv_top.style.left="0px";this.cropDiv_top.style.top="0px";this.cropDiv_top.style.height="0px";this.cropDiv_top.style.width=this.crop_imageWidth+"px";this.cropDiv_top.innerHTML="<span></span>";this.crop_imageDiv.appendChild(this.cropDiv_top);this.cropDiv_right=document.createElement("DIV");this.cropDiv_right.className="crop_transparentDiv";this.cropDiv_right.style.visibility="visible";this.cropDiv_right.style.left=(this.crop_imageWidth)+"px";this.cropDiv_right.style.top="0px";this.cropDiv_right.style.height=this.crop_imageHeight+"px";this.cropDiv_right.style.width="0px";this.cropDiv_right.innerHTML="<span></span>";this.crop_imageDiv.appendChild(this.cropDiv_right);this.cropDiv_bottom=document.createElement("DIV");this.cropDiv_bottom.className="crop_transparentDiv";this.cropDiv_bottom.style.visibility="visible";this.cropDiv_bottom.style.left="0px";this.cropDiv_bottom.style.top=(this.crop_imageHeight)+"px";this.cropDiv_bottom.style.height="0px";this.cropDiv_bottom.style.width=this.crop_imageWidth+"px";this.cropDiv_bottom.innerHTML="<span></span>";this.crop_imageDiv.appendChild(this.cropDiv_bottom);this.cropDiv_dotted=document.createElement("DIV");this.cropDiv_dotted.className="crop_dottedDiv";this.cropDiv_dotted.style.left="0px";this.cropDiv_dotted.style.top="0px";this.cropDiv_dotted.style.width=(this.crop_imageWidth-(this.cropToolBorderWidth*2))+"px";this.cropDiv_dotted.style.height=(this.crop_imageHeight-(this.cropToolBorderWidth*2))+"px";this.cropDiv_dotted.innerHTML="<div></div>";this.cropDiv_dotted.style.cursor="move";if(this.crop_script_browserIsOpera){var a=this.cropDiv_dotted.getElementsByTagName("DIV")[0];a.style.backgroundColor="transparent";this.cropDiv_bottom.style.backgroundColor="transparent";this.cropDiv_right.style.backgroundColor="transparent";this.cropDiv_top.style.backgroundColor="transparent";this.cropDiv_left.style.backgroundColor="transparent"}this.cropDiv_dotted.onmousedown=ThePort.Utils.Bind(this,"cropScript_initMove");this.smallSquare_tl=document.createElement("IMG");this.smallSquare_tl.src="/images/cropper/small_square.gif";this.smallSquare_tl.style.position="absolute";this.smallSquare_tl.style.left=(-b-(this.cropToolBorderWidth*2))+"px";this.smallSquare_tl.style.top=(-b-(this.cropToolBorderWidth*2))+"px";this.smallSquare_tl.style.cursor="nw-resize";this.smallSquare_tl.id="nw-resize";this.smallSquare_tl.onmousedown=ThePort.Utils.Bind(this,"cropScript_initResize");this.cropDiv_dotted.appendChild(this.smallSquare_tl);this.smallSquare_tr=document.createElement("IMG");this.smallSquare_tr.src="/images/cropper/small_square.gif";this.smallSquare_tr.style.position="absolute";this.smallSquare_tr.style.left=(this.crop_imageWidth-b-(this.cropToolBorderWidth*2))+"px";this.smallSquare_tr.style.top=(-b-(this.cropToolBorderWidth*2))+"px";this.smallSquare_tr.style.cursor="ne-resize";this.smallSquare_tr.id="ne-resize";this.smallSquare_tr.onmousedown=ThePort.Utils.Bind(this,"cropScript_initResize");this.cropDiv_dotted.appendChild(this.smallSquare_tr);this.smallSquare_bl=document.createElement("IMG");this.smallSquare_bl.src="/images/cropper/small_square.gif";this.smallSquare_bl.style.position="absolute";this.smallSquare_bl.style.left=(-b-(this.cropToolBorderWidth*2))+"px";this.smallSquare_bl.style.top=(this.crop_imageHeight-b-(this.cropToolBorderWidth*2))+"px";this.smallSquare_bl.style.cursor="sw-resize";this.smallSquare_bl.id="sw-resize";this.smallSquare_bl.onmousedown=ThePort.Utils.Bind(this,"cropScript_initResize");this.cropDiv_dotted.appendChild(this.smallSquare_bl);this.smallSquare_br=document.createElement("IMG");this.smallSquare_br.src="/images/cropper/small_square.gif";this.smallSquare_br.style.position="absolute";this.smallSquare_br.style.left=(this.crop_imageWidth-b-(this.cropToolBorderWidth*2))+"px";this.smallSquare_br.style.top=(this.crop_imageHeight-b-(this.cropToolBorderWidth*2))+"px";this.smallSquare_br.style.cursor="se-resize";this.smallSquare_br.id="se-resize";this.smallSquare_br.onmousedown=ThePort.Utils.Bind(this,"cropScript_initResize");this.cropDiv_dotted.appendChild(this.smallSquare_br);this.smallSquare_tc=document.createElement("IMG");this.smallSquare_tc.src="/images/cropper/small_square.gif";this.smallSquare_tc.style.position="absolute";this.smallSquare_tc.style.left=(Math.floor(this.crop_imageWidth/2)-b-(this.cropToolBorderWidth*2))+"px";this.smallSquare_tc.style.top=(-b-(this.cropToolBorderWidth*2))+"px";this.smallSquare_tc.style.cursor="s-resize";this.smallSquare_tc.id="n-resize";this.smallSquare_tc.onmousedown=ThePort.Utils.Bind(this,"cropScript_initResize");this.cropDiv_dotted.appendChild(this.smallSquare_tc);this.smallSquare_bc=document.createElement("IMG");this.smallSquare_bc.src="/images/cropper/small_square.gif";this.smallSquare_bc.style.position="absolute";this.smallSquare_bc.style.left=(Math.floor(this.crop_imageWidth/2)-b-(this.cropToolBorderWidth*2))+"px";this.smallSquare_bc.style.top=(this.crop_imageHeight-b-(this.cropToolBorderWidth*2))+"px";this.smallSquare_bc.style.cursor="s-resize";this.smallSquare_bc.id="s-resize";this.smallSquare_bc.onmousedown=ThePort.Utils.Bind(this,"cropScript_initResize");this.cropDiv_dotted.appendChild(this.smallSquare_bc);this.smallSquare_lc=document.createElement("IMG");this.smallSquare_lc.src="/images/cropper/small_square.gif";this.smallSquare_lc.style.position="absolute";this.smallSquare_lc.style.left=(-b-(this.cropToolBorderWidth*2))+"px";this.smallSquare_lc.style.top=(Math.floor(this.crop_imageHeight/2)-b-(this.cropToolBorderWidth*2))+"px";this.smallSquare_lc.style.cursor="e-resize";this.smallSquare_lc.id="w-resize";this.smallSquare_lc.onmousedown=ThePort.Utils.Bind(this,"cropScript_initResize");this.cropDiv_dotted.appendChild(this.smallSquare_lc);this.smallSquare_rc=document.createElement("IMG");this.smallSquare_rc.src="/images/cropper/small_square.gif";this.smallSquare_rc.style.position="absolute";this.smallSquare_rc.style.left=(this.crop_imageWidth-b-(this.cropToolBorderWidth*2))+"px";this.smallSquare_rc.style.top=(Math.floor(this.crop_imageHeight/2)-b-(this.cropToolBorderWidth*2))+"px";this.smallSquare_rc.style.cursor="e-resize";this.smallSquare_rc.id="e-resize";this.smallSquare_rc.onmousedown=ThePort.Utils.Bind(this,"cropScript_initResize");this.cropDiv_dotted.appendChild(this.smallSquare_rc);this.crop_imageDiv.appendChild(this.cropDiv_dotted)};ThePort.UI.Cropper.prototype.cropScript_initMove=function(a){if(document.all){a=event}if(a.target){source=a.target}else{if(a.srcElement){source=a.srcElement}}if(source.nodeType==3){source=source.parentNode}if(source.id&&source.id.indexOf("resize")>=0){return}this.imageDiv_currentLeft=this.cropDiv_dotted.style.left.replace("px","")/1;this.imageDiv_currentTop=this.cropDiv_dotted.style.top.replace("px","")/1;this.imageDiv_currentWidth=this.cropDiv_dotted.style.width.replace("px","")/1;this.imageDiv_currentHeight=this.cropDiv_dotted.style.height.replace("px","")/1;this.cropEvent_eventX=a.clientX;this.cropEvent_eventY=a.clientY;this.crop_moveCounter=0;this.cropScript_timerMove(this);return false};ThePort.UI.Cropper.prototype.cropScript_timerMove=function(a){if(this.crop_moveCounter>=0&&this.crop_moveCounter<10){this.crop_moveCounter++;function b(){a.cropScript_timerMove(a)}setTimeout(b,1);return}};ThePort.UI.Cropper.prototype.cropScript_initResize=function(a){if(document.all){a=event}this.cropDiv_dotted.style.cursor="default";if(a.target){source=a.target}else{if(a.srcElement){source=a.srcElement}}if(source.nodeType==3){source=source.parentNode}this.crop_currentResizeType=source.id;this.cropEvent_eventX=a.clientX;this.cropEvent_eventY=a.clientY;this.crop_resizeCounter=0;this.imageDiv_currentWidth=this.cropDiv_dotted.style.width.replace("px","")/1;this.imageDiv_currentHeight=this.cropDiv_dotted.style.height.replace("px","")/1;this.imageDiv_currentLeft=this.cropDiv_dotted.style.left.replace("px","")/1;this.imageDiv_currentTop=this.cropDiv_dotted.style.top.replace("px","")/1;this.cropWidthRatio=this.cropDiv_dotted.offsetWidth/this.cropDiv_dotted.offsetHeight;if(this.crop_script_fixedRatio){this.cropWidthRatio=this.crop_script_fixedRatio}if(document.all){var b=this.cropDiv_dotted.getElementsByTagName("DIV")[0];b.style.display="none"}this.cropScript_timerResize(this);return false};ThePort.UI.Cropper.prototype.cropScript_timerResize=function(a){if(this.crop_resizeCounter>=0&&this.crop_resizeCounter<10){this.crop_resizeCounter=this.crop_resizeCounter+1;function b(){a.cropScript_timerResize(a)}setTimeout(b,1);return}};ThePort.UI.Cropper.prototype.cropScript_executeCrop=function(b){crop_startProgressBar();b.style.visibility="hidden";var c=this.offsetSmallSquares.length;this.offsetSmallSquares[c]=new sack();var a=this.crop_script_server_file;this.offsetSmallSquares[c].requestFile=a;this.offsetSmallSquares[c].setVar("image_ref",document.getElementById("input_image_ref").value);this.offsetSmallSquares[c].setVar("x",document.getElementById("input_crop_x").value);this.offsetSmallSquares[c].setVar("y",document.getElementById("input_crop_y").value);this.offsetSmallSquares[c].setVar("width",document.getElementById("input_crop_width").value);this.offsetSmallSquares[c].setVar("height",document.getElementById("input_crop_height").value);this.offsetSmallSquares[c].setVar("percentSize",document.getElementById("crop_percent_size").value);this.offsetSmallSquares[c].setVar("convertTo",document.getElementById("input_convert_to").options[document.getElementById("input_convert_to").selectedIndex].value);this.offsetSmallSquares[c].onCompletion=function(){cropScript_cropCompleted(c,b)};this.offsetSmallSquares[c].runAJAX()};ThePort.UI.Cropper.prototype.cropScript_cropCompleted=function(ajaxIndex,buttonObj){buttonObj.style.visibility="";eval(this.offsetSmallSquares[ajaxIndex].response);this.offsetSmallSquares[ajaxIndex]=false;crop_hideProgressBar()};ThePort.UI.Cropper.prototype.crop_cancelEvent=function(a){if(document.all){a=event}if(a.target){source=a.target}else{if(a.srcElement){source=a.srcElement}}if(source.nodeType==3){source=source.parentNode}if(source.tagName&&source.tagName.toLowerCase()=="input"){return true}return false};ThePort.UI.Cropper.prototype.getAdjustedCoordinates=function(g,c,m,f){f=f.replace("-resize","");var b=m?this.crop_minimumWidthHeight*m:this.crop_minimumWidthHeight;var j=m?this.crop_minimumWidthHeight/m:this.crop_minimumWidthHeight;if(g.left+g.width+2>this.crop_imageWidth){g.width=this.crop_imageWidth-g.left-2}if(g.top+g.height+2>this.crop_imageHeight){g.height=this.crop_imageHeight-g.top-2}if(g.height<j){g.height=c.height;g.top=c.top}if(g.width<b){g.width=c.width;g.left=c.left}if(m){var e=g.width/g.height;switch(f){case"n":var d=Math.round(g.height*m);g.left+=(g.width-d);g.width=d;break;case"w":case"nw":case"ne":var a=Math.round(g.width/m);g.top+=(g.height-a);g.height=a;break;case"e":case"se":g.height=Math.round(g.width/m);break;case"s":g.width=Math.round(g.height*m);break;default:}if(g.left<0){g.width+=g.left;g.height=g.width/m;g.left=0}if(g.top<0){var h=g.width;g.height+=g.top;g.width=g.height*m;g.top=0;if(f=="nw"){g.left+=(h-g.width)}}if(g.width<b){g.width=b;g.height=g.width/m}if(g.height<j){g.height=j;g.width=g.height*m}if(g.left+g.width+2>this.crop_imageWidth){g.width=this.crop_imageWidth-g.left-2;g.height=Math.round(g.width/m)}if(g.top+g.height+2>this.crop_imageHeight){g.height=this.crop_imageHeight-g.top-2;g.width=Math.round(g.height*m)}}if(g.height<j){g.height=c.height;g.top=c.top}if(g.width<b){g.width=c.width;g.left=c.left}return g};ThePort.UI.Cropper.prototype.cropScript_mouseMove=function(f){if(this.crop_moveCounter<10&&this.crop_resizeCounter<10){return}if(this.mouseMoveEventInProgress){return}if(document.all){this.mouseMoveEventInProgress=true}if(document.all){f=event}if(this.crop_resizeCounter==10){var g=this.cropDiv_dotted.style;if(f.ctrlKey||this.crop_script_alwayspreserveAspectRatio){this.preserveAspectRatio=true}else{this.preserveAspectRatio=false}var b={left:g.left.replace("px","")/1,top:g.top.replace("px","")/1,width:this.cropDiv_dotted.clientWidth,height:this.cropDiv_dotted.clientHeight};var j={};j.left=b.left;j.top=b.top;j.width=b.width;j.height=b.height;if(this.crop_currentResizeType=="e-resize"||this.crop_currentResizeType=="ne-resize"||this.crop_currentResizeType=="se-resize"){j.width=Math.max(this.crop_minimumWidthHeight,(this.imageDiv_currentWidth+f.clientX-this.cropEvent_eventX))}if(this.crop_currentResizeType=="s-resize"||this.crop_currentResizeType=="sw-resize"||this.crop_currentResizeType=="se-resize"){j.height=Math.max(this.crop_minimumWidthHeight,(this.imageDiv_currentHeight+f.clientY-this.cropEvent_eventY))}if(this.crop_currentResizeType=="n-resize"||this.crop_currentResizeType=="nw-resize"||this.crop_currentResizeType=="ne-resize"){var a=Math.max(0,(this.imageDiv_currentTop+f.clientY-this.cropEvent_eventY));j.height+=(b.top-a);j.top=a}if(this.crop_currentResizeType=="w-resize"||this.crop_currentResizeType=="sw-resize"||this.crop_currentResizeType=="nw-resize"){var c=Math.max(0,(this.imageDiv_currentLeft+f.clientX-this.cropEvent_eventX));j.width+=(b.left-c);j.left=c}if(j&&(j.left||j.top||j.width||j.height)){j=this.getAdjustedCoordinates(j,b,this.preserveAspectRatio?this.cropWidthRatio:false,this.crop_currentResizeType)}if(j){g.left=j.left+"px";g.top=j.top+"px";g.width=j.width+"px";g.height=j.height+"px"}if(!this.crop_script_fixedRatio&&!f.ctrlKey){this.cropWidthRatio=this.cropDiv_dotted.offsetWidth/this.cropDiv_dotted.offsetHeight}}if(this.crop_moveCounter==10){var d=this.imageDiv_currentLeft+f.clientX-this.cropEvent_eventX;if(d<0){d=0}if((d+this.imageDiv_currentWidth+(this.cropToolBorderWidth*2))>this.crop_imageWidth){d=this.crop_imageWidth-this.imageDiv_currentWidth-(this.cropToolBorderWidth*2)}this.cropDiv_dotted.style.left=d+"px";var h=this.imageDiv_currentTop+f.clientY-this.cropEvent_eventY;if(h<0){h=0}if((h+this.imageDiv_currentHeight+(this.cropToolBorderWidth*2))>this.crop_imageHeight){h=this.crop_imageHeight-this.imageDiv_currentHeight-(this.cropToolBorderWidth*2)}this.cropDiv_dotted.style.top=h+"px"}this.repositionSmallSquares();this.resizeTransparentSquares();if(this.updateFormValuesAsYouDrag){this.cropScript_updateFormValues()}this.mouseMoveEventInProgress=false};ThePort.UI.Cropper.prototype.repositionSmallSquares=function(){this.smallSquare_tc.style.left=(Math.floor((this.cropDiv_dotted.style.width.replace("px","")/1+(this.cropToolBorderWidth*2))/2)-this.offsetSmallSquares-(this.cropToolBorderWidth*2))+"px";this.smallSquare_bc.style.left=(Math.floor((this.cropDiv_dotted.style.width.replace("px","")/1+(this.cropToolBorderWidth*2))/2)-this.offsetSmallSquares-(this.cropToolBorderWidth*2))+"px";this.smallSquare_tr.style.left=(this.cropDiv_dotted.style.width.replace("px","")/1+(this.cropToolBorderWidth*2)-this.offsetSmallSquares-(this.cropToolBorderWidth*2))+"px";this.smallSquare_rc.style.left=(this.cropDiv_dotted.style.width.replace("px","")/1+(this.cropToolBorderWidth*2)-this.offsetSmallSquares-(this.cropToolBorderWidth*2))+"px";this.smallSquare_br.style.left=(this.cropDiv_dotted.style.width.replace("px","")/1+(this.cropToolBorderWidth*2)-this.offsetSmallSquares-(this.cropToolBorderWidth*2))+"px";this.smallSquare_br.style.top=(this.cropDiv_dotted.style.height.replace("px","")/1+(this.cropToolBorderWidth*2)-this.offsetSmallSquares-(this.cropToolBorderWidth*2))+"px";this.smallSquare_bc.style.top=(this.cropDiv_dotted.style.height.replace("px","")/1+(this.cropToolBorderWidth*2)-this.offsetSmallSquares-(this.cropToolBorderWidth*2))+"px";this.smallSquare_bl.style.top=(this.cropDiv_dotted.style.height.replace("px","")/1+(this.cropToolBorderWidth*2)-this.offsetSmallSquares-(this.cropToolBorderWidth*2))+"px";this.smallSquare_lc.style.top=(Math.floor((this.cropDiv_dotted.style.height.replace("px","")/1+this.cropToolBorderWidth)/2)-this.offsetSmallSquares-(this.cropToolBorderWidth*2))+"px";this.smallSquare_rc.style.top=(Math.floor((this.cropDiv_dotted.style.height.replace("px","")/1+this.cropToolBorderWidth)/2)-this.offsetSmallSquares-(this.cropToolBorderWidth*2))+"px"};ThePort.UI.Cropper.prototype.resizeTransparentSquares=function(){this.cropDiv_left.style.width=this.cropDiv_dotted.style.left;this.cropDiv_right.style.width=Math.max(0,this.crop_imageWidth-(this.cropToolBorderWidth*2)-(this.cropDiv_dotted.style.width.replace("px","")/1+this.cropDiv_dotted.style.left.replace("px","")/1))+"px";this.cropDiv_right.style.left=(this.cropDiv_dotted.style.width.replace("px","")/1+(this.cropToolBorderWidth*2)+this.cropDiv_dotted.style.left.replace("px","")/1)+"px";this.cropDiv_bottom.style.height=Math.max(0,this.crop_imageHeight-(this.cropToolBorderWidth*2)-(this.cropDiv_dotted.style.height.replace("px","")/1+this.cropDiv_dotted.style.top.replace("px","")/1))+"px";this.cropDiv_bottom.style.top=(this.cropDiv_dotted.style.height.replace("px","")/1+(this.cropToolBorderWidth*2)+this.cropDiv_dotted.style.top.replace("px","")/1)+"px";this.cropDiv_top.style.height=this.cropDiv_dotted.style.top;this.cropDiv_bottom.style.left=this.cropDiv_dotted.style.left;this.cropDiv_bottom.style.width=(this.cropDiv_dotted.style.width.replace("px","")/1+(this.cropToolBorderWidth*2))+"px";this.cropDiv_top.style.left=this.cropDiv_dotted.style.left;this.cropDiv_top.style.width=(this.cropDiv_dotted.style.width.replace("px","")/1+(this.cropToolBorderWidth*2))+"px";if(this.cropDiv_left.style.width=="0px"){this.cropDiv_left.style.visibility="hidden"}else{this.cropDiv_left.style.visibility="visible"}if(this.cropDiv_right.style.width=="0px"){this.cropDiv_right.style.visibility="hidden"}else{this.cropDiv_right.style.visibility="visible"}if(this.cropDiv_bottom.style.width=="0px"){this.cropDiv_bottom.style.visibility="hidden"}else{this.cropDiv_bottom.style.visibility="visible"}};ThePort.UI.Cropper.prototype.cropScript_updateFormValues=function(){};ThePort.UI.Cropper.prototype.cropScript_stopResizeMove=function(){this.crop_resizeCounter=-1;this.crop_moveCounter=-1;this.cropDiv_dotted.style.cursor="move";this.cropScript_updateFormValues();if(document.all){var a=this.cropDiv_dotted.getElementsByTagName("DIV")[0];a.style.display="block"}};ThePort.UI.Cropper.prototype.cropScript_setCropSizeByInput=function(){var d=document.getElementById("input_crop_x");var c=document.getElementById("input_crop_y");var b=document.getElementById("input_crop_width");var a=document.getElementById("input_crop_height");d.value=d.value.replace(/[^0-9]/gi,"");c.value=c.value.replace(/[^0-9]/gi,"");b.value=b.value.replace(/[^0-9]/gi,"");a.value=a.value.replace(/[^0-9]/gi,"");if(d.value.length==0){d.value=0}if(c.value.length==0){c.value=0}if(b.value.length==0){b.value=this.crop_originalImageWidth}if(a.value.length==0){a.value=this.crop_originalImageHeight}if(d.value>(this.crop_originalImageWidth-this.crop_minimumWidthHeight)){d.value=this.crop_originalImageWidth-this.crop_minimumWidthHeight}if(c.value>(this.crop_originalImageHeight-this.crop_minimumWidthHeight)){c.value=this.crop_originalImageHeight-this.crop_minimumWidthHeight}if(b.value/1>this.crop_originalImageWidth){b.value=this.crop_originalImageWidth-d.value/1}if(a.value/1>this.crop_originalImageHeight){a.value=this.crop_originalImageHeight-c.value/1}if(d.value/1+b.value/1>this.crop_originalImageWidth){b.value=this.crop_originalImageWidth-d.value}if(c.value/1+a.value/1>this.crop_originalImageHeight){a.value=this.crop_originalImageHeight-c.value}this.cropDiv_dotted.style.left=Math.round(d.value/1*(this.crop_imageWidth/this.crop_originalImageWidth))+"px";this.cropDiv_dotted.style.top=Math.round(c.value/1*(this.crop_imageHeight/this.crop_originalImageHeight))+"px";this.cropDiv_dotted.style.width=Math.round((b.value/1-(this.cropToolBorderWidth*2))*(this.crop_imageWidth/this.crop_originalImageWidth))+"px";this.cropDiv_dotted.style.height=Math.round((a.value/1-(this.cropToolBorderWidth*2))*(this.crop_imageHeight/this.crop_originalImageHeight))+"px";repositionSmallSquares();resizeTransparentSquares()};ThePort.UI.Cropper.prototype.cropScript_setBasicEvents=function(){document.documentElement.ondragstart=ThePort.Utils.Bind(this,"crop_cancelEvent");document.documentElement.onselectstart=ThePort.Utils.Bind(this,"crop_cancelEvent");document.documentElement.onmousemove=ThePort.Utils.Bind(this,"cropScript_mouseMove");document.documentElement.onmouseup=ThePort.Utils.Bind(this,"cropScript_stopResizeMove")};ThePort.UI.Cropper.prototype.cropScript_validatePercent=function(){this.value=this.value.replace(/[^0-9]/gi,"");if(this.value.length==0){this.value="1"}if(this.value/1>this.crop_minimumPercent){this.value="100"}if(this.value/1<this.crop_minimumPercent){this.value=this.crop_minimumPercent}};ThePort.UI.Cropper.prototype.crop_progressBar=function(){};ThePort.UI.Cropper.prototype.crop_hideProgressBar=function(){document.getElementById("crop_progressBar").style.visibility="hidden"};ThePort.UI.Cropper.prototype.crop_startProgressBar=function(){var a=document.getElementById("crop_progressBar").getElementsByTagName("DIV")[0];a.style.left="0px";document.getElementById("crop_progressBar").style.visibility="visible"};ThePort.UI.Cropper.prototype.crop_progressBarMove=function(){var b=document.getElementById("crop_progressBar").getElementsByTagName("DIV")[0];var a=b.style.left.replace("px","")/1;a=a+1;if(a>b.parentNode.clientWidth){a=0-b.clientWidth}b.style.left=a+"px"};ThePort.UI.Cropper.prototype.crop_initFixedRatio=function(){if(this.crop_script_fixedRatio>1){document.getElementById("input_crop_height").value=Math.round(document.getElementById("input_crop_width").value)/this.crop_script_fixedRatio}else{document.getElementById("input_crop_width").value=Math.round(document.getElementById("input_crop_height").value)/this.crop_script_fixedRatio}this.cropScript_setCropSizeByInput()};ThePort.UI.Cropper.prototype.init_imageCrop=function(){this.cropScript_setBasicEvents();this.crop_createDivElements();this.crop_progressBar();this.cropScript_updateFormValues();if(this.crop_script_fixedRatio&&this.crop_script_alwayspreserveAspectRatio){this.crop_initFixedRatio()}}}if(ThePortRegisterNS("ThePort.ExpandingContainer")){ThePort.ExpandingContainer={ToggleExpandingArea:function(b){var c=document.getElementById("tp_ExpandingContainer_"+b);var a=document.getElementById("tp_contentsContainer_"+b);var d=document.getElementById("tp_ExpandingContainerBtn_"+b);if(c.style.height=="auto"){c.style.height=c.oldHeight+"px";d.innerHTML=ThePort.Label.Get("GLOBAL_LOWER_CASE_SHOW_MORE_LINK_TEXT_LABEL")+"<img src='/images/blank.gif' class='tp_arrowDown'/>"}else{c.oldHeight=ThePort.ExpandingContainer.HeightMinusPadding(c,c.clientHeight);c.style.height="auto";d.innerHTML=ThePort.Label.Get("GLOBAL_LOWER_CASE_SHOW_LESS_LINK_TEXT_LABEL")+"<img src='/images/blank.gif' class='tp_arrowUp'/>"}},HeightMinusPadding:function(d,f){var c,e,b;if(d.currentStyle){c=d.currentStyle.paddingTop;e=d.currentStyle.paddingBottom}else{c=document.defaultView.getComputedStyle(d,null).getPropertyValue("padding-top");e=document.defaultView.getComputedStyle(d,null).getPropertyValue("padding-bottom")}c=c.split("px");e=e.split("px");var a=(f-(parseFloat(c[0])+parseFloat(e[0])));if(a>0){a=a}else{a=0}return a},CheckForOverflow:function(b){var c=document.getElementById("tp_ExpandingContainer_"+b);var a=document.getElementById("tp_contentsContainer_"+b);var d=ThePort.ExpandingContainer.HeightMinusPadding(c,c.clientHeight);if(d<=a.offsetHeight){c.oldHeight=d}else{c.style.height=a.offsetHeight+"px";document.getElementById("tp_ExpandingContainerBtnDiv_"+b).parentNode.removeChild(document.getElementById("tp_ExpandingContainerBtnDiv_"+b))}},CheckExpandingContainer:function(a){if(typeof document.styleSheets[0]==ThePort.Common.CONST_OBJECT_TYPE){ThePort.ExpandingContainer.CheckForOverflow(a);oExpandoInterval=window["sExpInterval_"+a];xInterval=clearInterval(oExpandoInterval)}}}}ThePortRegisterNS("ThePort.Poll.Helper");ThePort.Poll.Helper=function(){ThePort.Poll.AnswerRequiredMessage="";ThePort.Poll.AnswerLengthMsg="";ThePort.Poll.DateNotInPastMsg="";ThePort.Poll.ExpireDateID="";ThePort.Poll.AnswerWidth="";ThePort.Poll.AnswerHeight="";ThePort.Poll.AnswerCount="";ThePort.Poll.PartnerID="";ThePort.Poll.PollID="";ThePort.Poll.AnswersJSFieldName="";ThePort.Poll.PollDataJSFieldName="";ThePort.Poll.RemoveAnswerJSFieldName="";ThePort.Poll.QuestionRequiredMessage="";ThePort.Poll.MaxAnswersMessage=""};ThePort.Poll.Helper.prototype.Initialize=function(b,q,n,p,e,h,o,a,g,m,d,f,c,j){ThePort.Poll.AnswerRequiredMessage=b;ThePort.Poll.AnswerLengthMsg=q;ThePort.Poll.DateNotInPastMsg=n;ThePort.Poll.ExpireDateID=p;ThePort.Poll.AnswerWidth=e;ThePort.Poll.AnswerHeight=h;ThePort.Poll.AnswerCount=o;ThePort.Poll.PartnerID=a;ThePort.Poll.PollID=g;ThePort.Poll.AnswersJSFieldName=m;ThePort.Poll.PollDataJSFieldName=d;ThePort.Poll.RemoveAnswerJSFieldName=f;ThePort.Poll.QuestionRequiredMessage=c;ThePort.Poll.MaxAnswersMessage=j};ThePort.Poll.Helper.prototype.CreateAnswer=function(a,c,f){var e=document.getElementById("divAnswers");var g;var d;d=ThePort.Poll.AnswerCount;ThePort.Poll.AnswerCount++;var b=document.createElement("div");b.setAttribute("id","divAnswer-"+d);b.innerHTML="<div><textarea name='txtNameAnswer-"+d+"' id='txtAnswer-"+d+"' value=''></textarea> <a id='aAnswer-"+d+"' href='javascript:ThePort.Poll.Helper.prototype.RemoveAnswer("+d+");'><label id='lblAnswer-"+d+"' for='txtNameAnswer-"+d+"'><img class='closeXimg' src='/images/blank.gif' title='Delete' /></label></a></div><input id='AnswerID-"+d+"' type='hidden' value='' /><div style='clear:both;'> </div>";e.appendChild(b)};ThePort.Poll.Helper.prototype.CreateAnswer2=function(a,b,c){ThePort.Poll.Helper.prototype.CreateAnswer(a,b,c)};ThePort.Poll.Helper.prototype.RecalibrateAnswers=function(){var c=document.getElementById("divAnswers");var e=c.childNodes.length;var a;var f;var d;var b=0;for(i=0;i<=ThePort.Poll.AnswerCount-1;i++){f=document.getElementById("txtAnswer-"+i);a=document.getElementById("divAnswer-"+i);d=document.getElementById("AnswerID-"+i);oAnswerHref=document.getElementById("aAnswer-"+i);oAnswerLabel=document.getElementById("lblAnswer-"+i);if(a!=null&&a!="undefined"){a.setAttribute("id","divAnswer-"+b);f.setAttribute("id","txtAnswer-"+b);f.setAttribute("name","txtNameAnswer-"+b);d.setAttribute("id","AnswerID-"+b);oAnswerHref.setAttribute("id","aAnswer-"+b);oAnswerHref.setAttribute("href","javascript:ThePort.Poll.Helper.prototype.RemoveAnswer("+b+")");oAnswerLabel.setAttribute("id","lblAnswer-"+b);b+=1}}ThePort.Poll.AnswerCount-=1};ThePort.Poll.Helper.prototype.RemoveAnswer=function(d){var e=document.getElementById("divAnswers");var g=e.childNodes.length;var b;var a;var f;var c=document.getElementById(ThePort.Poll.RemoveAnswerJSFieldName);if(ThePort.Poll.AnswerCount>2){a=document.getElementById("PollID");f=document.getElementById("AnswerID-"+d);c.value=c.value+f.value+"|";b=document.getElementById("divAnswer-"+d);e.removeChild(b);ThePort.Poll.Helper.prototype.RecalibrateAnswers()}else{alert(ThePort.Poll.AnswerRequiredMessage)}};ThePort.Poll.Helper.prototype.RemoveAnswer2=function(a){ThePort.Poll.Helper.prototype.RemoveAnswer(a)};ThePort.Poll.Helper.prototype.SavePollData2=function(){ThePort.Poll.Helper.prototype.SavePollData()};ThePort.Poll.Helper.prototype.SavePollData=function(){var d=document.getElementById("divAnswers");var c=d.childNodes.length;var D=document.getElementById(ThePort.Poll.AnswersJSFieldName);var g=document.getElementById(ThePort.Poll.ExpireDateID);document.getElementById(ThePort.Poll.ExpireDateID).setAttribute("value",g.value);document.getElementById(ThePort.Poll.ExpireDateID).innHTML=g.value;var f;var B;var b=document.getElementById(ThePort.Poll.PollDataJSFieldName);var z=document.getElementById("txtQuestion");document.getElementById("txtQuestion").setAttribute("value",z.value);try{document.getElementById("txtQuestion").innerHTML=z.value}catch(e){document.getElementById("txtQuestion").innerText=z.value}var E=document.getElementById("txtDescription");document.getElementById("txtDescription").setAttribute("value",E.value);try{document.getElementById("txtDescription").innerHTML=E.value}catch(e){document.getElementById("txtDescription").innerText=E.value}var a=document.getElementById("chkMultipleChoice");if(a.checked==true){document.getElementById("chkMultipleChoice").setAttribute("checked","checked")}else{document.getElementById("chkMultipleChoice").removeAttribute("checked")}var A=document.getElementById("chkSendBulletin");if(A!=null&&A!="undefined"){if(A.checked==true){document.getElementById("chkSendBulletin").setAttribute("checked","checked")}else{document.getElementById("chkSendBulletin").removeAttribute("checked")}}var v=document.getElementById("PollID");var q;var w;var p=0;var y=0;var r=document.getElementById("ddStatus");var m;var C="";var o=document.getElementById(ThePort.Poll.RemoveAnswerJSFieldName);if(r!=null&&r!="undefined"){m=r.options[r.selectedIndex];C=m.value}D.value="";b.value="";if(z.value.length==0){alert(ThePort.Poll.QuestionRequiredMessage);return false}for(i=0;i<=ThePort.Poll.AnswerCount-1;i++){f=document.getElementById("AnswerID-"+i);B=document.getElementById("txtAnswer-"+i);if(B!=null){document.getElementById("txtAnswer-"+i).setAttribute("value",B.value);try{document.getElementById("txtAnswer-"+i).innerHTML=B.value}catch(e){document.getElementById("txtAnswer-"+i).innerText=B.value}if(B.value.length>0){y++}if(B.value.length>1000){alert(ThePort.Poll.AnswerLengthMsg);return false}D.value=D.value+f.value+"^"+B.value+"|"}}if(y<2){alert(ThePort.Poll.AnswerRequiredMessage);return false}if(y>25){alert(ThePort.Poll.MaxAnswersMessage);return false}D.value=D.value.substring(0,D.value.length-1);if(o.value.length>0){o.value=o.value.substring(0,o.value.length-1)}dtToday=new Date();dtToday=new Date(dtToday.getFullYear(),dtToday.getMonth(),dtToday.getDate(),0,0,0);if(g.value!=""){var u=parseInt(g.value.substring(6,10),10);var s=parseInt(g.value.substring(3,5),10);var h=parseInt(g.value.substring(0,2),10)-1;dtTempStartDate=new Date(u,h,s,0,0,0);if(dtTempStartDate<dtToday){alert(ThePort.Poll.DateNotInPastMsg);return false}}if(A!=null&&A!="undefined"){b.value=b.value+v.value+"^"+g.value+"^"+z.value+"^"+E.value+"^"+a.checked+"^"+A.checked+"^"+C}else{b.value=b.value+v.value+"^"+g.value+"^"+z.value+"^"+E.value+"^"+a.checked+"^^"+C}var F=document.getElementById("divPoll");var n=document.getElementById("pollContentId");n.value=F.innerHTML;var j=document.getElementById("answerCountId");j.setAttribute("value",ThePort.Poll.AnswerCount);doPostBack("Save","")};ThePort.Poll.Helper.prototype.ShowPollPreview=function(d,c){var a="";var b;b=encodeURI("/apis/services/polling/PollingService.asmx/GetPoll");if(!d){a+="sPollID="+ThePort.Poll.PollID;a+="&sPartnerID="+ThePort.Poll.PartnerID}else{a+="sPollID="+d;a+="&sPartnerID="+c}ThePort.Utils.Ajax("POST",b,ThePort.Utils.Bind(this,"OnShowPollPreviewResponse"),a)};ThePort.Poll.Helper.prototype.ShowPollPreview2=function(d,c){var a="";var b;b=encodeURI("/apis/services/polling/PollingService.asmx/GetPoll");if(!d){a+="sPollID="+ThePort.Poll.PollID;a+="&sPartnerID="+ThePort.Poll.PartnerID}else{a+="sPollID="+d;a+="&sPartnerID="+c}ThePort.Utils.Ajax("POST",b,ThePort.Utils.Bind(this,"OnShowPollPreviewResponse"),a)};ThePort.Poll.Helper.prototype.OnShowPollPreviewResponse=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.Poll.Helper.prototype.ShowPollPreview_InResponse(a,b.Data)}catch(f){}return d};ThePort.Poll.Helper.prototype.ShowPollPreview_InResponse=function(a,b){if(a){ThePort.UI.PopWindow.OpenModalWindow(encodeURI("/app/render/pop.aspx?dict="+b),600,300)}else{}};ThePort.Poll.Helper.prototype.ViewResults=function(f,e,d,c){var a="";var b;b=encodeURI("/apis/services/polling/PollingService.asmx/ViewResults");a+="sPollID="+f;a+="&sPartnerID="+e;ThePort.Utils.Ajax("POST",b,ThePort.Utils.Bind(this,"OnViewResultsPreviewResponse"),a)};ThePort.Poll.Helper.prototype.OnViewResultsPreviewResponse=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.Poll.Helper.prototype.ViewResults_InResponse(a,b.Data)}catch(f){}return d};ThePort.Poll.Helper.prototype.ViewResults_InResponse=function(a,b){if(a){ThePort.UI.PopWindow.OpenModalWindow(encodeURI("/app/render/pop.aspx?dict="+b),600,400)}else{}};ThePort.Poll.Helper.prototype.SetStatus=function(a){__doPostBack("setstatus",a)};if(ThePortRegisterNS("ThePort.ItemStamp")){ThePort.ItemStamp={oItemArray:new Array(),AddItemStamp:function(b,c){var a=new ThePort.ModuleItemStamp(b,c);ThePort.ItemStamp.oItemArray.push(a)},SetItemStampCollection:function(a){ThePort.ItemStamp.oItemArray=a.oItemArray.slice(0)},FindItemIndex:function(a){var c=ThePort.ItemStamp.oItemArray.length;if(c>0){for(var b=0;b<c;b++){if(ThePort.ItemStamp.oItemArray[b].id==a){return b}}}return -1},FindItemTime:function(a){var c=ThePort.ItemStamp.oItemArray.length;if(c>0){for(var b=0;b<c;b++){if(ThePort.ItemStamp.oItemArray[b].id==a){return ThePort.ItemStamp.oItemArray[b].ts}}}return -1},SetClassOnTimeStamp:function(c,d,f,b,g){ThePort.Debug.Log('Looking to set Node ID = "'+c+'" with TIMESTAMP = "'+f);var a=ThePort.Utils.GetObj(c);if(!a){ThePort.Debug.Log("No way Jose:"+c);return}var e=ThePort.ItemStamp.FindItemTime(d);if(((e<0)&&(f>1307790000))||((e>0)&&(f>e))){ThePort.Debug.Log('Setting Node ID = "'+c+'" with sUnreadClass = "'+g);ThePort.Utils.SetClassName(a,g)}else{if(f<=e){ThePort.Debug.Log('Setting Node ID = "'+c+'" with sReadClass = "'+b);ThePort.Utils.SetClassName(a,b)}}}}}if(ThePortRegisterNS("ThePort.ModuleItemStamp")){ThePort.ModuleItemStamp=function(a,b){this.id=a;this.ts=b}};
