
﻿
String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"");}
String.prototype.ltrim=function(){return this.replace(/^\s+/,"");}
String.prototype.rtrim=function(){return this.replace(/\s+$/,"");}
function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){if(oldonload){oldonload();}
func();}}}
function detectFile(uploadFileID,uploadButtonID,pleaseWaitId){var idval=document.getElementById(uploadFileID).value;if(idval.length>4){if(idval.indexOf(":")&&idval.indexOf(".")){if(document.getElementById(uploadButtonID).click)
document.getElementById(uploadButtonID).click();else
document.getElementById(uploadButtonID).onclick();if(pleaseWaitId!=null){var pleaseWait=document.getElementById(pleaseWaitId);if(pleaseWait){pleaseWait.style.display="block";}}}}}
function showLogin(){var loginForm=document.getElementById("loginForm");if(loginForm.style["visibility"]=="visible")
loginForm.style["visibility"]="hidden";else
loginForm.style["visibility"]="visible";}
function launchValidator(controlToValidate){if(typeof(Page_ClientValidate)=='function'){for(i=0;i<Page_Validators.length;i++){if(Page_Validators[i].controltovalidate==controlToValidate.id){ValidatorValidate(Page_Validators[i]);}}}}
function $(){var elements=new Array();for(var i=0;i<arguments.length;i++){var element=arguments[i];if(typeof element=='string')
element=document.getElementById(element);if(arguments.length==1)
return element;elements.push(element);}
return elements;}
function divResizer(contentDivId,hideLinkId,showLinkId,maxLength,cutHeight,wireEvents){this.TEXT_BLOCK_MAX_LENGTH=maxLength;this.TEXT_BLOCK_CUT_HEIGHT=cutHeight;this.contentDiv=document.getElementById(contentDivId);this.hideLink=document.getElementById(hideLinkId);this.showLink=document.getElementById(showLinkId);if(!this.hideLink||!this.showLink)
return;var content=this.getContent(this.contentDiv);if(typeof content==='undefined'&&!content){this.hideBoth();return;}
this.contentHeight=this.contentDiv.offsetHeight;if(content.length>=this.TEXT_BLOCK_MAX_LENGTH&&this.contentHeight>cutHeight){this.contentDiv.style["overflow"]="hidden";this.hide();if((typeof(wireEvents)!=undefined)&&wireEvents)
{this.assignEvents();}}
else{this.hideBoth();}}
divResizer.prototype.assignEvents=function(){this.hideLink.onclick=hideContent;this.hideLink.setAttribute('contentDiv',this.contentDiv.id);this.hideLink.setAttribute('showLink',this.showLink.id);this.hideLink.setAttribute('cutHeight',this.TEXT_BLOCK_CUT_HEIGHT);this.showLink.onclick=showContent;this.showLink.setAttribute('contentDiv',this.contentDiv.id);this.showLink.setAttribute('hideLink',this.hideLink.id);this.showLink.setAttribute('contentHeight',this.contentHeight);RestoreStatus(this.contentDiv.id,this.showLink,this.hideLink);}
divResizer.prototype.hide=function(){this.contentDiv.style["height"]=this.TEXT_BLOCK_CUT_HEIGHT+"px";this.showLink.style["display"]="inline";this.hideLink.style["display"]="none";}
divResizer.prototype.hideBoth=function(){this.showLink.style["display"]="none";this.hideLink.style["display"]="none";}
divResizer.prototype.show=function(){this.contentDiv.style["height"]=this.contentHeight+"px";this.showLink.style["display"]="none";this.hideLink.style["display"]="inline";}
divResizer.prototype.getContent=function(elm){if(!elm)
return;if(elm.innerText){return elm.innerText;}else{return elm.textContent;}}
function RestoreStatus(contentDivID,showLink,hideLink){if(typeof window.RestoreStatusVault==='undefined'){window.RestoreStatusVault={};return;}
if(window.RestoreStatusVault[contentDivID]=='hidden')
hideLink.onclick();if(window.RestoreStatusVault[contentDivID]=='visible')
showLink.onclick();}
function hideContent(){window.RestoreStatusVault[this.getAttribute('contentDiv')]='hidden';contentDiv=document.getElementById(this.getAttribute('contentDiv'));showLink=document.getElementById(this.getAttribute('showLink'));contentDiv.style["height"]=this.getAttribute('cutHeight')+"px";showLink.style["display"]="inline";this.style["display"]="none";return false;}
function showContent(){window.RestoreStatusVault[this.getAttribute('contentDiv')]='visible';contentDiv=document.getElementById(this.getAttribute('contentDiv'));hideLink=document.getElementById(this.getAttribute('hideLink'));contentDiv.style["height"]=this.getAttribute('contentHeight')+"px";hideLink.style["display"]="inline";this.style["display"]="none";return false;}
function resizer(containerId,hideLinkId,showLinkId,iteamTag,maxLength){this.cutLength=maxLength;this.container=document.getElementById(containerId);this.hideLink=document.getElementById(hideLinkId);this.showLink=document.getElementById(showLinkId);if(!this.container)
return;this.items=this.container.getElementsByTagName(iteamTag);if(this.items.length>this.cutLength){this.hideItems();}}
resizer.prototype.hideItems=function(){this.hideExtraItems();this.showLink.style["display"]="inline";this.hideLink.style["display"]="none";this.showLink.focus();}
resizer.prototype.setItemsStyle=function(styleName,StyleValue){for(var i=this.cutLength;i<this.items.length;i++){this.items[i].style[styleName]=StyleValue;}}
resizer.prototype.hideExtraItems=function(){this.setItemsStyle("display","none");}
resizer.prototype.showExtraItems=function(){this.setItemsStyle("display","");}
resizer.prototype.showItems=function(){this.showExtraItems();this.showLink.style["display"]="none";this.hideLink.style["display"]="inline";}
function opacity(id,opacStart,opacEnd,millisec){var speed=Math.round(millisec/100);var timer=0;if(opacStart>opacEnd){for(i=opacStart;i>=opacEnd;i--){setTimeout("changeOpac("+i+",'"+id+"')",(timer*speed));timer++;}}else if(opacStart<opacEnd){for(i=opacStart;i<=opacEnd;i++)
{setTimeout("changeOpac("+i+",'"+id+"')",(timer*speed));timer++;}}}
function changeOpac(opacity,id){var object=document.getElementById(id).style;object.opacity=(opacity/100);object.MozOpacity=(opacity/100);object.KhtmlOpacity=(opacity/100);object.filter="alpha(opacity="+opacity+")";}
function shiftOpacity(id,millisec){if(document.getElementById(id).style.opacity==0){opacity(id,0,100,millisec);}else{opacity(id,100,0,millisec);}}
function blendimage(divid,imageid,imagefile,millisec){var speed=Math.round(millisec/100);var timer=0;document.getElementById(divid).style.backgroundImage="url("+document.getElementById(imageid).src+")";changeOpac(0,imageid);document.getElementById(imageid).src=imagefile;for(i=0;i<=100;i++){setTimeout("changeOpac("+i+",'"+imageid+"')",(timer*speed));timer++;}}
function currentOpac(id,opacEnd,millisec){var currentOpac=100;if(document.getElementById(id).style.opacity<100){currentOpac=document.getElementById(id).style.opacity*100;}
opacity(id,currentOpac,opacEnd,millisec)}
function hidediv(id){if(document.getElementById){document.getElementById(id).style.display='none';}
else{if(document.layers){document.id.display='none';document.id.visibility='false'}
else{document.all.id.style.display='none';}}}
function showdiv(id){if(document.getElementById){document.getElementById(id).style.display='block';}
else{if(document.layers){document.id.display='block';}
else{document.all.id.style.display='block';}}}
function setHiddenValue(controlID,Value){control=document.getElementById(controlID);if(control)
control.value=Value;}
function cssMenuIEFix(ulid){if(document.all&&document.getElementById){navRoot=document.getElementById(ulid);for(i=0;i<navRoot.childNodes.length;i++){node=navRoot.childNodes[i];if(node.nodeName=="LI"){node.onmouseover=function(){this.className+=" over";}
node.onmouseout=function(){this.className=this.className.replace(" over","");}}}}}
function checkWebSiteName(sender,args){var WebSiteName=document.getElementById(WebSiteNameTextID).value;args.IsValid=(WebSiteName.indexOf("http")<0&&WebSiteName.indexOf("www")<0);}
var detect=navigator.userAgent.toLowerCase();function doKeyPress(obj,evt){maxLength=obj.getAttribute("maxlength");var e=window.event?event.keyCode:evt.which;if((e==32)||(e==13)||(e>47)){if(maxLength&&(obj.value.length>maxLength-1)){if(window.event){window.event.returnValue=null;}else{evt.cancelDefault;return false;}}}}
function doKeyUp(obj){maxLength=obj.getAttribute("maxlength");if(maxLength&&obj.value.length>maxLength){obj.value=obj.value.substr(0,maxLength);}}
function doPaste(obj){maxLength=obj.getAttribute("maxlength");if(maxLength){if((window.event)&&(detect.indexOf("safari")+1==0)){var oTR=obj.document.selection.createRange();var iInsertLength=maxLength-obj.value.length+oTR.text.length;try{var sData=window.clipboardData.getData("Text").substr(0,iInsertLength);oTR.text=sData;}
catch(err){}
if(window.event){window.event.returnValue=null;}else{obj.value=obj.value.substr(0,maxLength);return false;}}}}
function ScrollToTop(){scroll(0,0);Sys.WebForms.PageRequestManager.getInstance().remove_pageLoaded(ScrollToTop);}
function RedirectToSearchPage(){if(globalSearchBox){var searchURL="Search.aspx?q="+encodeURIComponent(globalSearchBox.value);document.location.href=searchURL;return false;}}
function onEnter(e){e=e||window.event;var code=e.keyCode||e.which;if(code==13){RedirectToSearchPage();return false;}}
function selectAll(textId){var textControl=document.getElementById(textId);if(textControl){textControl.focus();textControl.select();}}
function colorFade(id,element,start,end,steps,speed){var startrgb,endrgb,er,eg,eb,step,rint,gint,bint,step;var target=document.getElementById(id);steps=steps||20;speed=speed||20;clearInterval(target.timer);endrgb=colorConv(end);er=endrgb[0];eg=endrgb[1];eb=endrgb[2];if(!target.r){startrgb=colorConv(start);r=startrgb[0];g=startrgb[1];b=startrgb[2];target.r=r;target.g=g;target.b=b;}
rint=Math.round(Math.abs(target.r-er)/steps);gint=Math.round(Math.abs(target.g-eg)/steps);bint=Math.round(Math.abs(target.b-eb)/steps);if(rint==0){rint=1}
if(gint==0){gint=1}
if(bint==0){bint=1}
target.step=1;target.timer=setInterval(function(){animateColor(id,element,steps,er,eg,eb,rint,gint,bint)},speed);}
function animateColor(id,element,steps,er,eg,eb,rint,gint,bint){var target=document.getElementById(id);var color;if(target.step<=steps){var r=target.r;var g=target.g;var b=target.b;if(r>=er){r=r-rint;}else{r=parseInt(r)+parseInt(rint);}
if(g>=eg){g=g-gint;}else{g=parseInt(g)+parseInt(gint);}
if(b>=eb){b=b-bint;}else{b=parseInt(b)+parseInt(bint);}
color='rgb('+r+','+g+','+b+')';if(element=='background'){target.style.backgroundColor=color;}else if(element=='border'){target.style.borderColor=color;}else{target.style.color=color;}
target.r=r;target.g=g;target.b=b;target.step=target.step+1;}else{clearInterval(target.timer);color='rgb('+er+','+eg+','+eb+')';if(element=='background'){target.style.backgroundColor=color;}else if(element=='border'){target.style.borderColor=color;}else{target.style.color=color;}}}
function colorConv(color){var rgb=[parseInt(color.substring(0,2),16),parseInt(color.substring(2,4),16),parseInt(color.substring(4,6),16)];return rgb;}