﻿var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
var px = document.layers ? "" : "px";

function JSFX_FloatDiv(id, sx, sy)
{
      var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
      window[id + "_obj"] = el;
      if(d.layers)el.style=el;
      el.cx = el.sx = sx;el.cy = el.sy = sy;
      el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px;};
      el.flt=function()
      {
            var pX, pY;
            pX = (this.sx >= 0) ? 0 : ns ? innerWidth : 
            document.documentElement && document.documentElement.clientWidth ? 
            document.documentElement.clientWidth : document.body.clientWidth;
            pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? 
            document.documentElement.scrollTop : document.body.scrollTop;
            if(this.sy<0) 
            pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ? 
            document.documentElement.clientHeight : document.body.clientHeight;
            this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8;
            this.sP(this.cx, this.cy);
            setTimeout(this.id + "_obj.flt()", 0);
      }
      return el;
}

function setSize()
{ 
    var popW = 300, popH = 200;
    popW = document.getElementById("divPrgs").style.width;
    popH = document.getElementById("divPrgs").style.height;
   
    if (document.all) 
    {
       /* the following is only available after onLoad */
       w = document.body.clientWidth;
       h = document.body.clientHeight;
    }
    else if (document.layers) 
    {
       w = window.innerWidth;
       h = window.innerHeight;
    }
    var leftPos = (w-popW)/2 - popW, topPos = (h-popH)/2 - popH;
    if( document.getElementById("divPrgs") != null)
    {
        document.getElementById("divPrgs").style.left =parseInt(leftPos) ;
        document.getElementById("divPrgs").style.top = parseInt(topPos) ;
        //document.getElementById("divPrgs").style.top = "0px";
        //document.getElementById("divPrgs").style.left = "0px";
        alert(document.getElementById("divPrgs").style.left);
        alert(document.getElementById("divPrgs").style.top);
    }
    
     if( document.getElementById("divBackgrd") != null)
    {
        document.getElementById("divBackgrd").style.width = w;
        document.getElementById("divBackgrd").style.height = h;
    }
}



  /* find browser window size */
function browserWindow () {
	width = 0
	height = 0;
	if (document.documentElement) {
		width = document.documentElement.offsetWidth;
		height = document.documentElement.offsetHeight;
	} else if (window.innerWidth && window.innerHeight) {
		width = window.innerWidth;
		height = window.innerHeight;
	}
	return [width, height];
}
/* find total page height */
function getScrollXY() {
	scrOfX = 0; 
	scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	}
		totalY = (window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ?       document.documentElement.clientHeight : document.body != null ? document.body.clientHeight : null);

		totalX = (window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ?       document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null);
	return [ scrOfX, scrOfY, totalY, totalX ];
}
function movescroll()
{
    window.scrollTo(0,60)
}


