
var theTop = 150;
var old = theTop;
var temp
function movemenu()
{
	menu = document.getElementById('popboxid');
	ws   = document.getElementById('bigdivid');
	
	if (window.innerHeight)
	{
		pos = window.pageYOffset
	}
	else if (document.documentElement && document.documentElement.scrollTop)
	{
		pos = document.documentElement.scrollTop
	}
	else if (document.body)
	{
		pos = document.body.scrollTop
	}
	if (pos < theTop) {
	    pos = theTop;
    } else {
        pos += 100;  
    } 
	//if (pos == old)
	//{
		menu.style.top = pos + "px";
		//ws.style.top = pos + "px";
		
	//}
	old = pos;
	temp = setTimeout('movemenu()',50);
}


function popit(id){
      var mydiv = document.getElementById(id);
      var x,y;
      
      if (self.innerHeight) // all except Explorer
      {
      	x = self.innerWidth;
      	y = self.innerHeight;
      }
      else if (document.documentElement && document.documentElement.clientHeight)
      	// Explorer 6 Strict Mode
      {
      	x = document.documentElement.clientWidth;
      	y = document.documentElement.clientHeight;
      }
      else if (document.body) // other Explorers
      {
      	x = document.body.clientWidth;
      	y = document.body.clientHeight;
      }
          
      if(mydiv){
         var mybody     = document.getElementsByTagName('body')[0];
         // big div
         var otherdiv          = document.createElement('div');
         otherdiv.innerHTML    = '&nbsp;';
         otherdiv.className    = 'bigdiv';   
         otherdiv.id           = 'bigdivid';
         //otherdiv.style.position = 'fixed'
         otherdiv.style.zIndex = 9998;        
         otherdiv.style.top    = 0
         otherdiv.style.left   = 0
         otherdiv.style.width  = x+'px';
         otherdiv.style.height = (y*2)+'px';
         otherdiv.onclick      = function () { hidebox()}
         mybody.appendChild(otherdiv);
         
         // story div
         var newdiv          = document.createElement('div');
         var closeme         = "<p><a href=\"#\" onclick='hidebox();'>Click here to close this window</a></p>"
         newdiv.innerHTML    = mydiv.innerHTML + closeme;
         newdiv.className    = 'popbox';   
         newdiv.id           = 'popboxid'      ;
         newdiv.style.zIndex = 9999;
         var nheight         = 300
         var nwidth          = 300;       
         c_top               = (y/2) - (nheight/2);
         c_left              = (x/2) - (nwidth/2);
         newdiv.style.top    = c_top + 'px';
         newdiv.style.left   = c_left + 'px';
         //newdiv.style.position = 'fixed';
         mybody.appendChild(newdiv);
		 movemenu();
      }
   }
   function hidebox(){
      var mybody = document.getElementsByTagName('body')[0];
      mybody.removeChild(document.getElementById('bigdivid'));
      mybody.removeChild(document.getElementById('popboxid'));
      //mybody.removeChild(document.getElementById('holdme'));
		window.clearTimeout(temp);
      return false;
   }

	
//}



