
function getScrollY(){var scrOfX=0,scrOfY=0;if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset}else if(document.body&&document.body.scrollTop){scrOfY=document.body.scrollTop}else if(document.documentElement&&document.documentElement.scrollTop){scrOfY=document.documentElement.scrollTop}return scrOfY}function getScrollX(){var scrOfX=0,scrOfY=0;if(typeof(window.pageYOffset)=='number'){scrOfX=window.pageXOffset}else if(document.body&&document.body.scrollLeft){scrOfX=document.body.scrollLeft}else if(document.documentElement&&document.documentElement.scrollLeft){scrOfX=document.documentElement.scrollLeft}return scrOfX}function getPosY(e){var ev=(!e)?window.event:e;var posy;if(ev.pageY){posy=ev.pageY}else if(ev.clientY){posy=ev.clientY+getScrollY()}if(!posy){return 0}else{return posy}}function getPosX(e){var ev=(!e)?window.event:e;var posx;if(ev.pageX){posx=ev.pageX}else if(ev.clientX){posx=ev.clientX}if(!posx){return 0}else{return posx}}function getWindowHeight(){var windowHeight=0;if(typeof(window.innerHeight)=='number'){windowHeight=window.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){windowHeight=document.documentElement.clientHeight}else{if(document.body&&document.body.clientHeight){windowHeight=document.body.clientHeight}}}return windowHeight}function getWindowWidth(){var windowWidth=0;if(typeof(window.innerWidth)=='number'){windowWidth=window.innerWidth}else{if(document.documentElement&&document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth}else{if(document.body&&document.body.clientWidth){windowWidth=document.body.clientWidth}}}return windowWidth}function var_exists(variable){var query=window.location.search.substring(1);var vars=query.split("&");for(var i=0;i<vars.length;i++){var pair=vars[i].split("=");if(pair[0]==variable){return 1}}return 0}function centerContent(divID){var windowHeight=getWindowHeight();var windowWidth=getWindowWidth();var contentElement=document.getElementById(divID);if(windowHeight>0){var contentHeight=contentElement.offsetHeight;var top=((windowHeight/2)-(contentHeight/2))+getScrollY();if(((windowHeight/2)-(contentHeight/2))+getScrollY()<0){top=0}if(top<0){top=0}contentElement.style.top=top+'px'}if(windowWidth>0){var contentWidth=contentElement.offsetWidth;var left=((windowWidth/2)-(contentWidth/2));if(((windowWidth/2)-(contentWidth/2))<0){left=0}contentElement.style.left=left+'px'}}