var intMenuPaddingTopInit = 0;
var intOffsetTop = 110;
var intMenuPaddingTopPrev = intMenuPaddingTopInit;

window.onload = function() 
{
   resize(); movemenu();
}

window.onresize = function() 
{
   resize();
}

function movemenu()
{
   if (window.innerHeight)
      intScrollY = window.pageYOffset  
   else if (document.documentElement && document.documentElement.scrollTop)
		   intScrollY = document.documentElement.scrollTop
		else if (document.body)
			    intScrollY = document.body.scrollTop;	
	
   if (intScrollY < intMenuPaddingTopInit) 
	  intMenuPaddingTop = intMenuPaddingTopInit
   else 
	  if (intScrollY > intOffsetTop)
	     intMenuPaddingTop = intScrollY + intMenuPaddingTopInit - intOffsetTop
	  else
	     intMenuPaddingTop = intMenuPaddingTopInit;	 
	  
   if (intMenuPaddingTop == intMenuPaddingTopPrev)	   
      document.getElementById('menu').style.paddingTop = intMenuPaddingTop + 'px';
   
   intMenuPaddingTopPrev = intMenuPaddingTop;
   temp = setTimeout('movemenu()', 50);	
}

function resize()
{  
   var frame = document.getElementById("frame");  
   
   var intHtmlheight = document.getElementById("frame").offsetHeight;
   var intWindowheight = 0;
   if ( typeof( window.innerWidth ) == 'number' ) 
      intWindowheight = window.innerHeight
   else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
    	   intWindowheight = document.documentElement.clientHeight
	    else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
    		    intWindowheight = document.body.clientHeight;
   
   if ( intHtmlheight < intWindowheight ) 
   { 
      intWindowheight += 5;
	  document.body.style.height = intWindowheight + "px"; 
	  frame.style.height = intWindowheight + "px"; 
   }  
   else 
   { 
      document.body.style.height = intHtmlheight + "px"; 
	  frame.style.height = intHtmlheight + "px"; 
   }  
} 

