  /*
  Floating Menu script-  Roy Whittle (http://www.javascript-fx.com/)
  Script featured on/available at http://www.dynamicdrive.com/
  This notice must stay intact for use
  */
  
  //Enter "frombottom" or "fromtop"
  var verticalpos="frombottom"
  
  function calculateX()
  {
    var myWidth = 0, calcX = 0, newWidth = 0;
    if( typeof( window.innerWidth ) == 'number' ) 
    {
      //Non-IE
      myWidth = window.innerWidth;
    }
    else if( document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight) )
    {
      //IE 6+ in 'standards compliant mode'
      myWidth = document.documentElement.clientWidth;
    }
    else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
    {
      //IE 4 compatible
      myWidth = document.body.clientWidth;
    }
    if (myWidth <= 800)
      calcX = 0;
    else
    {
      newWidth = myWidth/2;
      // 390 is half the maintable (780)
      calcX = newWidth - 390;
    }
    return calcX;
  }
  
  function JSFX_FloatTopDiv()
  {
    //var startX = 239;
    var startX = calculateX();
    var startY = 30;
  	var ns = (navigator.appName.indexOf("Netscape") != -1);
  	if (ns) 
  	{
  	  startX = 0;
  	  //startY = 49;
  	}
  	var d = document;
  	
  	function ml(id)
  	{
  		var el = d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
  		if(d.layers) el.style=el;
  		el.sP = function(x,y)
  		{
  		  this.style.left=x;
  		  this.style.top=y;
  		}
  		el.x = startX;
  		if (verticalpos=="fromtop")
  		  el.y = startY;
  		else
  		{
  		  el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
  		  el.y -= startY;
  		}
  		//alert(el.x);
  		//alert(el.y);
  		return el;
  	}
  	
  	window.stayTopLeft=function()
  	{
  		if (verticalpos=="fromtop")
  		{
  		  var pY = ns ? pageYOffset : document.body.scrollTop;
  		  ftlObj.y += (pY + startY - ftlObj.y)/8;
  		}
  		else
  		{
  		  var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
  		  ftlObj.y += (pY - startY - ftlObj.y)/8;
  		}
  		ftlObj.sP(ftlObj.x, ftlObj.y);
  		setTimeout("stayTopLeft()", 10);
  	}
  	ftlObj = ml("divStayTopLeft");
  	stayTopLeft();
  }
  
  function calcFlashPosition(id)
  {
    var myWidth  = 0, calcX = 0, newWidth = 0;
  	var d = document;
		var flashobj = d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
 		if(d.layers) flashobj.style=flashobj;

    if( typeof( window.innerWidth ) == 'number' ) 
    {
      //Non-IE
      flashobj.style.top = '1px';
    }
    else if( d.documentElement && (d.documentElement.clientWidth || d.documentElement.clientHeight) )
    {
      //IE 6+ in 'standards compliant mode'
      //alert('IE 6+');
      flashobj.style.top = '-17px';
    }
    else if( d.body && ( d.body.clientWidth || d.body.clientHeight ) )
    {
      //IE 4 compatible
      flashobj.style.top = '-17px';
    }
  }