﻿function ThePortRegisterNS(ns){var sNSElements=ns.split(".");var oNode=window;for(var i=0;i<sNSElements.length;i++){if(typeof oNode[sNSElements[i]]=='undefined')oNode[sNSElements[i]]=new Object();oNode=oNode[sNSElements[i]];}};ThePortRegisterNS("ThePort");ThePort={Initialize:function(){ThePort.Debug.Log("Framework Initializing.");ThePort.Debug.Log("Initializing any triggers.");ThePort.XSL.CallAllModuleFunction("StartVisibilityInterval");var oTabSets=ThePort.Tabs.Array;if((oTabSets!=null)&&(oTabSets.length>0)){ThePort.Debug.Log("Initializing "+oTabSets.length+" tab sets.");for(var i=0;i<oTabSets.length;i++){oTabSets[i].Initialize();}}}};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_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_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_OBJECTID:"sObjectID",QS_DATA:"sData",QS_DATAFORMAT:"sFormat",QS_CALLBACKFN:"CallBack",QS_HASH:"sHash",QS_COMMENT:"sComment",QS_CONTEXTID:"sContextID",QS_RESULTSTART:"iResultStart",QS_NUMRESULTS:"iNumResults",QS_OPERATION:"sOperation",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_HTTP_READYSTATE_UNINITIALIZED:0,CONST_HTTP_READYSTATE_LOADING:1,CONST_HTTP_READYSTATE_LOADED:2,CONST_HTTP_READYSTATE_INTERACTIVE:3,CONST_HTTP_READYSTATE_COMPLETED:4,CONST_STYLE_DISPLAY_ON:"",CONST_STYLE_DISPLAY_OFF:"none",CONST_AJAX_URL:"/apis/Rest/RestService.ashx"};ThePortRegisterNS("ThePort.Module");if(typeof ThePort.Module.Array==ThePort.Common.CONST_UNDEFINED)ThePort.Module.Array=new Array();ThePortRegisterNS("ThePort.XSL");ThePort.XSL={Instantiate:function(sXml){var xmlString=sXml;if(xmlString.substr(0,4)=="&lt;")xmlString=ThePort.XSL.Decoder(sXml);var obj=new ThePort.XMLProcessor();obj.loadXMLText(xmlString);return obj;},Instantiate64:function(xmlString){var obj=new ThePort.XMLProcessor();return ThePort.XSL.Instantiate(ThePort.Utils.Decode64(xmlString));},RenderXML:function(oXml){var oXMLProcessor=new ThePort.XMLProcessor();oXMLProcessor.m_oXml=oXml;oXMLProcessor.debug()},ParseAndRenderXML:function(oWin,sXml){var oXMLProcessor=new ThePort.XMLProcessor();oXMLProcessor.displayXML(oWin,ThePort.XSL.LoadDocument(sXml));},FormatXmlToString:function(oXml){var oProcessor=new ThePort.XMLProcessor();oProcessor.m_sTree=ThePort.Common.CONST_EMPTY_STRING;oProcessor.parse(oXml.documentElement);return oProcessor.m_sTree;},Decoder:function(sEncodedString){try{if((typeof sEncodedString==ThePort.Common.CONST_UNDEFINED)||(sEncodedString==null))return null;sEncodedString=sEncodedString.replace(/&apos;/g,ThePort.Common.CONST_SINGLE_QUOTE);sEncodedString=sEncodedString.replace(/&quot;/g,ThePort.Common.CONST_DBL_QUOTE);sEncodedString=sEncodedString.replace(/&lt;/g,ThePort.Common.CONST_LESS_THAN);sEncodedString=sEncodedString.replace(/&gt;/g,ThePort.Common.CONST_GREATER_THAN);sEncodedString=sEncodedString.replace(/&amp;/g,ThePort.Common.CONST_AMPERSAND);return sEncodedString;}catch(e){return null;}},LoadDocument:function(sXml){var xmlDoc;if(window.ActiveXObject){xmlDoc=new ActiveXObject(ThePort.Common.CONST_ACTIVEX_XML_OBJ);xmlDoc.async=false;xmlDoc.loadXML(sXml);}else{var parser=new DOMParser();xmlDoc=parser.parseFromString(sXml,ThePort.Common.CONST_CONTENTTYPE_XML);}return(xmlDoc);},EscapeXML:function(sXml){var sOutput=sXml;sOutput=sOutput.replace(/&/g,ThePort.Common.CONST_ENC_AMPERSAND);sOutput=sOutput.replace(/'/g,ThePort.Common.CONST_ENC_SINGLE_QUOTE);sOutput=sOutput.replace(/\"/g,ThePort.Common.CONST_ENC_DBL_QUOTE);sOutput=sOutput.replace(/</g,ThePort.Common.CONST_ENC_LESS_THAN);sOutput=sOutput.replace(/>/g,ThePort.Common.CONST_ENC_GREATER_THAN);return sOutput;},SerializeToXML:function(oXml){var sXml=ThePort.Common.CONST_EMPTY_STRING;if(window.ActiveXObject)sXml=oXml.xml;else sXml=(new XMLSerializer()).serializeToString(oXml);return(sXml);},Save:function(oObject,fnCallback){if(typeof oObject!=ThePort.Common.CONST_UNDEFINED)oObject.Save(fnCallback);else alert("Unable to save object to server.")},Delete:function(oObject,fnCallback){if(typeof oObject!=ThePort.Common.CONST_UNDEFINED){ThePort.Debug.Log("AJAX Rest object delete called.");oObject.Delete(fnCallback)}else alert("Unable to delete object from server.")},AjaxPost:function(sUrl,sPostData,oCallbackFn){if(sPostData.length<=0){return;}eUrl=encodeURI(sUrl);ThePort.Utils.Ajax(ThePort.Common.CONST_FORM_POST,eUrl,oCallbackFn,sPostData);},AjaxDelete:function(sUrl,sPostData,oCallbackFn){if(sPostData.length<=0){return;}eUrl=encodeURI(sUrl);ThePort.Utils.Ajax(ThePort.Common.CONST_FORM_DELETE,eUrl,oCallbackFn,sPostData);},AjaxGet:function(sUrl,oCallbackFn){eUrl=encodeURI(sUrl);ThePort.Utils.Ajax(ThePort.Common.CONST_FORM_GET,eUrl,oCallbackFn,ThePort.Common.CONST_EMPTY_STRING);},GetModulePointer:function(sModuleName){if(typeof ThePort.Module.Array==ThePort.Common.CONST_UNDEFINED)return null;for(var i=0;i<ThePort.Module.Array.length;i++){if((ThePort.Module.Array[i].m_sName==sModuleName)||(ThePort.Module.Array[i].m_sModuleName==sModuleName))return ThePort.Module.Array[i];}ThePort.Debug.Log("ERROR::GetModulePointer('"+sModuleName+"') Unable to find Module.");return null;},ShiftArgs:function(){try{[].shift.call(arguments);}catch(e){}return arguments;},Shift2Args:function(){try{[].shift.call(arguments);[].shift.call(arguments);}catch(e){}return arguments;},CallAllModuleFunction:function(oFnName){if(typeof ThePort.Module.Array==ThePort.Common.CONST_UNDEFINED)return false;var oArgs=this['ShiftArgs'].apply(null,arguments);for(var i=0;i<ThePort.Module.Array.length;i++)try{value=ThePort.Module.Array[i][oFnName].apply(ThePort.Module.Array[i],oArgs);}catch(e){}},CallModuleFunction:function(sModuleName,oFnName){if(typeof ThePort.Module.Array==ThePort.Common.CONST_UNDEFINED)return false;var oArgs=this['Shift2Args'].apply(null,arguments);for(var i=0;i<ThePort.Module.Array.length;i++){if((ThePort.Module.Array[i].m_sName==sModuleName)||(ThePort.Module.Array[i].m_sModuleName==sModuleName)){try{value=ThePort.Module.Array[i][oFnName].apply(ThePort.Module.Array[i],oArgs);}catch(e){}}}}};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;};ThePort.XMLProcessor.prototype.transform=function(){var xmlDoc=this.m_oXml;var xslDoc=this.m_xsl;try{if(typeof XSLTProcessor!=ThePort.Common.CONST_UNDEFINED){if(!this.m_xsltProcessor){this.m_xsltProcessor=new XSLTProcessor();this.m_xsltProcessor.importStylesheet(xslDoc);}try{try{var node=this.m_xsltProcessor.transformToDocument(xmlDoc);}catch(e){}var xmlSerializer=new XMLSerializer();var retString=xmlSerializer.serializeToString(node);return retString;}catch(e){}}else{return(xmlDoc.transformNode(xslDoc));}}catch(e){}return ThePort.Common.CONST_EMPTY_STRING;};ThePort.XMLProcessor.prototype.loadXMLText=function(sXml){this.m_sXml=sXml;this.m_oXml=ThePort.XSL.LoadDocument(sXml);};ThePort.XMLProcessor.prototype.revert=function(sXml){this.loadXMLText(this.m_sXml);};ThePort.XMLProcessor.prototype.setNodeEventValue=function(obj,xPath){var sValue=obj.value;this.setNodeValue(xPath,sValue);};ThePort.XMLProcessor.prototype.loadXSLText=function(sXsl){this.m_xsl=ThePort.XSL.LoadDocument(sXsl);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(obj,xPath){var sValue=obj.value;this.setNodeValue(xPath,sValue);};ThePort.XMLProcessor.prototype.setNodeValue=function(xPath,sValue){if(window.ActiveXObject){var oNode=this.m_oXml.selectNodes(xPath);if(oNode!=null)oNode[0].text=sValue}else{var oNodes=this.m_oXml.evaluate(xPath,this.m_oXml,null,XPathResult.ANY_TYPE,null);var result=oNodes.iterateNext();if(result)result.childNodes[0].nodeValue=sValue}};ThePort.XMLProcessor.prototype.getNodeValue=function(xPath){var obj;if(window.ActiveXObject){var oNode=this.m_oXml.selectNodes(xPath);if(oNode!=null)return oNode[0].text}else{var oNodes=this.m_oXml.evaluate(xPath,this.m_oXml,null,XPathResult.ANY_TYPE,null);var result=oNodes.iterateNext();if(result)return result.childNodes[0].nodeValue}return null;};ThePort.XMLProcessor.prototype.parse=function(oDoc){if(typeof oDoc.tagName!='undefined'){this.m_sTree+='<ul><li>';this.m_sTree+='&lt;<b>'+oDoc.tagName+'</b>';if(oDoc.attributes){for(var i=0;i<oDoc.attributes.length;i++){var attrName=oDoc.attributes[i].name;var attrValue=ThePort.Utils.GetAttrValueFromNode(oDoc,attrName);this.m_sTree+=" "+attrName+"='"+attrValue+"'"}}this.m_sTree+='&gt; : ';if(oDoc.hasChildNodes()){for(var j=0;j<oDoc.childNodes.length;j++){this.parse(oDoc.childNodes[j]);}}this.m_sTree+='</li></ul>';}else this.m_sTree+=ThePort.Utils.GetValueFromNode(oDoc);};ThePort.XMLProcessor.prototype.getTagValue=function(sTagName){return ThePort.Utils.GetTagValue(this.m_oXml,sTagName);};ThePort.XMLProcessor.prototype.debug=function(){if(this.m_oXml!=null){win=window.open('');this.displayXML(win,this.m_oXml);win.document.close();}};ThePort.XMLProcessor.prototype.XmlToText=function(){var oXml=this.m_oXml;var oDoc=oXml.documentElement;this.m_sTree=ThePort.Common.CONST_EMPTY_STRING;this.parse(oDoc);return this.m_sTree;};ThePort.XMLProcessor.prototype.displayXML=function(oWin,oXml){var oDoc=oXml.documentElement;this.m_sTree=ThePort.Common.CONST_EMPTY_STRING;this.parse(oDoc);oWin.document.write(this.m_sTree);this.m_sTree=ThePort.Common.CONST_EMPTY_STRING;};ThePort.XMLProcessor.prototype.Delete=function(fnCallback){if(typeof fnCallback!=ThePort.Common.CONST_UNDEFINED)this.m_callback=fnCallback;else this.m_callback=null;var sPostData=ThePort.Common.CONST_EMPTY_STRING;sPostData+=ThePort.Utils.GetVariablePair(ThePort.Common.QS_DATA,ThePort.XSL.EscapeXML(ThePort.XSL.SerializeToXML(this.m_oXml)));sPostData+=ThePort.Utils.AddVariablePair(ThePort.Common.QS_DATAFORMAT,ThePort.Common.CONST_FORMAT_JSON);ThePort.Utils.Ajax(ThePort.Common.CONST_FORM_DELETE,ThePort.Common.CONST_AJAX_URL,ThePort.Utils.Bind(this,"Response"),sPostData);};ThePort.XMLProcessor.prototype.Save=function(fnCallback){if(typeof fnCallback!=ThePort.Common.CONST_UNDEFINED)this.m_callback=fnCallback;else this.m_callback=null;var sPostData=ThePort.Common.CONST_EMPTY_STRING;sPostData+=ThePort.Utils.GetVariablePair(ThePort.Common.QS_DATA,ThePort.XSL.EscapeXML(ThePort.XSL.SerializeToXML(this.m_oXml)));sPostData+=ThePort.Utils.AddVariablePair(ThePort.Common.QS_DATAFORMAT,ThePort.Common.CONST_FORMAT_JSON);ThePort.Utils.Ajax(ThePort.Common.CONST_FORM_POST,ThePort.Common.CONST_AJAX_URL,ThePort.Utils.Bind(this,"Response"),sPostData);};ThePort.XMLProcessor.prototype.Response=function(oResponse){if(ThePort.Debug.window)ThePort.Utils.LogServerException(oResponse);var oReplyObject=ThePort.Utils.GetReplyObject(oResponse);if(this.m_callback)this.m_callback(oReplyObject);else try{ThePortReply.Event_Response(oReplyObject);}catch(e){}return;};ThePortRegisterNS("ThePort.Event");ThePort.Event={GetEventTarget:function(e){if(e.target)oEventTarget=e.target;else if(e.srcElement)oEventTarget=e.srcElement;if(targ.nodeType==3)oEventTarget=oEventTarget.parentNode;return oEventTarget;},GetEventKeyCode:function(e){if(e.keyCode)iKeyCode=e.keyCode;else if(e.which)iKeyCode=e.which;var cCharacter=String.fromCharCode(iKeyCode);return iKeyCode;},IsEventRightMouseClick:function(e){if(e.which)bRightclick=(e.which==3);else if(e.button)bRightclick=(e.button==2);return bRightclick;},GetEventMouseX:function(e){var iPosX=0;if(e.pageX||e.pageY)iPosX=e.pageX;else if(e.clientX||e.clientY)iPosX=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;return iPosX;},GetEventMouseY:function(e){var iPosY=0;if(e.pageX||e.pageY)iPosY=e.pageY;else if(e.clientX||e.clientY)iPosY=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;return iPosY;},AddHandler:function(oElement,sEvent,oFn,bPhase){if(oElement.addEventListener)oElement.addEventListener(sEvent,oFn,bPhase);else if(oElement.attachEvent){oElement['e'+sEvent+oFn]=oFn;oElement[sEvent+oFn]=function(){oElement['e'+sEvent+oFn](window.event);};oElement.attachEvent('on'+sEvent,oElement[sEvent+oFn]);}else oElement['on'+sEvent]=null;},RemoveHandler:function(oElement,sEvent,oFn,bPhase){if(oElement.removeEventListener)oElement.removeEventListener(sEvent,oFn,bPhase);else if(oElement.detachEvent){oElement.detachEvent("on"+sEvent,oElement[sEvent+oFn]);oElement[sEvent+fn]=null;}}};ThePortRegisterNS("ThePort.Framework");ThePort.Framework={ModuleCreate:function(oObj,sDictCSV,sName,sParentID,sModuleID,sBusyIndicator){oObj.oDict=new ThePort.Dictionary(sDictCSV);oObj.m_sName=sName;oObj.m_sParentID=sParentID;oObj.m_sModuleName=sModuleID;oObj.m_sBusyIndicator=sBusyIndicator;oObj.m_sHash=ThePort.Common.CONST_EMPTY_STRING;oObj.m_interval=null;oObj.m_timeout=null;oObj.m_oPaging=null;oObj.m_busy=false;oObj.m_oBusyIndicatorNode=null;ThePort.Debug.LogModuleMsg(oObj,"New object Constructed.");},ModuleUpdate:function(oObj){oObj.GoBusy(oObj.m_sParentID);ThePort.Debug.LogModuleMsg(oObj,"Send ajax Update request.");var eUrl="/APIs/Services/XSL/Process.ashx";sPostData=ThePort.Utils.GetVariablePair(ThePort.Common.QS_DATA,oObj.oDict.ToCSV());if(oObj.m_sHash.length>0)sPostData+=ThePort.Utils.AddVariablePair(ThePort.Common.QS_HASH,oObj.m_sHash);ThePort.XSL.AjaxPost(eUrl,sPostData,ThePort.Utils.AjaxBind(oObj,"onUpdateResponse"));},ModuleOnUpdateResponse:function(oObj,oResponse){oObj.NoBusy();ThePort.Debug.LogModuleMsg(oObj,"Handling ajax response.");var oReplyObj=new ThePort.ReplyObject(oResponse.responseXML);var oNode=ThePort.Utils.GetObj(oObj.m_sParentID);if(oReplyObj.Response!="true"){if(oNode){ThePort.Debug.LogModuleMsg(oObj,"Ajax response=false, Message='"+oReplyObj.Message+"'");}}else{if(oNode){ThePort.Debug.LogModuleMsg(oObj,"Ajax response=true, Updating content with new hash='"+oReplyObj.Hash+"'");ThePort.Debug.LogModuleMsg(oObj,"Updating display with ajax data.");var oPNode=ThePort.Utils.GetObj(oObj.oDict.GetDictionaryKey('sPagingID'));if((oPNode)&&(oObj.oDict.GetDictionaryKey(ThePort.Common.QS_OPERATION)==ThePort.Common.CONST_OPERATION_MORE)){oPNode.parentNode.removeChild(oPNode);oNode.innerHTML+=oReplyObj.Data;}else oNode.innerHTML=oReplyObj.Data;ThePort.Debug.LogModuleMsg(oObj,"Executing ajax payload scripts.");var oScripts=oNode.getElementsByTagName('script');for(var i=0;i<oScripts.length;i++)eval(oScripts[i].text);}else{ThePort.Debug.LogModuleMsg(oObj,"There are updates, but unable to locate sParentID::"+oObj.m_sParentID);oObj.CleanUp();}}},ModuleGoBusy:function(oObj,sID){try{if(oObj.m_busy)return false;if(oObj.m_oBusyIndicatorNode!=null)return false;if(typeof sID==ThePort.Common.CONST_UNDEFINED)sID=oObj.m_sParentID;var oDisplayNode=ThePort.Utils.GetObj(sID);if(oDisplayNode==null)return false;var iXPos=ThePort.Utils.findPosX(oDisplayNode);var iYPos=ThePort.Utils.findPosY(oDisplayNode);var iHeight=oDisplayNode.offsetHeight;var iWidth=oDisplayNode.offsetWidth;var iXLoc=iXPos+(iWidth/2)-60;var iYLoc=iYPos;oObj.m_oBusyIndicatorNode=document.body.appendChild(document.createElement('div'));oObj.m_oBusyIndicatorNode.style.left=iXLoc.toString()+"px";oObj.m_oBusyIndicatorNode.style.top=iYLoc.toString()+"px";oObj.m_oBusyIndicatorNode.style.position="absolute";oObj.m_oBusyIndicatorNode.innerHTML=oObj.m_sBusyIndicator;}catch(e){oObj.m_oBusyIndicatorNode=null;}oObj.m_busy=true;return true;},ModuleNoBusy:function(oObj){try{oObj.m_busy=false;if(oObj.m_oBusyIndicatorNode)oObj.m_oBusyIndicatorNode.parentNode.removeChild(oObj.m_oBusyIndicatorNode);oObj.m_oBusyIndicatorNode=null;}catch(e){}},ModuleRefresh:function(oObj){if((oObj.oDict.GetDictionaryKey(ThePort.Common.QS_OPERATION)==ThePort.Common.CONST_OPERATION_MORE)){oObj.oDict.PutDictionaryKey(ThePort.Common.QS_RESULTSTART,"1");oObj.oDict.PutDictionaryKey(ThePort.Common.QS_OPERATION,ThePort.Common.CONST_OPERATION_REFRESH);}oObj.Update();},ModuleSetHash:function(oObj,sHashValue){ThePort.Debug.LogModuleMsg(oObj,"Hash = "+sHashValue);oObj.m_sHash=sHashValue;},ModuleShow:function(oObj){ThePort.Debug.LogModuleMsg(oObj,"Show");ThePort.Utils.Show(oObj.m_sParentID);},ModuleHide:function(oObj){ThePort.Debug.LogModuleMsg(oObj,"Hide");ThePort.Utils.Hide(oObj.m_sParentID);},ModuleRefreshInterval:function(oObj,seconds){oObj.StopInterval();if(seconds>0){ThePort.Debug.LogModuleMsg(oObj,"RefreshInterval pending update in "+seconds+" seconds.");oObj.m_interval=setInterval(ThePort.Utils.Bind(oObj,'Refresh'),seconds*1000);}},ModuleStopInterval:function(oObj){if(oObj.m_interval){ThePort.Debug.LogModuleMsg(oObj,"Clearing previous interval.");clearInterval(oObj.m_interval);}oObj.m_interval=null;},ModuleRefreshTimeout:function(oObj,seconds){oObj.StopTimeout();if(seconds>0){ThePort.Debug.LogModuleMsg(oObj,"RefreshTimeOut pending update in "+seconds+" seconds.");oObj.m_timeout=setTimeout(ThePort.Utils.Bind(oObj,'Refresh'),seconds*1000);}},ModuleStopTimeout:function(oObj){if(oObj.m_timeOut){ThePort.Debug.LogModuleMsg(oObj,"Clearing any previous timeOut.");clearInterval(oObj.m_timeout);}oObj.m_timeout=null;},ModuleCleanUp:function(oObj){oObj.StopTimeout();oObj.StopInterval();oObj.NoBusy();ThePort.Debug.LogModuleMsg(oObj,"Timer cleanup.");},ModuleGotoPage:function(oObj,iPageNum){if(oObj.m_oPaging!=null){oObj.m_oPaging.GotoPage(iPageNum);}}};ThePortRegisterNS("ThePort.Utils");ThePort.Utils={Ajax:function(sCommand,sUrl,oBindFunction,sPostData){var httpRequest=null;if((sCommand==null)||(sCommand==ThePort.Common.CONST_EMPTY_STRING))sCommand=ThePort.Common.CONST_FORM_GET;if(typeof XMLHttpRequest!=ThePort.Common.CONST_UNDEFINED){httpRequest=new XMLHttpRequest();}else if(typeof ActiveXObject!=ThePort.Common.CONST_UNDEFINED){try{httpRequest=new ActiveXObject(ThePort.Common.CONST_ACTIVEX1_AJAX_OBJ);}catch(e){try{httpRequest=new ActiveXObject(ThePort.Common.CONST_ACTIVEX2_AJAX_OBJ);}catch(e){}}}if(httpRequest!=null){httpRequest.open(sCommand,sUrl,true);var fn=function(){if(httpRequest.readyState==ThePort.Common.CONST_HTTP_READYSTATE_COMPLETED)oBindFunction(httpRequest);};httpRequest.onreadystatechange=fn;if(sPostData!=null){httpRequest.setRequestHeader(ThePort.Common.CONST_CONTENTTYPE,ThePort.Common.CONST_FORM_POST_URLENC);httpRequest.setRequestHeader(ThePort.Common.CONST_CONTENTLENGTH,sPostData.length);httpRequest.setRequestHeader(ThePort.Common.CONST_HEADER_CONNECTION,ThePort.Common.CONST_HEADER_CONN_CLOSE);}}httpRequest.send(sPostData);},Bind:function(oObject,fMethodName){return function(o){oObject[fMethodName](o);}},Binder:function(oObject,fMethodName){var oArgs=ThePort.XSL['Shift2Args'].apply(null,arguments);return function(){return oObject[fMethodName].apply(oObject,oArgs);}},AjaxBind:function(oObject,fMethodName){return function(o){if(ThePort.Debug.window)ThePort.Utils.LogServerException(o);oObject[fMethodName](o);}},findPosX:function(obj){var curleft=0;if(obj.offsetParent){while(obj.offsetParent){curleft+=obj.offsetLeft;obj=obj.offsetParent;}}else if(obj.x)curleft+=obj.x;return curleft;},findPosY:function(obj){var curtop=0;if(obj.offsetParent){while(obj.offsetParent){curtop+=obj.offsetTop;obj=obj.offsetParent;}}else if(obj.y)curtop+=obj.y;return curtop;},LogServerException:function(oResponse){try{var oReplyObject=ThePort.Utils.GetReplyObject(oResponse);if(typeof oReplyObject==ThePort.Common.CONST_UNDEFINED)return;if(oReplyObject.ReturnCode<0){ThePort.Debug.Log("          ****************************************************\n          ** Server ERROR or Exception returned inside Ajax callback **\n          ****************************************************\nException Message: '"+oReplyObject.Message+"'\nDetails:\n"+oReplyObject.Data)}}catch(e){}},RegisterModule:function(ns){var found=false;var sNSElements=ns.split(".");var oNode=window;for(var i=0;i<sNSElements.length;i++){if(typeof oNode[sNSElements[i]]!=ThePort.Common.CONST_UNDEFINED){if(i==(sNSElements.length-1)){delete oNode[sNSElements[i]];found=true;break;}oNode=oNode[sNSElements[i]];}}if(found){if(typeof ThePort.Module.Array==ThePort.Common.CONST_UNDEFINED)return;for(var j=0;j<ThePort.Module.Array.length;j++)if(ThePort.Module.Array[j].m_sModuleName==ns){ThePort.Module.Array[j].CleanUp();delete ThePort.Module.Array[j];ThePort.Module.Array.splice(j,1);break;}}ThePortRegisterNS(ns);},GetTagValue:function(oDoc,sTagName){try{if(oDoc){var nodeList=oDoc.getElementsByTagName(sTagName);return ThePort.Utils.GetValueFromNode(nodeList[0]);}}catch(e){}return null;},GetVariablePair:function(sName,sValue){var sData=ThePort.Common.CONST_EMPTY_STRING;sData+=sName;sData+=ThePort.Common.CONST_EQUALS;sData+=encodeURIComponent(sValue);return sData;},AddDictionaryPair:function(sName,sValue){var sData=ThePort.Common.CONST_AMPERSAND;sData+=ThePort.Utils.GetVariablePair(sName,sValue);return sData;},AddVariablePair:function(sName,sValue){var sData=ThePort.Common.CONST_AMPERSAND;sData+=ThePort.Utils.GetVariablePair(sName,sValue);return sData;},GetTagAttributeValue:function(oDoc,sTagName,sAttribName){if(oDoc){var nodeList=oDoc.getElementsByTagName(tagName);return this.getAttrValueFromNode(nodeList[0],sAttribName);}return null;},GetValueFromNode:function(node){if(typeof node.text!=ThePort.Common.CONST_UNDEFINED)return node.text;else if(typeof node.textContent!=ThePort.Common.CONST_UNDEFINED)return node.textContent;else if(typeof node.innerText!=ThePort.Common.CONST_UNDEFINED)return node.innerText;else{switch(node.nodeType){case 3:case 4:return node.nodeValue;break;case 1:case 11:var retVal=new String();for(var i=0;i<node.childNodes.length;i++)retVal+=GetNodeValue(node.childNodes[i]);return retVal;default:return ThePort.Common.CONST_EMPTY_STRING;}}},GetAttrValueFromNode:function(node,attr){try{for(l=0;l<node.attributes.length;l++){if(node.attributes[l].nodeName==attr)return(node.attributes[l].nodeValue);}}catch(e){return null;}return null;},Parm:function(value){this.value=value;},GetObj:function(sID){if((sID==null)||(sID.length<=0))return null;return document.getElementById(sID);},GotoURL:function(sURL){if(sURL!=null&&sURL.length>0)window.location.href=sURL;},StopEvent:function(eEvent){if(eEvent.stopPropagation)eEvent.stopPropagation();else eEvent.cancelBubble=true;},Show:function(sID){var oObj=ThePort.Utils.GetObj(sID);if(oObj)oObj.style.display=ThePort.Common.CONST_STYLE_DISPLAY_ON;},Hide:function(sID){var oObj=ThePort.Utils.GetObj(sID);if(oObj)oObj.style.display=ThePort.Common.CONST_STYLE_DISPLAY_OFF;},Toggle:function(sID){var oObj=ThePort.Utils.GetObj(sID);if(oObj)if(oObj.style.display==ThePort.Common.CONST_STYLE_DISPLAY_OFF)ThePort.Utils.Show(sID);else ThePort.Utils.Hide(sID);},SetClassName:function(sID,sClassName){var oObj=ThePort.Utils.GetObj(sID);if(oObj)oObj.className=sClassName;},SetInnerHTML:function(sID,sHTML){var oObj=ThePort.Utils.GetObj(sID);if(oObj)oObj.innerHTML=sHTML;},ScrollPageToNodeTop:function(sID){var oNode=ThePort.Utils.GetObj(sID);if(!oNode){ThePort.Debug.Log("Unable to scroll to top of Node with ID="+sID);return;}ThePort.Debug.Log("Scrolling to top of Node with ID="+sID);var offset=0;while(oNode.offsetParent){offset+=oNode.offsetTop;oNode=oNode.offsetParent;}var xp=new ThePort.Utils.Parm(0);var yp=new ThePort.Utils.Parm(0);ThePort.Utils.GetScrollPos(xp,yp);if(yp.value>offset)window.scrollTo(0,offset);},GetScrollPos:function(xParm,yParm){var px=0,py=0;if(typeof(window.pageYOffset)=='number'){py=window.pageYOffset;px=window.pageXOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){py=document.body.scrollTop;px=document.body.scrollLeft;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){py=document.documentElement.scrollTop;px=document.documentElement.scrollLeft;}xParm.value=px;yParm.value=py;},AddScriptTag:function(sId,sScript){var oNode=document.getElementById(sId);oNode.innerHTML=sScript;var x=oNode.getElementsByTagName("script");var h=document.getElementsByTagName("head")[0];for(var i=0;i<x.length;i++){var s=document.createElement("script");s.type="text/javascript";h.appendChild(s);s.text=x[i].text;}},AddHeadScriptTag:function(sScript){var h=document.getElementsByTagName("head")[0];var s=document.createElement("script");s.type="text/javascript";s.text=sScript;h.appendChild(s);},IsVisible:function(obj){if(obj==document)return true;if(!obj)return false;if(!obj.parentNode)return false;if(obj.style){if(obj.style.display=='none')return false;if(obj.style.visibility=='hidden')return false}if(window.getComputedStyle){var style=window.getComputedStyle(obj,"");if(style.display=='none')return false;if(style.visibility=='hidden')return false}var style=obj.currentStyle;if(style){if(style['display']=='none')return false;if(style['visibility']=='hidden')return false}return ThePort.Utils.IsVisible(obj.parentNode)},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(sUrl,sKey,sValue){var re=new RegExp("([?|&])"+sKey+"=.*?(&|$)","i");if(sUrl.match(re))return sUrl.replace(re,'$1'+sKey+ThePort.Common.CONST_EQUALS+sValue+'$2');else return sUrl+ThePort.Common.CONST_AMPERSAND+sKey+ThePort.Common.CONST_EQUALS+sValue;},KeyDownHandler:function(eEvent,sButtonID){var e=eEvent||window.event;if(ThePort.Event.GetEventKeyCode(e)==13){e.returnValue=false;ThePort.Utils.StopEvent(e);ThePort.Utils.GetObj(sButtonID).click();}},Decode64:function(input){var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var output=ThePort.Common.CONST_EMPTY_STRING;var chr1,chr2,chr3=ThePort.Common.CONST_EMPTY_STRING;var enc1,enc2,enc3,enc4=ThePort.Common.CONST_EMPTY_STRING;var i=0;do{enc1=keyStr.indexOf(input.charAt(i++));enc2=keyStr.indexOf(input.charAt(i++));enc3=keyStr.indexOf(input.charAt(i++));enc4=keyStr.indexOf(input.charAt(i++));chr1=(enc1<<2)|(enc2>>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64){output=output+String.fromCharCode(chr2);}if(enc4!=64){output=output+String.fromCharCode(chr3);}}while(i<input.length);return unescape(output);},InitHandler:function(onLoadFunction){if(document.addEventListener){document.addEventListener("DOMContentLoaded",onLoadFunction,false);return;}if(document.getElementById){var deferScript=document.getElementById('_port_xsl_script_');if(deferScript){deferScript.onreadystatechange=function(){if(this.readyState=="complete"){onLoadFunction();}};deferScript.onreadystatechange();deferScript=null;}return;}if(/WebKit/i.test(navigator.userAgent)){var _timer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(_timer);onLoadFunction();}},10);return;}window.onload=onLoadFunction;}};ThePortRegisterNS("ThePort.ReplyObject");ThePort.ReplyObject=function(oXmlDoc){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.loadReply(oXmlDoc);};ThePort.ReplyObject.prototype.getProcessedXML=function(){try{oProcessor=new ThePort.XMLProcessor();oProcessor.loadXMLText(this.getDataText());oProcessor.loadXSLText(this.getStyleText());return(oProcessor.transform())}catch(e){return ThePort.Common.CONST_ERROR_MESSAGE}};ThePort.ReplyObject.prototype.loadReply=function(oXmlDoc){try{this.ID=ThePort.Utils.GetTagValue(oXmlDoc,"ID");this.Response=ThePort.Utils.GetTagValue(oXmlDoc,"Response");this.ReturnCode=ThePort.Utils.GetTagValue(oXmlDoc,"ReturnCode");this.Action=ThePort.Utils.GetTagValue(oXmlDoc,"Action");this.ObjectName=ThePort.Utils.GetTagValue(oXmlDoc,"ObjectName");this.Message=ThePort.Utils.GetTagValue(oXmlDoc,"Message");this.Data=ThePort.Utils.GetTagValue(oXmlDoc,"Data");this.Hash=ThePort.Utils.GetTagValue(oXmlDoc,"Hash");}catch(e){return false;}return true;};ThePortRegisterNS("ThePort.Dictionary");ThePort.Dictionary=function(sCSV){this.sValues=[];this.FromCSV(sCSV);};ThePort.Dictionary.prototype.GetDictionaryCSV=function(){return this.ToCSV();};ThePort.Dictionary.prototype.ToCSV=function(){var sOutput=ThePort.Common.CONST_EMPTY_STRING;for(key in this.sValues){if(typeof this.sValues[key]!=ThePort.Common.CONST_TYPE_FUNCTION){if(sOutput.length>0)sOutput+=ThePort.Common.CONST_COMMA;sOutput+=escape(key)+ThePort.Common.CONST_EQUALS+escape(this.sValues[key]);}}return sOutput;};ThePort.Dictionary.prototype.ResetDictionary=function(){this.sValues=null;this.sValues=[]};ThePort.Dictionary.prototype.FromCSV=function(sCSV){this.sValues=[];sItems=sCSV.split(/\s?,\s?/);for(var i=0;i<sItems.length;i++){var sTmp=sItems[i].split(/\s?=\s?/);if(sTmp.length==2)this.AddStringPair(unescape(sTmp[0]),unescape(sTmp[1]));else if(sTmp.length==1)this.AddStringPair(unescape(sTmp[0]),unescape(ThePort.Common.CONST_EMPTY_STRING));}};ThePort.Dictionary.prototype.PutDictionaryKey=function(sKey,sValue){this.AddStringPair(sKey,sValue);};ThePort.Dictionary.prototype.GetDictionaryKey=function(sKey){return this.sValues[sKey];};ThePort.Dictionary.prototype.AddStringPair=function(sKey,sValue){this.sValues[sKey]=sValue;};ThePort.Dictionary.prototype.AddControlID=function(sControlID){var oNode=ThePort.Utils.GetObj(sControlID);if(oNode!=null)AddControl(oNode);};ThePort.Dictionary.prototype.AddControl=function(oNode){if(oNode!=null){this.sValues[oNode.id]=oNode.value;}};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 alert(' You have enabled the debug window.  However it appears popups are disabled in your browser.');},Log:function(text){try{if(ThePort.Debug.window){ThePort.Debug.window.document.write(text+"\n");}}catch(e){}},LogModuleMsg:function(oObj,sMessage){try{if(ThePort.Debug.window){var sValue="";if(oObj.m_sName.length>0)sValue=oObj.m_sName;else sValue=oObj.m_sModuleName;ThePort.Debug.window.document.write(sValue+" : "+sMessage+"\n");}}catch(e){}},Disable:function(){try{if(ThePort.Debug.window){ThePort.Debug.window.close();ThePort.Debug.window=null;}}catch(e){}}};ThePortRegisterNS("ThePort.UI.Paging");ThePort.UI.Paging=function(sModuleID,sPagingID,iTotalItems,iResultStart,iNumResults,sInactiveClassName,sSelectedClassName){this.m_iCurrentPage=0;this.m_iStartPage=0;this.m_iEndPage=0;this.m_iNumResults=iNumResults;this.m_iTotalPages=0;this.m_iResultStart=iResultStart;this.m_iTotalItems=iTotalItems;this.m_sPagingID=sPagingID;this.m_sModuleID=sModuleID;this.m_sInactiveClassName=sInactiveClassName;this.m_sSelectedClassName=sSelectedClassName;};ThePort.UI.Paging.prototype.GetNumPageIndexes=function(sPagingID){var i=1;while(ThePort.Utils.GetObj(sPagingID+"Elem"+i)!=null)i++;return i-1;};ThePort.UI.Paging.prototype.Render=function(){var oNode;var oModule=ThePort.XSL.GetModulePointer(this.m_sModuleID);var sName=oModule.oDict.GetDictionaryKey('sName');this.m_iNumPageIndexes=this.GetNumPageIndexes(this.m_sPagingID);this.m_iTotalPages=Math.ceil(this.m_iTotalItems/this.m_iNumResults);this.m_iCurrentPage=Math.max(Math.ceil(this.m_iResultStart/this.m_iNumResults),1);this.m_iStartPage=Math.max(1,Math.ceil(this.m_iCurrentPage-(this.m_iNumPageIndexes/2)));this.m_iEndPage=Math.min(this.m_iTotalPages,this.m_iStartPage+this.m_iNumPageIndexes-1);if(this.m_iEndPage<this.m_iStartPage+this.m_iNumPageIndexes-1)this.m_iStartPage=Math.max(1,this.m_iEndPage-(this.m_iNumPageIndexes)+1);if(this.m_iTotalPages<=this.m_iNumPageIndexes){ThePort.Utils.Hide(this.m_sPagingID+"Start");ThePort.Utils.Hide(this.m_sPagingID+"Prev");ThePort.Utils.Hide(this.m_sPagingID+"Next");ThePort.Utils.Hide(this.m_sPagingID+"End")}if(this.m_iStartPage<=1){ThePort.Utils.SetClassName(this.m_sPagingID+"Start",this.m_sInactiveClassName);ThePort.Utils.SetClassName(this.m_sPagingID+"Prev",this.m_sInactiveClassName);this.RenderElement(sName,this.m_sPagingID+"Start",this.m_sModuleID,"",(this.m_iCurrentPage-1)*this.m_iNumResults+1,"ExecutePaging");this.RenderElement(sName,this.m_sPagingID+"Prev",this.m_sModuleID,"",(this.m_iCurrentPage-1)*this.m_iNumResults+1,"ExecutePaging");}else{this.RenderElement(sName,this.m_sPagingID+"Start",this.m_sModuleID,"",1,"ExecutePaging");this.RenderElement(sName,this.m_sPagingID+"Prev",this.m_sModuleID,"",(this.m_iStartPage-1)*this.m_iNumResults,"ExecutePaging");}i=this.m_iStartPage;for(var j=1;j<=this.m_iNumPageIndexes;j=j+1){if((i>=this.m_iStartPage)&&(i<=this.m_iEndPage)){if(i==this.m_iCurrentPage){ThePort.Utils.SetClassName(this.m_sPagingID+"Elem"+j,this.m_sSelectedClassName);}this.RenderElement(sName,this.m_sPagingID+"Elem"+j,this.m_sModuleID,i+"",(i-1)*this.m_iNumResults+1,"ExecutePaging");}else ThePort.Utils.Hide(this.m_sPagingID+"Elem"+j);i+=1;}if(this.m_iTotalPages>this.m_iNumPageIndexes){this.RenderElement(sName,this.m_sPagingID+"Next",this.m_sModuleID,"",(this.m_iEndPage+1)*this.m_iNumResults,"ExecutePaging");this.RenderElement(sName,this.m_sPagingID+"End",this.m_sModuleID,"",((this.m_iTotalPages-1)*this.m_iNumResults)+1,"ExecutePaging");}if(this.m_iEndPage>=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(sName,this.m_sPagingID+"Next",this.m_sModuleID,"",(this.m_iCurrentPage-1)*this.m_iNumResults+1,"ExecutePaging");this.RenderElement(sName,this.m_sPagingID+"End",this.m_sModuleID,"",(this.m_iCurrentPage-1)*this.m_iNumResults+1,"ExecutePaging");}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 oModule=ThePort.XSL.GetModulePointer(this.m_sModuleID);var sName=oModule.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(sName,this.m_sPagingID+"More",this.m_sModuleID,"",this.m_iResultStart+this.m_iNumResults,"ExecuteMore");if(!oModule){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(sName,sElementID,sModuleID,sToken,iResultStart,ExecuteFunction){var sOutput="";oNode=ThePort.Utils.GetObj(sElementID);if(!oNode){return;}oNode.onclick=ThePort.Utils.Binder(this,ExecuteFunction,iResultStart);try{oNode.href=ThePort.Utils.ReplaceQSVariable(window.location.href,sName,ThePort.Common.QS_RESULTSTART+"="+iResultStart);}catch(e){}if(sToken.length>0)oNode.innerHTML=sToken;return};ThePort.UI.Paging.prototype.GotoPage=function(iPageNumber){var iResultStart=(iPageNumber-1)*this.m_iNumResults+1;if(iResultStart>this.m_iTotalItems)return;else this.ExecutePaging(iResultStart);};ThePort.UI.Paging.prototype.ExecutePaging=function(iResultStart){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(iResultStart);};ThePort.UI.Paging.prototype.ExecuteMore=function(iResultStart){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(iResultStart);};ThePort.UI.Paging.prototype.Execute=function(iResultStart){var sModuleID=this.m_sModuleID;oModule=ThePort.XSL.GetModulePointer(sModuleID);if(!oModule){return false;}if(iResultStart==oModule.oDict.GetDictionaryKey(ThePort.Common.QS_RESULTSTART))return false;oModule.oDict.PutDictionaryKey(ThePort.Common.QS_RESULTSTART,iResultStart+"");ThePort.Debug.Log("Module::"+oModule.m_sName+" is changing the current index in viewing to iResultStart="+iResultStart);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;};ThePortRegisterNS("ThePort.Tabs");if(typeof ThePort.Tabs.Array==ThePort.Common.CONST_UNDEFINED)ThePort.Tabs.Array=new Array();ThePortRegisterNS("ThePort.UI.Tabs");ThePort.UI.Tabs=function(sTabName,sTabAreaName,iTabCount,iTabStart){this.m_sTabName=sTabName;this.m_sTabAreaName=sTabAreaName;this.m_iTabCount=iTabCount;this.m_iTabStart=iTabStart;this.m_iActiveTab=iTabStart;ThePort.Tabs.Array.push(this);};ThePort.UI.Tabs.prototype.SetStart=function(iTabStart){this.m_iTabStart=iTabStart;this.m_iActiveTab=this.m_iTabStart;};ThePort.UI.Tabs.prototype.Render=function(iActiveTab){try{this.m_iActiveTab=iActiveTab;for(i=1;i<=this.m_iTabCount;i++){try{document.getElementById(this.m_sTabName+i).className='tab'+i;}catch(e){}try{document.getElementById(this.m_sTabAreaName+i).style.display='none';}catch(e){}}try{document.getElementById(this.m_sTabName+iActiveTab).className='tab'+iActiveTab+' tabactive';}catch(e){}try{document.getElementById(this.m_sTabAreaName+iActiveTab).style.display='block';}catch(e){}}catch(e){}};ThePort.UI.Tabs.prototype.Hilight=function(iHilightTab){try{return;for(i=1;i<=this.m_iTabCount;i++){document.getElementById(this.m_sTabName+i).className='tab'+i;}document.getElementById(this.m_sTabName+iHilightTab).className='tab'+iHilightTab+' tabactive';}catch(e){}};ThePort.UI.Tabs.prototype.UnHilight=function(){return;this.Hilight(this.m_iActiveTab);};ThePort.UI.Tabs.prototype.Initialize=function(){this.Render(this.m_iTabStart);};function ThePortCommon(){};ThePortCommon.Constants={CONST_EMPTY_STRING:ThePort.Common.CONST_EMPTY_STRING,CONST_UNDEFINED:ThePort.Common.CONST_UNDEFINED,CONST_TYPE_FUNCTION:ThePort.Common.CONST_TYPE_FUNCTION,CONST_ERROR_MESSAGE:ThePort.Common.CONST_ERROR_MESSAGE,CONST_FORM_POST:ThePort.Common.CONST_FORM_POST,CONST_FORM_GET:ThePort.Common.CONST_FORM_GET,CONST_FORM_DELETE:ThePort.Common.CONST_FORM_DELETE,CONST_FORM_PUT:ThePort.Common.CONST_FORM_PUT,CONST_FORMAT_XML:ThePort.Common.CONST_FORMAT_XML,CONST_FORMAT_JSON:ThePort.Common.CONST_FORMAT_JSON,CONST_CONTENTTYPE_JSON1:ThePort.Common.CONST_CONTENTTYPE_JSON1,CONST_CONTENTTYPE_JSON2:ThePort.Common.CONST_CONTENTTYPE_JSON2,CONST_CONTENTTYPE_JSON3:ThePort.Common.CONST_CONTENTTYPE_JSON3,CONST_CONTENTTYPE_XML:ThePort.Common.CONST_CONTENTTYPE_XML,CONST_CONTENTTYPE:ThePort.Common.CONST_CONTENTTYPE,CONST_FORM_POST_URLENC:ThePort.Common.CONST_FORM_POST_URLENC,CONST_CONTENTLENGTH:ThePort.Common.CONST_CONTENTLENGTH,CONST_HEADER_CONNECTION:ThePort.Common.CONST_HEADER_CONNECTION,CONST_HEADER_CONN_CLOSE:ThePort.Common.CONST_HEADER_CONN_CLOSE,CONST_ACTIVEX1_AJAX_OBJ:ThePort.Common.CONST_ACTIVEX1_AJAX_OBJ,CONST_ACTIVEX2_AJAX_OBJ:ThePort.Common.CONST_ACTIVEX2_AJAX_OBJ,CONST_ACTIVEX_XML_OBJ:ThePort.Common.CONST_ACTIVEX_XML_OBJ,QS_NAME:ThePort.Common.QS_NAME,QS_OBJECTID:ThePort.Common.QS_OBJECTID,QS_DATA:ThePort.Common.QS_DATA,QS_DATAFORMAT:ThePort.Common.QS_DATAFORMAT,QS_HASH:ThePort.Common.QS_HASH,QS_COMMENT:ThePort.Common.QS_COMMENT,QS_CONTEXTID:ThePort.Common.QS_CONTEXTID,CONST_COMMA:ThePort.Common.CONST_COMMA,CONST_EQUALS:ThePort.Common.CONST_EQUALS,CONST_QUESTION_MARK:ThePort.Common.CONST_QUESTION_MARK,CONST_AMPERSAND:ThePort.Common.CONST_AMPERSAND,CONST_SINGLE_QUOTE:ThePort.Common.CONST_SINGLE_QUOTE,CONST_DBL_QUOTE:ThePort.Common.CONST_DBL_QUOTE,CONST_GREATER_THAN:ThePort.Common.CONST_GREATER_THAN,CONST_LESS_THAN:ThePort.Common.CONST_LESS_THAN,CONST_ENC_AMPERSAND:ThePort.Common.CONST_ENC_AMPERSAND,CONST_ENC_SINGLE_QUOTE:ThePort.Common.CONST_ENC_SINGLE_QUOTE,CONST_ENC_DBL_QUOTE:ThePort.Common.CONST_ENC_DBL_QUOTE,CONST_ENC_GREATER_THAN:ThePort.Common.CONST_ENC_GREATER_THAN,CONST_ENC_LESS_THAN:ThePort.Common.CONST_ENC_LESS_THAN,CONST_HTTP_READYSTATE_UNINITIALIZED:ThePort.Common.CONST_HTTP_READYSTATE_UNINITIALIZED,CONST_HTTP_READYSTATE_LOADING:ThePort.Common.CONST_HTTP_READYSTATE_LOADING,CONST_HTTP_READYSTATE_LOADED:ThePort.Common.CONST_HTTP_READYSTATE_LOADED,CONST_HTTP_READYSTATE_INTERACTIVE:ThePort.Common.CONST_HTTP_READYSTATE_INTERACTIVE,CONST_HTTP_READYSTATE_COMPLETED:ThePort.Common.CONST_HTTP_READYSTATE_COMPLETED,CONST_STYLE_DISPLAY_ON:ThePort.Common.CONST_STYLE_DISPLAY_ON,CONST_STYLE_DISPLAY_OFF:ThePort.Common.CONST_STYLE_DISPLAY_OFF,CONST_AJAX_URL:ThePort.Common.CONST_AJAX_URL};ThePortXSL={Instantiate:function(sXml){return ThePort.XSL.Instantiate(sXml);},Instantiate64:function(xmlString){return ThePort.XSL.Instantiate64(xmlString);},RenderXML:function(oXml){return ThePort.XSL.RenderXML(oXml);},ParseAndRenderXML:function(oWin,sXml){return ThePort.XSL.ParseAndRenderXML(oWin,sXml);},FormatXmlToString:function(oXml){return ThePort.XSL.FormatXmlToString(oXml);},Decoder:function(sEncodedString){return ThePort.XSL.Decoder(sEncodedString);},LoadDocument:function(sXml){return ThePort.XSL.LoadDocument(sXml);},EscapeXML:function(sXml){return ThePort.XSL.EscapeXML(sXml);},SerializeToXML:function(oXml){return ThePort.XSL.SerializeToXML(oXml);},Save:function(oObject,fnCallback){return ThePort.XSL.Save(oObject,fnCallback);},Delete:function(oObject,fnCallback){return ThePort.XSL.Delete(oObject,fnCallback);},AjaxPost:function(sUrl,sPostData,oCallbackFn){return ThePort.XSL.AjaxPost(sUrl,sPostData,oCallbackFn);},AjaxDelete:function(sUrl,sPostData,oCallbackFn){return ThePort.XSL.AjaxDelete(sUrl,sPostData,oCallbackFn);},AjaxGet:function(sUrl,oCallbackFn){return ThePort.XSL.AjaxGet(sUrl,oCallbackFn);},GetModulePointer:function(sModuleName){return ThePort.XSL.GetModulePointer(sModuleName);},CallModuleFunction:function(sModuleName,oFnName){return ThePort.XSL.CallModuleFunction(sModuleName,oFnName);}};ThePortUtilities={Ajax:function(sCommand,sUrl,oBindFunction,sPostData){return ThePort.Utils.Ajax(sCommand,sUrl,oBindFunction,sPostData);},Bind:function(oObject,fMethodName){return ThePort.Utils.Bind(oObject,fMethodName);},AjaxBind:function(oObject,fMethodName){return ThePort.Utils.AjaxBind(oObject,fMethodName);},LogServerException:function(oResponse){return ThePort.Utils.LogServerException(oResponse);},RegisterModule:function(ns){return ThePort.Utils.RegisterModule(ns);},GetTagValue:function(oDoc,sTagName){return ThePort.Utils.GetTagValue(oDoc,sTagName);},GetVariablePair:function(sName,sValue){return ThePort.Utils.GetVariablePair(sName,sValue);},AddDictionaryPair:function(sName,sValue){return ThePort.Utils.AddDictionaryPair(sName,sValue);},AddVariablePair:function(sName,sValue){return ThePort.Utils.AddVariablePair(sName,sValue);},GetTagAttributeValue:function(oDoc,sTagName,sAttribName){return ThePort.Utils.GetTagAttributeValue(oDoc,sTagName,sAttribName);},GetValueFromNode:function(node){return ThePort.Utils.GetValueFromNode(node);},GetAttrValueFromNode:function(node,attr){return ThePort.Utils.GetAttrValueFromNode(node,attr);},GetObj:function(oObjectID){return ThePort.Utils.GetObj(oObjectID);},StopEvent:function(event){return ThePort.Utils.StopEvent(event);},Show:function(id){return ThePort.Utils.Show(id);},Hide:function(id){return ThePort.Utils.Hide(id);},Toggle:function(id){return ThePort.Utils.Toggle(id);},KeyDownHandler:function(eEvent,sButtonID){return ThePort.Utils.KeyDownHandler(eEvent,sButtonID);},GetReplyObject:function(oResponse){return ThePort.Utils.GetReplyObject(oResponse);},Decode64:function(input){return ThePort.Utils.Decode64(input);}};ThePortXMLProcessor=function(){this.m_oXmp=new ThePort.XMLProcessor();};ThePortXMLProcessor.prototype.transform=function(){return this.m_oXmp.transform()};ThePortXMLProcessor.prototype.loadXMLText=function(sXml){return this.m_oXmp.loadXMLText(sXml)};ThePortXMLProcessor.prototype.revert=function(sXml){return this.m_oXmp.revert(sXml);};ThePortXMLProcessor.prototype.setNodeEventValue=function(obj,xPath){return this.m_oXmp.setNodeEventValue(obj,xPath);};ThePortXMLProcessor.prototype.loadXSLText=function(sXsl){return this.m_oXmp.loadXSLText(sXsl);};ThePortXMLProcessor.prototype.setNodeEventValue=function(obj,xPath){return this.m_oXmp.setNodeEventValue(obj,xPath);};ThePortXMLProcessor.prototype.setNodeValue=function(xPath,sValue){return this.m_oXmp.setNodeValue(xPath,sValue);};ThePortXMLProcessor.prototype.getNodeValue=function(xPath){return this.m_oXmp.getNodeValue(xPath);};ThePortXMLProcessor.prototype.parse=function(oDoc){return this.m_oXmp.parse(oDoc);};ThePortXMLProcessor.prototype.getTagValue=function(sTagName){return this.m_oXmp.getTagValue(sTagName);};ThePortXMLProcessor.prototype.debug=function(){return this.m_oXmp.debug();};ThePortXMLProcessor.prototype.displayXML=function(oWin,oXml){return this.m_oXmp.displayXML(oWin,oXml);};ThePortXMLProcessor.prototype.Delete=function(fnCallback){return this.m_oXmp.fnCallback(Delete);};ThePortXMLProcessor.prototype.Save=function(fnCallback){return this.m_oXmp.Save(fnCallback);};ThePortXMLProcessor.prototype.Response=function(oResponse){return this.m_oXmp.Response(oResponse);};ThePortReplyObject=function(oXmlDoc){this.m_ro=new ThePort.ReplyObject(oXmlDoc);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(oXmlDoc){return this.m_ro.loadReply(oXmlDoc);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;} 