var popupStatus=0;function loadPopup(){if(popupStatus==0){$("#backgroundPopup").css({"opacity":"0.7"});$("#backgroundPopup").fadeIn("slow");$("#popupWait").fadeIn("slow");$("#loginfrm").load(function(){$("#popupWait").fadeOut("slow");$("#popupWin").fadeIn("slow");});popupStatus=1;}}
function hideContent(){$("#popupWin").fadeOut("slow");}
function loadContent(){$("#popupWait").fadeIn("slow");$("#forgotfrm").load(function(){$("#popupWait").fadeOut("slow");$("#popupWin").fadeIn("slow");});}
function disablePopup(){if(popupStatus==1){$("#backgroundPopup").fadeOut("slow");$("#popupWin").fadeOut("slow");popupStatus=0;}}
function centerPopup(){var windowWidth=document.documentElement.clientWidth;var windowHeight=document.documentElement.clientHeight;var popupHeight=$("#popupWin").height();var popupWidth=$("#popupWin").width();var scrOfY=0;if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;}
var endTop=(windowHeight/2-popupHeight/2)+scrOfY;var endWait=(windowHeight/2-10)+scrOfY;$("#popupWin").css({"position":"absolute","top":endTop,"left":windowWidth/2-popupWidth/2});$("#popupWait").css({"position":"absolute","top":endWait,"left":windowWidth/2-110});$("#backgroundPopup").css({"height":windowHeight});}
$(document).ready(function(){$("#popupWinClose").click(function(){disablePopup();});$("#backgroundPopup").click(function(){disablePopup();});$(document).keyup(function(e){if(e.keyCode==27&&popupStatus==1){disablePopup();}});function setHeight(which){var div=$(which);div.css({height:div.height()});}});
