

function SetPosition()
{ 
     
     var s=GL(document.getElementById("PageContent"));
	 var l=GT(document.getElementById("PageContent"))
  
       document.getElementById("posid").style.left=s+"px";
	   document.getElementById("posid").style.top=l+329+"px";
       var y=document.getElementById("posid").style.left;
        
        
      return true;
}
function GT(o){T=o.offsetTop;if(o.offsetParent!=null)T+=GT(o.offsetParent);return T;} 
function GL(o)
{
    
    if(o!=null)
    {
        L=o.offsetLeft;
        if(o.offsetParent!=null)
        {
            L+=GL(o.offsetParent);
        }
    
        return L;
   }
} 
function showdiv(vid)
{
    document.getElementById(vid).style.display="inline";
    
}
function hidediv(vid)
{
    document.getElementById(vid).style.display="none";
}


var lastScrollY=0;
function LoadScrollMenu()
{  
	diffY=document.documentElement.scrollTop;
//	alert("diffY:"+diffY);
	var obj=document.getElementById("scrollDiv1");
	percent=0.1*(diffY-lastScrollY); 
//	alert("percent:"+percent);
	if(percent>0)
	{
		percent=Math.ceil(percent); 
	}
	else
	{
		percent=Math.floor(percent); 
	}
	if(obj!=null)
	{   
		var t=GT(obj);
		obj.style.top=parseInt(t)+percent+"px";
//		alert(obj.style.top);
		lastScrollY=lastScrollY+percent; 
	    
	}
}


function addLoadEvent(func)
{

    var oldonload=window.onload;

    if(typeof window.onload !="function"){

    window.onload=func;

    }else{

    window.onload=function(){

    oldonload();

    func();

    }

    }

} 

addLoadEvent(LoadScrollMenu);
addLoadEvent(SetPosition);

