var gHasPendingPopup=false;var gPendingPopupUrl=null;var gPendingPopupWidth=null;var gPendingPopupHeight=null;var gPendingPopupReturnFunc=null;var gLoading="/Assets/HTML/loading.html";var gPopupMask=null;var gPopupContainer=null;var gPopFrame=null;var gReturnFunc;var gPopupIsShown=false;var gHideSelects=true;var gTabIndexes=new Array();var gTabbableTags=new Array("A","BUTTON","TEXTAREA","INPUT","IFRAME");function setPopUpLoadingPage(a){gLoading=a}function registerPendingPopup(c,d,b,a){gHasPendingPopup=true;gPendingPopupUrl=c;gPendingPopupWidth=d;gPendingPopupHeight=b;gPendingPopupReturnFunc=a}function processPendingPopup(){if(gHasPendingPopup){gHasPendingPopup=false;showPopWin(gPendingPopupUrl,gPendingPopupWidth,gPendingPopupHeight,gPendingPopupReturnFunc);return false}else{return true}}function addEvent(b,c,d){if(b.addEventListener){b.addEventListener(c,d,false);return true}else{if(b.attachEvent){var a=b.attachEvent("on"+c,d);return a}else{return false}}}function removeEvent(b,c,e,d){if(b.removeEventListener){b.removeEventListener(c,e,d);return true}else{if(b.detachEvent){var a=b.detachEvent("on"+c,e);return a}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(){if(window.innerWidth!=window.undefined){return window.innerWidth}if(document.compatMode=="CSS1Compat"){return document.documentElement.clientWidth}if(document.body){return document.body.clientWidth}return window.undefined}if(!document.all){document.onkeypress=keyDownHandler}function initPopUp(){body=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" style="border:1px"></div><iframe src="'+gLoading+'" style="width:570px;height:100%;background-color:transparent;" scrolling="no" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="570" height="100%"></iframe></div>';body.appendChild(popmask);body.appendChild(popcont);gPopupMask=document.getElementById("popupMask");gPopupContainer=document.getElementById("popupContainer");gPopFrame=document.getElementById("popupFrame");var a=parseInt(window.navigator.appVersion.charAt(0),10);if(a<=6&&window.navigator.userAgent.indexOf("MSIE")>-1){gHideSelects=true}var b=document.getElementsByTagName("a");for(i=0;i<b.length;i++){if(b[i].className.indexOf("submodal")==0){b[i].onclick=function(){var d=600;var c=400;params=this.className.split("-");if(params.length==3){d=parseInt(params[1]);c=parseInt(params[2])}showPopWin(this.href,d,c,null);return false}}}processPendingPopup()}addEvent(window,"load",initPopUp);function showPopWin(c,f,b,a){var e=/^\/signin\/signin.aspx/gi;var g=/^\/signup\/signup.aspx/gi;if(e.test(c)&&(window.location.hostname.toLowerCase()=="www.hookit.com"||window.location.hostname.toLowerCase()=="www.hookit.dev")){window.location="/signin/default.aspx?redirecturl="+window.location.toString();return}if(g.test(c)&&(window.location.hostname.toLowerCase()=="www.hookit.com"||window.location.hostname.toLowerCase()=="www.hookit.dev")){window.location="/signup/default.aspx";return}if(gPopupContainer==null){registerPendingPopup(c,f,b,a)}else{gPopupIsShown=true;disableTabIndexes();gPopupMask.style.display="block";gPopupContainer.style.display="block";centerPopWin(f,b);var d=parseInt(document.getElementById("popupTitleBar").offsetHeight,10);gPopupContainer.style.width=f+"px";gPopupContainer.style.height=(b+d)+"px";gPopFrame.style.width=parseInt(document.getElementById("popupTitleBar").offsetWidth,10)+"px";gPopFrame.style.height=(b)+"px";gPopFrame.src=c;gReturnFunc=a;if(gHideSelects==true){hideSelectBoxes()}}}var gi=0;function centerPopWin(e,k){if(gPopupIsShown==true){if(e==null||isNaN(e)){e=gPopupContainer.offsetWidth}if(k==null){k=gPopupContainer.offsetHeight}var h=getViewportHeight();var a=getViewportWidth();var f=document.documentElement;var g=(document.documentElement&&document.documentElement.scrollTop)?document.documentElement.scrollTop:document.body.scrollTop;var c=(document.documentElement&&document.documentElement.scrollLeft)?document.documentElement.scrollLeft:document.body.scrollLeft;var j=parseInt(g);var d=parseInt(c);gPopupMask.style.height=h+"px";gPopupMask.style.width=a+"px";gPopupMask.style.top=j+"px";gPopupMask.style.left=d+"px";window.status=gPopupMask.style.top+" "+gPopupMask.style.left+" "+gi++;var b=parseInt(document.getElementById("popupTitleBar").offsetHeight,10);if(h>k){gPopupContainer.style.top=(j+((h-(k+b))/2))+"px"}if(a>e){gPopupContainer.style.left=(d+((a-e)/2))+"px"}}}addEvent(window,"resize",centerPopWin);window.onscroll=centerPopWin;function ReloadPage(){window.location.reload(true)}function hidePopWin(a){gPopupIsShown=false;restoreTabIndexes();if(gPopupMask==null){return}gPopupMask.style.display="none";gPopupContainer.style.display="none";if(a==true&&gReturnFunc!=null){gReturnFunc(window.frames.popupFrame.returnVal)}gPopFrame.src=gLoading;if(gHideSelects==true){displaySelectBoxes()}}function keyDownHandler(a){if(gPopupIsShown&&a.keyCode==9){return false}}function disableTabIndexes(){if(document.all){var a=0;for(var c=0;c<gTabbableTags.length;c++){var b=document.getElementsByTagName(gTabbableTags[c]);for(var d=0;d<b.length;d++){gTabIndexes[a]=b[d].tabIndex;b[d].tabIndex="-1";a++}}}}function restoreTabIndexes(){if(document.all){var a=0;for(var c=0;c<gTabbableTags.length;c++){var b=document.getElementsByTagName(gTabbableTags[c]);for(var d=0;d<b.length;d++){b[d].tabIndex=gTabIndexes[a];b[d].tabEnabled=true;a++}}}}function hideSelectBoxes(){for(var a=0;a<document.forms.length;a++){for(var b=0;b<document.forms[a].length;b++){if((document.forms[a].elements[b].tagName=="SELECT")||(document.forms[a].elements[b].tagName=="OBJECT")||(document.forms[a].elements[b].tagName=="EMBED")){document.forms[a].elements[b].style.visibility="hidden"}}}}function displaySelectBoxes(){for(var a=0;a<document.forms.length;a++){for(var b=0;b<document.forms[a].length;b++){if((document.forms[a].elements[b].tagName=="SELECT")||(document.forms[a].elements[b].tagName=="OBJECT")||(document.forms[a].elements[b].tagName=="EMBED")){document.forms[a].elements[b].style.visibility="visible"}}}}if(typeof(Sys)!="undefined"&&typeof(Sys.Application)!="undefined"){Sys.Application.notifyScriptLoaded()};
