var browser;var caution=false;var vers;var internalHttpObject=null;if(navigator.appName=="Netscape"){browser="NS";}else{vers=navigator.appVersion;vers=parseFloat(vers.substring(vers.lastIndexOf(".")-1,vers.length));browser="IE";}function CreateScript(d){var R=document.createElement("script");R.type="text/javascript";R.text=d;document.body.appendChild(R);}function ivcSaveData(R,d,Q){if(Q==null){Q="NULL";}return ivcExecFunctionSync(GetHost()+"HttpModules/AvbGlobalFunctions.ashx","SaveData",Q,R,d);}function ivcGetData(R,d){if(d==null){d="NULL";}return ivcExecFunctionSync(GetHost()+"HttpModules/AvbGlobalFunctions.ashx","GetData",d,R);}function createObject(Q){var q=0,U;var h=new Object();var d;if(Q!=null){d=document.getElementById(Q);}else{d=document;}var R=d.getElementsByTagName("select");for(U=0;U<R.length;U++){dbn=R[U].getAttribute("db");if(dbn==null||dbn=="false"){continue;}name=R[U].getAttribute("id");h[name]="";}R=d.getElementsByTagName("input");for(U=0;U<R.length;U++){dbn=R[U].getAttribute("db");if(dbn==null||dbn=="false"){continue;}name=R[U].getAttribute("id");h[name]="";}R=d.getElementsByTagName("textarea");for(U=0;U<R.length;U++){dbn=R[U].getAttribute("db");if(dbn==null||dbn=="false"){continue;}name=R[U].getAttribute("id");h[name]="";}return h;}function jsonPrep(Q,h){var R;if(Q!=null){R=document.getElementById(Q);}else{R=document;}var d=getMembers(h);for(var U=0;U<d.length;U++){var q=getElement(d[U]);if(q.value!=""){h[d[U]]=q.value;}else{delete h[d[U]];}}return h;}function getMembers(Q){var R=new Array();var d=0;for(var U in Q){R[d]=U;d++;}return R;}function showMembers(q){var R=getMembers(q);var U="";for(var d=0;d<R.length;d++){var h=R[d];var Q=q[h];U+=h+" = ";U+=Q+"<br>";}DynamicPopup(U,600,700);}function setFormType(U){var R=document.getElementsByTagName(U);for(var d=0;d<R.length;d++){var Q=R[d];if(U=="input"){if((Q.getAttribute("type")=="text")||(Q.getAttribute("type")=="password")){Q.onmouseover=function(){this.className="highlightActiveField";};Q.onmouseout=function(){this.className="highlightInactiveField";};Q.className="highlightInactiveField";}}else{Q.onmouseover=function(){this.className="highlightActiveField";};Q.onmouseout=function(){this.className="highlightInactiveField";};Q.className="highlightInactiveField";}}}function setElementError(d,Q){var d,R=0;if(Q==null){Q=false;}if(Q){d.style.border="1px solid";d.className="highlightErrorField";}else{d.style.border="1px solid #FF5050";}}function setError(q){var U,Q=0;if(q==null){q=false;}var R=document.getElementsByTagName("input");for(var d=0;d<R.length;d++){var U=R[d];if(((U.getAttribute("type")=="text")||(U.getAttribute("type")=="password"))&&U.getAttribute("valid")=="true"&&U.value==""){if(q){U.style.border="1px solid";U.className="highlightErrorField";}else{U.style.border="1px solid #FF5050";}Q++;}}R=document.getElementsByTagName("select");for(var d=0;d<R.length;d++){var U=R[d];if(U.getAttribute("valid")=="true"&&U.selectedIndex==0){if(q){U.style.border="1px solid";U.className="highlightErrorField";}else{U.style.border="1px solid #FF5050";}Q++;}}R=document.getElementsByTagName("textarea");for(var d=0;d<R.length;d++){var U=R[d];if(U.getAttribute("valid")=="true"&&U.innerText==""){if(q){U.style.border="1px solid";U.className="highlightErrorField";}else{U.style.border="1px solid #FF5050";}Q++;}}return Q;}function setClassHighlight(U){var R=document.getElementsByTagName("div");for(var Q=0;Q<R.length;Q++){var q=R[Q];if(q.className==U){var d=q.style.backgroundColor;q.onmouseover=function(){this.style.backgroundColor=this.getAttribute("hlcolor");};q.onmouseout=function(){this.style.backgroundColor=d;};}}}function initHighlight(){if(!document.getElementsByTagName){return ;}setFormType("input");setFormType("textarea");setFormType("select");setClassHighlight("highlighttext");}function addLoadEvent(R){if(browser!="IE"){if(document.addEventListener){document.addEventListener("DOMContentLoaded",R,false);}return ;}var d=window.onload;if(typeof window.onload!="function"){window.onload=R;}else{window.onload=function(){d();R();};}}addLoadEvent(initHighlight);try{addLoadEvent(PageInit);}catch(err){}function ivcNiceEditor(){}ivcNiceEditor.prototype={activediv:null,divname:null,url:null,callback:false,getContent:function(){return activediv.instanceById(divname).getContent();},setContent:function(R){return activediv.instanceById(divname).setContent(R);},removeInstance:function(){this.activediv.removeInstance(divname);this.activediv=null;},init:function(U,Q,d,R){callback=R;divname=U;url=d;if(this.activediv!=null){return ;}if(Q==null){this.activediv=new nicEditor({fullPanel:true,onSave:function(Z,Y,q){if(callback==null){var h=new ivcAjaxClient();h.callback=function(p){if(p==0){alert("Failed to save the data");}else{if(p==1){alert("Saved");}}};h.ivcExecFunction(url,"SaveCMSData",window.location.pathname,divname,escape(Z));}else{callback(Z);}}}).panelInstance(U,{hasPanel:true});}else{this.activediv=new nicEditor({iconsPath:Q,fullPanel:true,onSave:function(Z,Y,q){if(callback==null){var h=new ivcAjaxClient();h.callback=function(p){if(p==0){alert("Failed to save the data");}else{if(p==1){alert("Saved");}}};h.ivcExecFunction(url,"SaveCMSData",window.location.pathname,divname,escape(Z));}else{callback(Z);}}}).panelInstance(U,{hasPanel:true});}}};function ivcAjaxClient(){}ivcAjaxClient.prototype={requestType:"POST",isAsync:true,showAnimation:true,contentType:"application/x-www-form-urlencoded",xmlhttp:false,callback:false,onSend:function(){},onload:function(){if(this.showAnimation){ivcHideWait();}},onError:function(R){alert(R);},init:function(){try{this.xmlhttp=new XMLHttpRequest();}catch(Q){var R=new Array("MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP");var U=false;for(var d=0;d<R.length&&!U;d++){try{this.xmlhttp=new ActiveXObject(R[d]);U=true;}catch(Q){}}if(!U){this.onError("Unable to create XMLHttpRequest.");}}},makeRequest:function(d,Q){if(!this.xmlhttp){this.init();}this.xmlhttp.open(this.requestType,d,this.isAsync);this.xmlhttp.setRequestHeader("Content-Type",this.contentType);var R=this;this.xmlhttp.onreadystatechange=function(){R._readyStateChangeCallback();};this.xmlhttp.send(Q);if(this.showAnimation){ivcShowWait();}if(!this.isAsync){return this.xmlhttp.responseText;}},ivcExecAjaxMethod:function(){var R=location.pathname;if(R.charAt(R.length-1)=="/"){R+="default.aspx";}this.makeRequest(R,"IvcPagePostBack=@@ivcSoapXml|"+getArgXml(arguments,0));},ivcExecFunction:function(R){this.makeRequest(R,"IvcPagePostBack=@@ivcSoapXml|"+getArgXml(arguments,1));},_readyStateChangeCallback:function(){switch(this.xmlhttp.readyState){case 2:this.onSend();break;case 4:this.onload();if(this.xmlhttp.status==200){this.callback(this.xmlhttp.responseText);}else{this.onError("HTTP Error Making Request: "+"["+this.xmlhttp.status+"]"+this.xmlhttp.statusText);}break;}}};function ivcCreateWaitElement(){var R=document.getElementById("__ivc_Wait");if(!R){R=document.createElement("div");R.id="__ivc_Wait";R.style.position="absolute";R.innerHTML="<img src=\"/ProPicks/img/busy.gif\"/>";R.style.visibility="hidden";document.body.insertBefore(R,document.body.firstChild);}ivcwaitElement=R;}var ivcwaitElement;var ivcscrollX,ivcscrollY=-1;function ivcMoveWaitElement(){var Q,R;if(!ivcwaitElement){CreateWaitElement();}if(typeof (window.pageYOffset)=="number"){Q=window.pageYOffset;R=window.pageXOffset;}else{if(document.body&&document.documentElement&&document.documentElement.scrollTop){Q=document.documentElement.scrollTop;R=document.body.scrollLeft;}else{if(document.body&&typeof (document.body.scrollTop)=="number"){Q=document.body.scrollTop;R=document.body.scrollLeft;}}}if(ivcscrollX!=R||ivcscrollY!=Q){ivcscrollX=R;ivcscrollY=Q;var d=document.body.clientWidth;ivcwaitElement.style.left=(document.body.clientWidth)?(document.body.clientWidth-(ivcwaitElement.clientWidth))/2:0;ivcwaitElement.style.top=(document.body.clientHeight)?(document.body.clientHeight-(ivcwaitElement.clientHeight))/2+document.body.scrollTop:0;}}function ivcShowWait(){try{if(ivcwaitElement==null){ivcCreateWaitElement();if(ivcwaitElement==null){return ;}}if(ivcwaitElement){ivcwaitElement.style.zIndex="9000";ivcwaitElement.style.visibility="visible";ivcMoveWaitElement();}}catch(R){}}function ivcHideWait(){try{if(ivcwaitElement==null){return ;}if(ivcwaitElement){ivcwaitElement.style.visibility="hidden";}}catch(R){}}function ShowWait(){try{if(waitElement==null){return ;}if(waitElement){waitElement.style.zIndex="9000";waitElement.style.visibility="visible";MoveWaitElement();}}catch(R){}}function HideWait(){try{if(waitElement==null){return ;}if(waitElement){waitElement.style.visibility="hidden";}}catch(R){}}function getArgXml(Q,d){var R="<d>";for(i=d;i<Q.length;i++){if(i==d){R+="<m>"+Q[i]+"</m>";}else{R+="<p><![CDATA["+Q[i]+"]]></p>";}}return R+="</d>";}function toJsonObj(jstr){return eval("("+jstr+")");}function sendJson(url,jobj){if(typeof (jobj)=="string"){var ret=ivcExecFunctionSync(url,"RecieveClientData",jobj);return eval("("+ret+")");}var ret=ivcExecFunctionSync(url,"RecieveClientData",JSON.stringify(jobj));return eval("("+ret+")");}function exServerMethodWS(h,d){var R=0;var q;var U=new Array();for(i=2;i<arguments.length;i++){q=arguments[i];if(typeof (q)=="object"){U[R]=JSON.stringify(q);}else{U[R]=q;}R++;}var Q=new SOAPClientParameters();Q.add("json",JSON.stringify(U));SOAPClient.invoke(d,"ExecuteAvbPageMethod",Q,true,h);}function exServerMethod(h,d){var R=0;var q;var U=new Object();var Q=new Array();for(i=2;i<arguments.length;i++){q=arguments[i];if(typeof (q)=="object"){Q[R]=JSON.stringify(q);}else{Q[R]=q;}R++;}U.method="GetPage";U.parameters=JSON.stringify(Q);U.command="ExecuteAvbPageMethod";sendJsonAsync(h,d,U);}function sendJsonAsync(d,R,Q){if(typeof (Q)=="string"){ivcExecFunctionAsyncJ(d,R,"RecieveClientData",Q);return ;}ivcExecFunctionAsyncJ(d,R,"RecieveClientData",JSON.stringify(Q));return ;}function ivcExecFunctionSync(d){try{var R=ExecutePost(d,"IvcPagePostBack=@@ivcSoapXml|"+getArgXml(arguments,1));return R;}catch(Q){}return "error";}function ivcExecFunctionAsync(d,R){ivcCallAjaxAsync2(d,R,"IvcPagePostBack=@@ivcSoapXml|"+getArgXml(arguments,2));}function ivcExecFunctionAsyncJ(d,R){ivcCallAjaxAsync2(d,R,"IvcPagePostBack=@@ivcSoapXml|"+getArgXml(arguments,2),true);}function ivcExecAjaxMethodSync(){try{var d=location.pathname;if(d.charAt(d.length-1)=="/"){d+="default.aspx";}var R=ExecutePost(d,"IvcPagePostBack=@@ivcSoapXml|"+getArgXml(arguments,0));ivcHideWait();return R;}catch(Q){}}function ivcExecAjaxMethod(d){var R=location.pathname;if(R.charAt(R.length-1)=="/"){R+="default.aspx";}ivcCallAjaxAsync(d,R,"IvcPagePostBack=@@ivcSoapXml|"+getArgXml(arguments,1));}function ivcMainCallback2(R,d){R(d);}function ivcMainCallback(R,d){R(d);}function ivcCallAjaxAsync2(CallBackFn,rscript,params,fid){try{ivcShowWait();if(internalHttpObject==null){internalHttpObject=GetHttpObject();}internalHttpObject.open("POST",rscript,true,"","");internalHttpObject.setRequestHeader("Content-Type","application/x-www-form-urlencoded");internalHttpObject.send(params);internalHttpObject.onreadystatechange=function(){if(internalHttpObject.readyState==4){ivcHideWait();if(fid==null){ivcMainCallback2(CallBackFn,internalHttpObject.responseText);}else{ivcMainCallback2(CallBackFn,eval("("+internalHttpObject.responseText+")"));}}};}catch(e){ivcHideWait();}}function ivcCallAjaxAsync(Q,R,q,U){try{ivcShowWait();if(internalHttpObject==null){internalHttpObject=GetHttpObject();}internalHttpObject.open("POST",R,true,"","");internalHttpObject.setRequestHeader("Content-Type","application/x-www-form-urlencoded");internalHttpObject.send(q);internalHttpObject.onreadystatechange=function(){if(internalHttpObject.readyState==4){ivcHideWait();ivcMainCallback(Q,internalHttpObject.responseText);}};}catch(d){ivcHideWait();}}function URLEncode(Z){if(Z==null){return "";}var Y="0123456789"+"ABCDEFGHIJKLMNOPQRSTUVWXYZ"+"abcdefghijklmnopqrstuvwxyz"+"-_.!~*'()";var d="0123456789ABCDEF";var q=Z;var h="";for(var Q=0;Q<q.length;Q++){var U=q.charAt(Q);if(U==" "){h+="+";}else{if(Y.indexOf(U)!=-1){h+=U;}else{var R=U.charCodeAt(0);if(R>255){alert("Unicode Character '"+U+"' cannot be encoded using standard URL encoding.\n"+"(URL encoding only supports 8-bit characters.)\n"+"A space (+) will be substituted.");h+="+";}else{h+="%";h+=d.charAt((R>>4)&15);h+=d.charAt(R&15);}}}}return h;}function URLDecode(h){var R="0123456789ABCDEFabcdef";var q=h;var U="";var d=0;while(d<q.length){var Q=q.charAt(d);if(Q=="+"){U+=" ";d++;}else{if(Q=="%"){if(d<(q.length-2)&&R.indexOf(q.charAt(d+1))!=-1&&R.indexOf(q.charAt(d+2))!=-1){U+=unescape(q.substr(d,3));d+=3;}else{alert("Bad escape combination near ..."+q.substr(d));U+="%[ERROR]";d++;}}else{U+=Q;d++;}}}return U;}function StringBuilder(R){this.strings=new Array("");this.append(R);}StringBuilder.prototype.append=function(R){if(R){this.strings[this.strings.length]=R;}};StringBuilder.prototype.clear=function(){this.strings.length=1;};StringBuilder.prototype.toString=function(){return this.strings.join("");};function DynamicPopup(R){var d=window.open("","name");d.document.write(R);d.document.close();}function DynamicPopupW(d,R,Q){var U=window.open("","name","height="+Q+",width="+R);U.document.write(d);U.document.close();}function remove(d,R){i=d.indexOf(R);r="";if(i==-1){return d;}r+=d.substring(0,i)+remove(d.substring(i+R.length),R);return r;}var MozFox=false;if(document.implementation&&document.implementation.createDocument){MozFox=true;Array.prototype.item=function(R){return this[R];};Array.prototype.expr="";XMLDocument.prototype.setProperty=function(R,d){};XMLDocument.prototype.selectNodes=function(d,R){var U=this.evaluate(d,(R?R:this),this.createNSResolver(this.documentElement),XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);var Q=new Array(U.snapshotLength);Q.expr=d;for(i=0;i<Q.length;i++){Q[i]=U.snapshotItem(i);}return Q;};Element.prototype.selectNodes=function(R){var d=this.ownerDocument;if(d.selectNodes){return d.selectNodes(R,this);}else{throw "SarissaXPathOperationException: Method selectNodes is only supported by XML Nodes";}};XMLDocument.prototype.selectSingleNode=function(Q,d){var R=d?d:null;Q="("+Q+")[1]";var U=this.selectNodes(Q,R);if(U.length>0){return U.item(0);}else{return null;}};Element.prototype.selectSingleNode=function(R){var d=this.ownerDocument;if(d.selectSingleNode){return d.selectSingleNode(R,this);}else{throw "Method selectNodes is only supported by XML Elements";}};}function GetXmlString(R){var d;if(window.ActiveXObject){d=new ActiveXObject("Microsoft.XMLDOM");d.loadXML(R);}else{if(document.implementation&&document.implementation.createDocument){var Q=new DOMParser();d=Q.parseFromString(R,"text/xml");}}return d;}function GetXmlDoc(d){var R;if(window.ActiveXObject){R=new ActiveXObject("Microsoft.XMLDOM");R.async=false;}else{if(document.implementation&&document.implementation.createDocument){R=document.implementation.createDocument("","doc",null);}}if(typeof R!="undefined"){R.load(d);}return R;}function isEmail(d){var R=d.split("@");if(R[1]==null){return false;}else{if(R[1].indexOf(".")<3){return false;}}return (d.indexOf(".")>2)&&(d.indexOf("@")>0);}function SetFocus(R,d){setFocus(R,d);}function setFocus(R,Q){var d=getObject(R,Q);d.focus();}function ChangeCursor(R){document.body.style.cursor=R;}function doPostBack(R,d){__doPostBack(R,"@@ivc|"+d);}var today=new Date();var cexpire=new Date();cexpire.setTime(today.getTime()+1000*60*60*24*400);function setCookie(Q,q,R,Z,U,h){var d=Q+"="+escape(q)+((R)?"; expires="+R.toGMTString():"")+((Z)?"; path="+Z:"")+((U)?"; domain="+U:"")+((h)?"; secure":"");if(!caution||(Q+"="+escape(q)).length<=4000){document.cookie=d;}else{if(confirm("Cookie exceeds 4KB and will be cut!")){document.cookie=d;}}}function GetClipboard(){window.clipboardData.getData("Text");}function SetClipboard(R){window.clipboardData.setData("Text",R);}function getCookie(R){var Q=R+"=";var d=document.cookie.indexOf(Q);if(d==-1){return null;}var U=document.cookie.indexOf(";",d+Q.length);if(U==-1){U=document.cookie.length;}return unescape(document.cookie.substring(d+Q.length,U));}function deleteCookie(R,Q,d){if(getCookie(R)){document.cookie=R+"="+((Q)?"; path="+Q:"")+((d)?"; domain="+d:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT";}}function alternateRowColors(R){var U="classes";var h="#bbbbbb";if(R!=null){h=R;}var p,q;var Y=document.getElementsByTagName("table");var Z=0;for(var Q=0;Q<Y.length;Q++){if(Y.item(Q).className==U){atable=Y.item(Q);p=atable.getElementsByTagName("tr");for(var d=0;d<p.length;d++){q=p.item(d);if(q.nodeName=="TR"){if(Z%2){q.style.backgroundColor=h;}else{}Z++;}}Z=0;}}}function ivcPostBack(R){__doPostBack("","@@ivc|"+R);}function setIframeSource(Q,d){var R=document.getElementById(Q+"Style_frame");R.setAttribute("src",d);}function OpenModalWindow(d,R,Q){modeless=showModalDialog(d,"","help:No;status:no;font-family:Verdana;font-size:12;dialogWidth:"+R+"px;dialogHeight:"+Q+"px");}function OpenModlessWindow(d,R,Q){modeless=showModelessDialog(d,"","help:No;status:no;font-family:Verdana;font-size:12;dialogWidth:"+R+"px;dialogHeight:"+Q+"px");}function OpenModalWindowIFrame(d,R,Q,q){if(q==null){q="Alantus Modal Window";}var U="DialogIFrame.aspx?src="+escape(d)+"&w="+R+"&h="+Q+"&title="+q;modeless=showModalDialog(U,"","help:No;status:no;font-family:Verdana;font-size:12;dialogWidth:"+R+"px;dialogHeight:"+Q+"px");}function OpenModlessWindowIFrame(d,R,Q,q){if(q==null){q="Alantus Modless Window";}var U="DialogIFrame.aspx?src="+escape(d)+"&w="+R+"&h="+Q+"&title="+q;modeless=showModelessDialog(U,"","help:No;status:no;font-family:Verdana;font-size:12;dialogWidth:"+R+"px;dialogHeight:"+Q+"px");}function ivcReplaceStr(Q,R,d){pos=Q.lastIndexOf(R);return Q.substr(0,pos)+d+Q.substr(pos+R.length);}function GetParentElementByTagName(d,R){var d=d;while(d.tagName!=R){d=d.parentNode;}return d;}function openWin(q,R,U,Q){if(Q==null){Q="";}var d="scrollbars=no,resizable=no,width="+R+",height="+U;obj=window.open(q,Q,"toolbar=no,location=no,directories=no,status=no,menubar=no,"+d);}function GetHttpObject(){if(typeof window.ActiveXObject!="undefined"){return new ActiveXObject("Microsoft.XMLHTTP");}else{return new XMLHttpRequest();}}function ExecutePost(R,Q){var d=GetHttpObject();d.open("POST",R,false,"","");d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");d.send(Q);return d.responseText;}function runRemoteScript(d){var R=GetHttpObject();R.open("GET",d,false,"","");R.setRequestHeader("Content-Type","text/xml");R.send(null);return R.responseText;}function AsyncResponse(R){alert(R);}function runRemoteScriptAsync(d){var R=GetHttpObject();R.open("GET",d,true,"","");R.setRequestHeader("Content-Type","text/xml");R.onreadystatechange=function(){if(R.readyState==4){AsyncResponse(R.responseText);}};R.send(null);}function ExecuteSoapPost(R,Q){var d=GetHttpObject();if(d==null){alert("null object");return ;}d.open("POST",R,false,"","");d.setRequestHeader("Content-Type","text/xml");d.setRequestHeader("SOAPAction","http://tempuri.org/add");d.send(Q);return d.responseText;}function GetStyleObj(R){return getStyleObj(R);}function getId(d){var R=new String(d);R=R.replace(/_|\./g,"");R+="Style";return R;}function getStyleObj(name){var temp=new String(name);temp=temp.replace(/_|\./g,"");temp+="Style";if(browser=="NS"){return document.layers[temp];}else{return eval(temp).style;}}function GetObject(d,R){return getObject(d,R);}function getElement(R){return document.getElementById(R);}function $get(R){return document.getElementById(R);}function getObject(Q,d){var q=window;var U;if(browser=="NS"){U=document.getElementById(d+"Style");if(null!=U){return U;}else{return document.getElementById(d);}}else{var R=document.all[d];if(R==null){R=document.getElementById(d+"Style");if(null!=R){return R;}else{return document.getElementById(d);}}else{return R;}}}function GetObjectVal(d,R){var Q=getObject(d,R);if(Q.type=="select-one"){if(Q.selectedIndex<0){return null;}return Q.options[Q.selectedIndex].value;}else{return Q.value;}}function WriteText(R,d){writeText(R,d);}function writeText(R,d){var Q=getObject(null,R);if(Q==null){return ;}if(Q.type!=null){return ;}Q.innerHTML=d;}function addListItem2(R,h,U,Q,d){if(browser=="IE"){if(vers<5){R.options[R.length]=new Option(h,U,Q,d);}else{var Z=document.createElement("OPTION");Z.text=h;Z.value=U;R.options[R.length]=Z;}}else{var q=document.createElement("option");q.text=h;q.value=U;R.add(q,null);}}function addListItem(R,q,U,Q,d){if(typeof (R)=="string"){}addListItem2(getElement(q),U,Q);return ;if(browser=="IE"){if(vers<5){R.options[R.length]=new Option(q,U,Q,d);}else{var h=document.createElement("OPTION");h.text=q;h.value=U;R.options[R.length]=h;}}}function removeListItem(d,R){if(browser=="IE"){document.all[d].options[R]=null;}}function replaceListItem(d,h,q,U,Q,R){if(browser=="IE"){document.all[d].options[R]=new Option(h,q,U,Q);}}function getListItem(d,R){if(browser=="IE"){return document.all[d].options[R].value;}}function isLetter(R){return (((R>="a")&&(R<="z"))||((R>="A")&&(R<="Z")));}function isDigit(R){return ((R>="0")&&(R<="9"));}function isLetterOrDigit(R){return (isLetter(R)||isDigit(R));}function isAlphaNum(Q,R){var d;if(R==1){Q.toLowerCase();}if(R==2){Q.toUpperCase();}for(d=0;d<Q.length;d++){var U=Q.charAt(d);if(!isLetterOrDigit(U)){return false;}}return true;}function isAlphabetic(Q,R){var d;if(R==1){Q.toLowerCase();}if(R==2){Q.toUpperCase();}for(d=0;d<Q.length;d++){var U=Q.charAt(d);if(!isLetter(U)){return false;}}return true;}function isInteger(d){var R;for(R=0;R<d.length;R++){var Q=d.charAt(R);if(!isDigit(Q)){return false;}}return true;}function mask(d,R){LenStr=d.length;LenMsk=R.length;if((LenStr==0)||(LenMsk==0)){return (0);}if(LenStr!=LenMsk){return (0);}TempString="";for(Count=0;Count<=d.length;Count++){StrChar=d.substring(Count,Count+1);MskChar=R.substring(Count,Count+1);if(MskChar=="#"){if(!isNumberChar(StrChar)){return (0);}}else{if(MskChar=="?"){if(!isAlphabeticChar(StrChar)){return (0);}}else{if(MskChar=="!"){if(!isNumOrChar(StrChar)){return (0);}}else{if(MskChar=="*"){}else{if(MskChar!=StrChar){return (0);}}}}}}return (1);}function isAlphabeticChar(R){if(R.length!=1){return (false);}R=R.toLowerCase();RefString="abcdefghijklmnopqrstuvwxyz";if(RefString.indexOf(R.toLowerCase(),0)==-1){return (false);}return (true);}function isNumberChar(R){if(R.length!=1){return (false);}RefString="1234567890";if(RefString.indexOf(R,0)==-1){return (false);}return (true);}function isNumOrChar(R){if(R.length!=1){return (false);}R=R.toLowerCase();RefString="1234567890abcdefghijklmnopqrstuvwxyz";if(RefString.indexOf(R,0)==-1){return (false);}return (true);}function getQueryExtras(){return "&tabindex=99&tabid=0";}function GetRowElementText(q,R,Q){var U=document.getElementById(Q+"_row"+q);if(U==null){return "";}for(var d=0;d<U.childNodes.length;d++){if(R==d){return U.childNodes[d].innerText;}}return "";}function GetRowElementHtml(q,R,Q){var U=document.getElementById(Q+"_row"+q);if(U==null){return "";}for(var d=0;d<U.childNodes.length;d++){if(R==d){return U.childNodes[d].innerHTML;}}return "";}function SetRowElementText(h,R,Q,q){var U=document.getElementById(Q+"_row"+h);if(U==null){return false;}for(var d=0;d<U.childNodes.length;d++){if(R==d){U.childNodes[d].innerText=q;return true;}}return false;}function SetRowElementHtml(h,R,U,Q){var q=document.getElementById(U+"_row"+h);if(q==null){return false;}for(var d=0;d<q.childNodes.length;d++){if(R==d){q.childNodes[d].innerHTML=Q;return true;}}return false;}function dbValConvert(Q){var R=true;if(Q==null){return Q;}Q=escapeSingleQuotes(Q);for(var d=0;d<Q.length;d++){var U=Q.charAt(d);if(((U<"0")||(U>"9"))){R=false;break;}}if(!R){Q="'"+Q+"'";return Q;}else{return Q;}}function pageRefresh(){var d=window.location.pathname;var R=d.substring(d.lastIndexOf("/")+1);location=R;}function doPageGet(R){var Q=window.location.pathname;var d=Q.substring(Q.lastIndexOf("/")+1);location=d+R;}function MoveGridToForm(p,P){var Y=null;var R=document.getElementsByName("head");for(Q=0;Q<R.length;Q++){Y=R(Q);if(Y.getAttribute("name")==P){break;}}if(Y==null){alert("error:  table");return ;}var q=Y.getAttribute("fields");var U=q.split(",");var J=document.getElementById(P+"_row"+p);var h=J.childNodes.length;var d=0;for(var Q=0;Q<h;Q++){if(Q==0){continue;}var S=J.childNodes[Q].innerHTML;var Z=J.childNodes[Q].innerText;if(Z=="activate"||Z=="doEdit"){var m=S.indexOf("'");var n=S.indexOf("'",m+1);document.getElementById(U[d++]).value=S.substring(m+1,n);}else{document.getElementById(U[d++]).value=S;}}}function ButtonClick(R){document.getElementById("ivcmode").value=R;}function details(q,U,Q){var d=window.location.pathname;var R=d.substring(d.lastIndexOf("/")+1);location=R+"?command=details&fkvalue="+Q+getQueryExtras();}function InsertRow(Q){if(null!=document.getElementById("ivcaspx")){return ;}else{var d=window.location.pathname;var R=d.substring(d.lastIndexOf("/")+1);location=R+"?command=doInsert&table="+Q+getQueryExtras();}}function doEdit(h,Q,q,U){if(null!=document.getElementById("ivcaspx")){MoveGridToForm(h,U);}else{var d=window.location.pathname;var R=d.substring(d.lastIndexOf("/")+1);location=R+"?command=doEdit&pkvalue="+q+"&table="+U+getQueryExtras();}}function escapeSingleQuotes(Q){var d,R="";if(-1==Q.indexOf("'")){return Q;}for(d=0;d<Q.length;d++){var U=Q.charAt(d);if(U=="'"){R+="''";}else{R+=U;}}return R;}var rowVals;var currentRowNum;function dosave(Z,g){if(rowVals==null){alert("rows null");}if(currentRowNum==null){alert("cur rows null");}if(rowVals==null||currentRowNum==null){return ;}var P=0;var Q=null;var Y=document.getElementsByName("head");for(P=0;P<Y.length;P++){Q=Y(P);if(Q.getAttribute("name")==g){break;}}if(Q==null){alert("error:  table");return ;}var m=Q.attributes;var n=Q.getAttribute("fields");var L="";var x=n.split(",");var y=Q.getAttribute("pk").toLowerCase();var U=g+"."+Q.getAttribute("pk").toLowerCase();var J=rowVals.length;var h;var d="",R="";var N;var q=true;var S=0;for(var P=0;P<J;P++){if(P>0){N=document.getElementById("r"+currentRowNum+"_"+P).value;}if(P==0){continue;}else{if(q){if(y==x[P-1].toLowerCase()||U==x[P-1].toLowerCase()){R=dbValConvert(rowVals[P]);}else{if(rowVals[P]!=N){d+=x[P-1]+"="+dbValConvert(N);q=false;S++;}}}else{if(y==x[P-1].toLowerCase()||U==x[P-1].toLowerCase()){R=dbValConvert(rowVals[P]);}else{if(rowVals[P]!=N){d+=","+x[P-1]+"="+dbValConvert(N);S++;}}}}}if(S>0||Z==1){if(Z==1){h="delete from "+g+" where "+y+"="+R;}else{h="update "+g+" set "+d+" where "+y+"="+R;}var j=window.location.pathname;var p=j.substring(j.lastIndexOf("/")+1);location=p+"?command=inPlaceUpdate&updateString="+h+getQueryExtras();}}var restoreArray=null,crowNum="",ctable="";function InPlaceEdit(U,Y){if(rowVals!=null){if(rowVals.length>0){return ;}rowVals.length=0;}var p=document.getElementById(Y+"_row"+U);var d=p.childNodes.length;rowVals=new Array(d);restoreArray=new Array(d);crowNum=U;ctable=Y;for(var R=0;R<d;R++){var Z=p.childNodes[R].innerHTML;var Q=p.childNodes[R].innerText;restoreArray[R]=Z;if(Q=="edit"){rowVals[R]=R;p.childNodes[R].innerHTML="<a href='javascript:InPlaceRestore()'>esc</a> <a href=\"javascript:dosave(0,'"+Y+"')\">save</a> <a href=\"javascript:dosave(1,'"+Y+"')\" onclick= \"return confirm('Are you sure you want to Delete?')\">del</a>";}else{if(Z.indexOf("javascript:")>-1){var h=Z.indexOf("'");var q=Z.indexOf("'",h+1);rowVals[R]=Z.substring(h+1,q);if(rowVals[R].length>100){p.childNodes[R].innerHTML="<textarea cols='30' rows='8'  id='r"+U+"_"+R+"'>"+rowVals[R]+"</textarea>";}else{p.childNodes[R].innerHTML="<input id='r"+U+"_"+R+"' type='text' value='"+rowVals[R]+"'></input>";}}else{rowVals[R]=Z;if(Z.length>100){p.childNodes[R].innerHTML="<textarea cols='30' rows='8'  id='r"+U+"_"+R+"'>"+Z+"</textarea>";}else{p.childNodes[R].innerHTML="<input id='r"+U+"_"+R+"' type='text' value=\""+Z+"\"></input>";}}}}currentRowNum=U;}function InPlaceRestore(){if(restoreArray==null){return ;}var R=restoreArray.length;var Q=document.getElementById(ctable+"_row"+crowNum);if(Q==null){alert("null");}for(var d=0;d<R;d++){Q.childNodes[d].innerHTML=restoreArray[d];}rowVals=null;}var offsetfromcursorX=12;var offsetfromcursorY=10;var offsetdivfrompointerX=10;var offsetdivfrompointerY=14;document.write("<div id=\"dhtmltooltip\"></div>");document.write("<img id=\"dhtmlpointer\" style=\"display:none\" src=\"arrow2.gif\">");var ie=document.all;var ns6=document.getElementById&&!document.all;var enabletip=false;if(ie||ns6){var tipobj=document.all?document.all["dhtmltooltip"]:document.getElementById?document.getElementById("dhtmltooltip"):"";}var pointerobj=document.all?document.all["dhtmlpointer"]:document.getElementById?document.getElementById("dhtmlpointer"):"";function ietruebody(){return (document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;}function ddrivetip(d,R,Q){if(ns6||ie){if(typeof R!="undefined"){tipobj.style.width=R+"px";}if(typeof Q!="undefined"&&Q!=""){tipobj.style.backgroundColor=Q;}tipobj.innerHTML=d;enabletip=true;return false;}}function positiontip(Y){if(enabletip){var Q=false;var U=(ns6)?Y.pageX:event.clientX+ietruebody().scrollLeft;var d=(ns6)?Y.pageY:event.clientY+ietruebody().scrollTop;var Z=ie&&!window.opera?ietruebody().clientWidth:window.innerWidth-20;var R=ie&&!window.opera?ietruebody().clientHeight:window.innerHeight-20;var h=ie&&!window.opera?Z-event.clientX-offsetfromcursorX:Z-Y.clientX-offsetfromcursorX;var q=ie&&!window.opera?R-event.clientY-offsetfromcursorY:R-Y.clientY-offsetfromcursorY;var p=(offsetfromcursorX<0)?offsetfromcursorX*(-1):-1000;if(h<tipobj.offsetWidth){tipobj.style.left=U-tipobj.offsetWidth+"px";Q=true;}else{if(U<p){tipobj.style.left="5px";}else{tipobj.style.left=U+offsetfromcursorX-offsetdivfrompointerX+"px";pointerobj.style.left=U+offsetfromcursorX+"px";}}if(q<tipobj.offsetHeight){tipobj.style.top=d-tipobj.offsetHeight-offsetfromcursorY+"px";Q=true;}else{tipobj.style.top=d+offsetfromcursorY+offsetdivfrompointerY+"px";pointerobj.style.top=d+offsetfromcursorY+"px";}tipobj.style.visibility="visible";if(!Q){pointerobj.style.visibility="visible";}else{pointerobj.style.visibility="hidden";}}}function hideddrivetip(){if(ns6||ie){enabletip=false;tipobj.style.visibility="hidden";pointerobj.style.visibility="hidden";tipobj.style.left="-1000px";tipobj.style.backgroundColor="";tipobj.style.width="";}}document.onmousemove=positiontip;Hashtable.prototype.hash=null;Hashtable.prototype.keys=null;Hashtable.prototype.location=null;function Hashtable(){this.hash=new Array();this.keys=new Array();this.location=0;}Hashtable.prototype.put=function(R,d){if(d==null){return ;}if(this.hash[R]==null){this.keys[this.keys.length]=R;}this.hash[R]=d;};Hashtable.prototype.get=function(R){return this.hash[R];};Hashtable.prototype.remove=function(d){for(var R=0;R<this.keys.length;R++){if(d==this.keys[R]){this.hash[this.keys[R]]=null;this.keys.splice(R,1);return ;}}};Hashtable.prototype.size=function(){return this.keys.length;};Hashtable.prototype.populateItems=function(){};Hashtable.prototype.next=function(){if(++this.location<this.keys.length){return true;}else{return false;}};Hashtable.prototype.moveFirst=function(){try{this.location=-1;}catch(R){}};Hashtable.prototype.moveLast=function(){try{this.location=this.keys.length-1;}catch(R){}};Hashtable.prototype.getKey=function(){try{return this.keys[this.location];}catch(R){return null;}};Hashtable.prototype.getValue=function(){try{return this.hash[this.keys[this.location]];}catch(R){return null;}};Hashtable.prototype.getKeyOfValue=function(d){for(var R=0;R<this.keys.length;R++){if(this.hash[this.keys[R]]==d){return this.keys[R];}}return null;};Hashtable.prototype.toString=function(){try{var Q=new Array(this.keys.length);Q[Q.length]="{";for(var d=0;d<this.keys.length;d++){Q[Q.length]=this.keys[d];Q[Q.length]="=";var R=this.hash[this.keys[d]];if(R){Q[Q.length]=R.toString();}else{Q[Q.length]="null";}if(d!=this.keys.length-1){Q[Q.length]=", ";}}}catch(U){}finally{Q[Q.length]="}";}return Q.join("");};Hashtable.prototype.add=function(R){try{R.moveFirst();while(R.next()){var d=R.getKey();this.hash[d]=R.getValue();if(this.get(d)!=null){this.keys[this.keys.length]=d;}}}catch(Q){}finally{return this;}};var NS4=(document.layers)?1:0;var IE4=(document.all)?1:0;function animation(id){this.element=(NS4)?document[id]:document.all[id].style;this.active=0;this.timer=null;this.path=null;this.num=null;this.name=id+"Var";eval(this.name+" = this");this.animate=animate;this.step=step;this.show=show;this.hide=hide;this.left=left;this.top=top;this.moveTo=moveTo;this.slideBy=slideBy;this.slideTo=slideTo;this.circle=circle;}function pos(R,d){this.x=Math.round(R);this.y=Math.round(d);}function show(){this.element.visibility=(NS4)?"show":"visible";}function hide(){this.element.visibility=(NS4)?"hide":"hidden";}function left(){return parseInt(this.element.left);}function top(){return parseInt(this.element.top);}function moveTo(R,d){this.element.left=R;this.element.top=d;}function step(){this.moveTo(this.path[this.num].x,this.path[this.num].y);if(this.num>=this.path.length-1){clearInterval(this.timer);this.active=0;if(this.statement){eval(this.statement);}}else{this.num++;}}function animate(R){if(this.active){return ;}this.num=0;this.active=1;this.timer=setInterval(this.name+".step()",R);}function slideBy(p,Y,Z,R,h){var Q=this.left();var d=this.top();var q=Q+p;var U=d+Y;this.slideTo(q,U,Z,R,h);}function slideTo(Z,q,n,R,Y){var U=this.left();var d=this.top();var P=Z-U;var S=q-d;var m=P/n;var p=S/n;var Q=new Array();for(var h=0;h<n;h++){U+=m;d+=p;Q[h]=new pos(U,d);}this.path=Q;this.statement=(Y)?Y:null;this.animate(R);}function circle(Y,p,h,S,R,n){var J=h-p;var Z=J/S;var P=this.left();var m=this.top();var U=P-Y*Math.cos(p*Math.PI/180);var Q=m+Y*Math.sin(p*Math.PI/180);var d=new Array();for(var q=0;q<S;q++){p+=Z;P=U+Y*Math.cos(p*Math.PI/180);m=Q-Y*Math.sin(p*Math.PI/180);d[q]=new pos(P,m);}this.path=d;this.statement=(n)?n:null;this.animate(R);}function opacity(h,U,R,d){var Q=Math.round(d/100);var q=0;if(U>R){for(i=U;i>=R;i--){setTimeout("changeOpac("+i+",'"+h+"')",(q*Q));q++;}}else{if(U<R){for(i=U;i<=R;i++){setTimeout("changeOpac("+i+",'"+h+"')",(q*Q));q++;}}}}var ale=1;function changeOpac(d,Q){var R=document.getElementById(Q).style;R.opacity=(d/100);R.MozOpacity=(d/100);R.KhtmlOpacity=(d/100);R.filter="alpha(opacity="+d+")";}function shiftOpacity(d,R){if(document.getElementById(d).style.opacity==0){opacity(d,0,100,R);}else{opacity(d,100,0,R);}}function blendimage(h,R,q,d){var Q=Math.round(d/100);var U=0;document.getElementById(h).style.backgroundImage="url("+document.getElementById(R).src+")";changeOpac(0,R);document.getElementById(R).src=q;for(i=0;i<=100;i++){setTimeout("changeOpac("+i+",'"+R+"')",(U*Q));U++;}}function currentOpac(U,R,Q){var d=100;if(document.getElementById(U).style.opacity<100){d=document.getElementById(U).style.opacity*100;}opacity(U,d,R,Q);}var JSON=function(){var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\"":"\\\"","\\":"\\\\"},s={"boolean":function(x){return String(x);},number:function(x){return isFinite(x)?String(x):"null";},string:function(x){if(/["\\\x00-\x1f]/.test(x)){x=x.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c;}c=b.charCodeAt();return "\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16);});}return "\""+x+"\"";},object:function(x){if(x){var a=[],b,f,i,l,v;if(x instanceof Array){a[0]="[";l=x.length;for(i=0;i<l;i+=1){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=="string"){if(b){a[a.length]=",";}a[a.length]=v;b=true;}}}a[a.length]="]";}else{if(x instanceof Object){a[0]="{";for(i in x){v=x[i];f=s[typeof v];if(f){v=f(v);if(typeof v=="string"){if(b){a[a.length]=",";}a.push(s.string(i),":",v);b=true;}}}a[a.length]="}";}else{return ;}}return a.join("");}return "null";}};return {copyright:"(c)2005 JSON.org",license:"http://www.JSON.org/license.html",stringify:function(v){var f=s[typeof v];if(f){v=f(v);if(typeof v=="string"){return v;}}return null;},parse:function(text){try{return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(text.replace(/"(\\.|[^"\\])*"/g,"")))&&eval("("+text+")");}catch(e){return false;}}};}();
