﻿/* email_Encryption.js */
function CheckEmails(){
if (strstrDontWork == "false"){ 
var strLinkHref=new String();var strLinkText=new String();var strLinkHrefLCase=new String();var strDEmail=new String();for(i=0;i<document.links.length;i++){strLinkText=document.links[i].innerHTML;strLinkHref=document.links[i].href;strLinkHrefLCase=strLinkHref.toLowerCase();if(strLinkHrefLCase.indexOf("mailto:")>=0&&strLinkHref.indexOf("@")>=0){strDEmail=DecryptString(strLinkHref);strDEmail="mailto:"+strDEmail.substring("mailto:".length,strDEmail.length);document.links[i].href=strDEmail;if(strLinkText.indexOf("@")>=0){document.links[i].innerHTML=DecryptString(strLinkText);}}}}function EncryptString(strInputString){var intIndex;var strOut=new String();var strChar;for(intIndex=0;intIndex<strInputString.length;intIndex++){strChar=strInputString.charAt(intIndex);strOut=strOut+EncryptChar(strChar);}return strOut;}function DecryptString(strInputString){var intIndex;var strOut=new String();var strChar;for(intIndex=0;intIndex<strInputString.length;intIndex++){strChar=strInputString.charAt(intIndex);strOut=strOut+DecryptChar(strChar);}return strOut;}function EncryptChar(chrInputChar){var intIndex;var aAllChar=new Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z");var aReplaceChar=new Array("z","y","x","w","v","u","t","s","r","q","p","o","n","m","l","k","j","i","h","g","f","e","d","c","b","a");for(intIndex=0;intIndex<aAllChar.length;intIndex++){if(chrInputChar==aAllChar[intIndex]){return aReplaceChar[intIndex];}if(chrInputChar.toUpperCase()==aAllChar[intIndex].toUpperCase()){return aReplaceChar[intIndex].toUpperCase();}}return chrInputChar;}function DecryptChar(chrInputChar){var intIndex;var aAllChar=new Array("z","y","x","w","v","u","t","s","r","q","p","o","n","m","l","k","j","i","h","g","f","e","d","c","b","a");var aReplaceChar=new Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z");for(intIndex=0;intIndex<aAllChar.length;intIndex++){if(chrInputChar==aAllChar[intIndex]){return aReplaceChar[intIndex];}if(chrInputChar.toUpperCase()==aAllChar[intIndex].toUpperCase()){return aReplaceChar[intIndex].toUpperCase();}}return chrInputChar;}
 }
/* Popup.js */
var intNameID=0;function openChild(url,width,height)
{leftC=(screen.width-width)/2;topC=(screen.height-height)/2;intNameID=intNameID+1;var x1=window.open(url,'x_'+intNameID,"width="+width+", height="+height+",top="+topC+",left="+leftC+",location=no, menubar=no, status=no, toolbar=no, scrollbars=0,resizable=no");}
function openChildScroll(url,width,height)
{leftC=(screen.width-width)/2;topC=(screen.height-height)/2;window.open(url,null,"width="+width+", height="+height+",top="+topC+",left="+leftC+",location=no, menubar=no, status=no, toolbar=no, scrollbars=1,resizable=no");}
function openNewWindow(url)
{leftC=(screen.width-570)/2;topC=(screen.height-440)/2;window.open(url,null,"width=570px, height=440px,top="+topC+",left="+leftC+", location=no, menubar=no, status=no, toolbar=no, scrollbars=1,resizable=no");}
/* ShAjaxJS.js */
var strLoding="<b><center><img alt='Loading' title='Loading' src='App_Themes/en/images/ajax-loader.gif' />Loading...</center><b/>";var objCompleted=null;function GetXmlHttpObject(){var xmlHttp=null;try
{xmlHttp=new XMLHttpRequest();}catch(e){try
{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}}return xmlHttp;}function DoAjax(url,statusId,divLoadingId){var xmlHttp;xmlHttp=GetXmlHttpObject();if(xmlHttp==null){alert("Your browser does not support AJAX!");return;}xmlHttp.onreadystatechange=function stateChanged(){var strLodingTemp="";strLodingTemp=strLoding;switch(xmlHttp.readyState){case 0:case 1:case 2:case 3:if(document.getElementById(divLoadingId)!=null)document.getElementById(divLoadingId).innerHTML=strLodingTemp;break;case 4:if(document.getElementById(statusId)!=null)document.getElementById(statusId).innerHTML=xmlHttp.responseText;if(objCompleted!=null){objCompleted.complete(xmlHttp.responseText);}};};xmlHttp.open("GET",url,true);xmlHttp.send(null);}function TestShAjax(siteURL,divResultID,obj_Completed,divLoadingId){this.objCompleted=obj_Completed
DoAjax(siteURL,divResultID,divLoadingId);}function removeBadChar(strTemp){strTemp=strTemp.replace("--","");strTemp=strTemp.replace("|","");strTemp=strTemp.replace("<script>","&lt;script&gt;");strTemp=strTemp.replace("</","&lt;&frasl;");strTemp=strTemp.replace("/","&frasl;");strTemp=strTemp.replace(">","&gt;");strTemp=strTemp.replace("<","&lt;");strTemp=strTemp.replace(/^\s*/, "").replace(/\s*$/, "");return strTemp;}function newsLetterURL(strValue){var strTemp=document.getElementById(strValue).value;if(strTemp==""){alert('Enter a Valid E-mail Address! ');return false;}else
{strTemp=removeBadChar(strTemp);checkEmail(strTemp);}}function checkEmail(EmailValue){if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(EmailValue)){goToNewsLetter(EmailValue);}else{alert("Invalid E-mail Address! Please re-enter.");return false;}}
/* SearchAjax.js */
function CheckSearch(objText,strSearchTerm,strSearchMessage){var strTemp=removeBadChar(objText.value);if(strTemp.length<3||strTemp==strSearchTerm){alert(strSearchMessage);return false;}else
{window.location.href=strUrl+"search.aspx?keywords="+encodeURIComponent(removeBadChar(objText.value));}}function CheckEnterKey(e,obj,strSearchTerm,strSearchMessage){var characterCode
if(e&&e.which){e=e
characterCode=e.which}else{e=event
characterCode=e.keyCode}if(characterCode==13){CheckSearch(obj,strSearchTerm,strSearchMessage);return false;}else{return true;}}
/* common.js */
function addEvent(obj,evType,fn){if(obj.addEventListener){obj.addEventListener(evType,fn,false);return true;}else if(obj.attachEvent){var r=obj.attachEvent("on"+evType,fn);return r;}else{return false;}}function removeEvent(obj,evType,fn,useCapture){if(obj.removeEventListener){obj.removeEventListener(evType,fn,useCapture);return true;}else if(obj.detachEvent){var r=obj.detachEvent("on"+evType,fn);return r;}else{alert("Handler could not be removed");}}function getViewportHeight(){if(window.innerHeight!=window.undefined)return window.innerHeight;if(document.compatMode=='CSS1Compat')return document.documentElement.clientHeight;if(document.body)return document.body.clientHeight;return window.undefined;}function getViewportWidth(){var offset=17;var width=null;if(window.innerWidth!=window.undefined)return window.innerWidth;if(document.compatMode=='CSS1Compat')return document.documentElement.clientWidth;if(document.body)return document.body.clientWidth;}function getScrollTop(){if(self.pageYOffset){return self.pageYOffset;}else if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop;}else if(document.body){return document.body.scrollTop;}}function getScrollLeft(){if(self.pageXOffset){return self.pageXOffset;}else if(document.documentElement&&document.documentElement.scrollLeft){return document.documentElement.scrollLeft;}else if(document.body){return document.body.scrollLeft;}}
/* subModal.js */
var gPopupMask=null;var gPopupContainer=null;var gPopFrame=null;var gReturnFunc;var gPopupIsShown=false;var gDefaultPage=strUrl+"loading.html";var gHideSelects=false;var gReturnVal=null;var gTabIndexes=new Array();var gTabbableTags=new Array("A","BUTTON","TEXTAREA","INPUT","IFRAME");if(!document.all){document.onkeypress=keyDownHandler;}
function initPopUp(){theBody=document.getElementsByTagName('BODY')[0];popmask=document.createElement('div');popmask.id='popupMask';popcont=document.createElement('div');popcont.id='popupContainer';popcont.innerHTML=''+'<div id="popupInner">'+'<div id="popupTitleBar">'+'<div id="popupTitle"></div>'+'<div id="popupControls">'+'<label>' + strkey_send_to_a_friend + '</label><img style="cursor:pointer;" alt="'+ strkeyclose +'" title="'+ strkeyclose +'" src="'+strUrl+'App_Themes/en/images/close_xp.gif" onclick="hidePopWin(false);" id="popCloseBox" />'+'</div>'+'</div>'+'<iframe src="'+gDefaultPage+'" style="width:100%;height:100%;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="100%" height="100%"></iframe>'+'</div>';theBody.appendChild(popmask);theBody.appendChild(popcont);gPopupMask=document.getElementById("popupMask");gPopupContainer=document.getElementById("popupContainer");gPopFrame=document.getElementById("popupFrame");var brsVersion=parseInt(window.navigator.appVersion.charAt(0),10);if(brsVersion<=6&&window.navigator.userAgent.indexOf("MSIE")>-1){gHideSelects=true;}
var elms=document.getElementsByTagName('a');for(i=0;i<elms.length;i++){if(elms[i].className.indexOf("submodal")==0){elms[i].onclick=function(){var width=400;var height=200;params=this.className.split('-');if(params.length==3){width=parseInt(params[1]);height=parseInt(params[2]);}
showPopWin(this.href,width,height,null);return false;}}}}
addEvent(window,"load",initPopUp);function showPopWin(url,width,height,returnFunc,showCloseBox){if(showCloseBox==null||showCloseBox==true){document.getElementById("popCloseBox").style.display="block";}else{document.getElementById("popCloseBox").style.display="none";}
gPopupIsShown=true;disableTabIndexes();gPopupMask.style.display="block";gPopupContainer.style.display="block";centerPopWin(width,height);var titleBarHeight=parseInt(document.getElementById("popupTitleBar").offsetHeight,10);gPopupContainer.style.width=width+"px";gPopupContainer.style.height=(height+titleBarHeight)+"px";setMaskSize();gPopFrame.style.width=parseInt(document.getElementById("popupTitleBar").offsetWidth,10)+"px";gPopFrame.style.height=(height)+"px";gPopFrame.src=url;gReturnFunc=returnFunc;if(gHideSelects==true){hideSelectBoxes();}
window.setTimeout("setPopTitle();",600);}
var gi=0;function centerPopWin(width,height){if(gPopupIsShown==true){if(width==null||isNaN(width)){width=gPopupContainer.offsetWidth;}
if(height==null){height=gPopupContainer.offsetHeight;}
var theBody=document.getElementsByTagName("BODY")[0];var scTop=parseInt(getScrollTop(),10);var scLeft=parseInt(theBody.scrollLeft,10);setMaskSize();var titleBarHeight=parseInt(document.getElementById("popupTitleBar").offsetHeight,10);var fullHeight=getViewportHeight();var fullWidth=getViewportWidth();gPopupContainer.style.top=(scTop+((fullHeight-(height+titleBarHeight))/2))+"px";gPopupContainer.style.left=(scLeft+((fullWidth-width)/2))+"px";}}
addEvent(window,"resize",centerPopWin);addEvent(window,"scroll",centerPopWin);window.onscroll=centerPopWin;function setMaskSize(){var theBody=document.getElementsByTagName("BODY")[0];var fullHeight=getViewportHeight();var fullWidth=getViewportWidth();if(fullHeight>theBody.scrollHeight){popHeight=fullHeight;}else{popHeight=theBody.scrollHeight;}
if(fullWidth>theBody.scrollWidth){popWidth=fullWidth;}else{popWidth=theBody.scrollWidth;}
gPopupMask.style.height=popHeight+"px";gPopupMask.style.width=popWidth+"px";}
function hidePopWin(callReturnFunc){gPopupIsShown=false;var theBody=document.getElementsByTagName("BODY")[0];theBody.style.overflow="";restoreTabIndexes();if(gPopupMask==null){return;}
gPopupMask.style.display="none";gPopupContainer.style.display="none";if(callReturnFunc==true&&gReturnFunc!=null){gReturnVal=window.frames["popupFrame"].returnVal;window.setTimeout('gReturnFunc(gReturnVal);',1);}
gPopFrame.src=gDefaultPage;if(gHideSelects==true){displaySelectBoxes();}}
function setPopTitle(){return;if(window.frames["popupFrame"].document.title==null){window.setTimeout("setPopTitle();",10);}else{document.getElementById("popupTitle").innerHTML=window.frames["popupFrame"].document.title;}}
function keyDownHandler(e){if(gPopupIsShown&&e.keyCode==9)return false;}
function disableTabIndexes(){if(document.all){var i=0;for(var j=0;j<gTabbableTags.length;j++){var tagElements=document.getElementsByTagName(gTabbableTags[j]);for(var k=0;k<tagElements.length;k++){gTabIndexes[i]=tagElements[k].tabIndex;tagElements[k].tabIndex="-1";i++;}}}}
function restoreTabIndexes(){if(document.all){var i=0;for(var j=0;j<gTabbableTags.length;j++){var tagElements=document.getElementsByTagName(gTabbableTags[j]);for(var k=0;k<tagElements.length;k++){tagElements[k].tabIndex=gTabIndexes[i];tagElements[k].tabEnabled=true;i++;}}}}
function hideSelectBoxes(){for(var i=0;i<document.forms.length;i++){for(var e=0;e<document.forms[i].length;e++){if(document.forms[i].elements[e].tagName=="SELECT"){document.forms[i].elements[e].style.visibility="hidden";}}}}
function displaySelectBoxes(){for(var i=0;i<document.forms.length;i++){for(var e=0;e<document.forms[i].length;e++){if(document.forms[i].elements[e].tagName=="SELECT"){document.forms[i].elements[e].style.visibility="visible";}}}}

/* GotoTop */
function GotoTop()
{
if (strstrHideTop == "false"){ 
  var ie4 = (document.all && (navigator.userAgent.indexOf("Opera") == -1)); 
  var ns6 = (document.getElementById && (navigator.userAgent.indexOf("Opera") == -1)); 
  var ns4 = document.layers;
 lC=(ie4)? document.body.offsetHeight : document.height;
 rC=(ie4)? document.documentElement.clientHeight : window.innerHeight-20;
 if(lC>rC) 
 {
  document.getElementById('divTop').style.display = 'block';
 }
 else
 {
 document.getElementById('divTop').style.display = 'none';
 }
 }
}