﻿// JScript File

obPage={};
obZ={};
obPage.Init=function()
{
	var bwTyp=this;
	var uAgnt=navigator.userAgent;
	bwTyp.isIE=(uAgnt.indexOf("MSIE")>0);
	bwTyp.isMac=(uAgnt.indexOf("Mac")>0);
	bwTyp.isNS=(uAgnt.indexOf("Gecko")>0);
	bwTyp.isOpera=(window.opera||uAgnt.indexOf("Opera")>0);
	bwTyp.isSafari=(uAgnt.indexOf("Safari")>0);
}
obZ.Init=function()
{
	var bwTyp=this;
	var uAgnt=navigator.userAgent;
	bwTyp.isIE=(uAgnt.indexOf("MSIE")>0);
	bwTyp.isMac=(uAgnt.indexOf("Mac")>0);
	bwTyp.isNS=(uAgnt.indexOf("Gecko")>0);
	bwTyp.isOpera=(window.opera||uAgnt.indexOf("Opera")>0);
	bwTyp.isSafari=(uAgnt.indexOf("Safari")>0);
}

obPage.Init();
obZ.Init();
//obPage.bodyHeight=function(win){win=win?win:window; return parseInt(obPage.isIE?win.document.body.clientHeight:win.innerHeight)};

obPage.bodyHeight=function(win)
{
    win=win?win:window; 
    return parseInt(window.document.body.clientHeight);
    
};

obZ.bodyHeight=function(win){win=win?win:window; return parseInt(obZ.isIE?win.document.body.clientHeight:win.innerHeight)};
obZ.scrollTop=function(win){win=win?win:window; return obZ.isIE?win.document.body.scrollTop :win.pageYOffset};
obZ.scrollLeft=function(win){win=win?win:window; return obZ.isIE?win.document.body.scrollLeft:win.pageXOffset};


obPage.getGlobalY=function(tImg)
{
	var tObj = this;
	var result=0;    
    if (tObj.isIE)
    {
        while(tImg)
        {               
	        result+=tImg.offsetTop;	   	       
		    if(tImg.scrollTop)
		    {
		        
		        result-=tImg.scrollTop;		    
		    }
            tImg=tImg.offsetParent;                        
        }
    }

    else
    {
		while(tImg)
		{ 		    
		    result+=tImg.offsetTop; 	
			if(tImg.scrollTop && tImg.scrollTop != tImg.offsetTop)
			{			    
			    result -= tImg.scrollTop;			
			}			
			tImg=tImg.offsetParent;						
	    }
    }
    return result;
 }
    obZ.getGlobalY=function(tImg)
    {    
	    var tObj = this;
	    var result=0;
	    if (tObj.isOpera)
	    {
		    while(tImg)
		    {
			    result+=tImg.offsetTop;
    			if(tImg.scrollTop && tImg.scrollTop != tImg.offsetTop)result -= tImg.scrollTop;
				tImg=tImg.offsetParent;
	    	}
	    }
	    else
	    {
		    while(tImg)
		    {
			    result+=tImg.offsetTop;
			    if(tImg.scrollTop)result-=tImg.scrollTop;
				tImg=tImg.offsetParent;
		    }
	    }	 	    
	    return result;
}