﻿// JScript File
var bodyheight;

/* page dimensions */
function pageWidth() {return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;} 
function pageHeight() {return  window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;} 
function posLeft() {return typeof window.pageXOffset != 'undefined' ? window.pageXOffset :document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0;} 
function posTop() {return typeof window.pageYOffset != 'undefined' ?  window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0;} 
function posRight() {return posLeft()+pageWidth();} 
function posBottom() {return posTop()+pageHeight();}

/* ======= window sizer */

        function SetPage() {
            var headerheight;
            var footerheight;
            
            headerheight = 50;
            footerheight = 80;
            bodyheight = pageHeight() - footerheight - 4;
            
            $("#HEIGHTADJUST1").attr("style","height:" + bodyheight + "px;");
            $("#HEIGHTADJUST2").attr("style","margin:3px 3px 3px 3px;overflow-y:scroll;" + "height:" + (bodyheight-footerheight-70) + "px;")
            
        }

        var xScroll, yScroll, timerPoll, timerRedirect, timerClock,_clock;
        function initRedirect(){
          if (typeof document.body.scrollTop != "undefined"){ //IE,NS7,Moz
            xScroll = document.body.scrollLeft;
            yScroll = document.body.scrollTop;
            clearInterval(timerPoll); //stop polling scroll move
            timerPoll = setInterval("SetPage()",100); //poll scrolling
          }
          else if (typeof window.pageYOffset != "undefined"){ //other browsers that support pageYOffset/pageXOffset instead
            xScroll = window.pageXOffset;
            yScroll = window.pageYOffset;
            clearInterval(timerPoll); // stop polling scroll move
            timerPoll = setInterval("SetPage()",100); //poll scrolling
            }
        }

        function pollActivity(){
          if ((typeof document.body.scrollTop != "undefined" && (xScroll!=document.body.scrollLeft || yScroll!=document.body.scrollTop)) //IE/NS7/Moz
           ||
           (typeof window.pageYOffset != "undefined" && (xScroll!=window.pageXOffset || yScroll!=window.pageYOffset))) { //other browsers
              SetPage(); //reset polling scroll position
          }
        }
        
        window.onresize=initRedirect;

/* =======      general */


        function ConfirmBox(url,msg){
	        var conf = confirm(msg + "\n" + url); 
	        if(conf){
		        window.location.href = url; 
	        }
        }
        
function overlayclose(subobj){
            document.getElementById(subobj).style.display="none"
            RemoveBackground();
            document.getElementById(subobj).setAttribute("src","/frame1.htm")
        }