// JavaScript Document


var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function floatMenu(id, sx, sy)
{
	var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
	var px = document.layers ? "" : "px";
	window[id + "_obj"] = el;
	if(d.layers)el.style=el;
	el.cx = el.sx = sx;el.cy = el.sy = sy;
	
	
	el.sP=function(x,y,z){
	
	if( z <= 80) { 
	//alert("this works");
	this.style.left=x+px;this.style.top=(y+25)+px; } else {
	this.style.left=x+px;this.style.top=(y-80)+px;}; 
	}
	
	el.floatIt=function()
	
	{ 
		var pX, pY;
		pX = (this.sx >= 0) ? 0 : ns ? innerWidth : 
		document.documentElement && document.documentElement.clientWidth ? 
		document.documentElement.clientWidth : document.body.clientWidth;
		pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? 
		document.documentElement.scrollTop : document.body.scrollTop;
		if(this.sy<0) 
		pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ? 
		document.documentElement.clientHeight : document.body.clientHeight;
		
		if (navigator.appName.indexOf("Microsoft")!=-1 || navigator.userAgent.indexOf("Firefox") != -1){
		
		this.cx += (pX + this.sx - this.cx)/1;this.cy += (pY + this.sy - this.cy)/1;
		
		}  else {
		
		this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8;
		}
		
		var cz =  pY;
		this.sP(this.cx, this.cy, cz);
		setTimeout(this.id + "_obj.floatIt()",40);
				
	}
	

	
    new Effect.Opacity(el, {duration:.001, from:0, to:1}); 
	return el;
	
}
			window.onscroll = function () {
	
	if(window.onscroll != null) {
			
			//new Effect.Opacity('divTopLeft', { duration:1, transition:Effect.Transitions.linear, from:1, to:0});
	
		
		if (navigator.appName.indexOf("Microsoft")!=-1) {
		
		if (navigator.appName == 'Microsoft Internet Explorer')
		  {
  		  var ua = navigator.userAgent;
  		  var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
  			  if (re.exec(ua) != null)
    		  rv = parseFloat( RegExp.$1 );
			//  alert(rv);

		var ver = rv;
		
 	//	 alert(ver);
   		 if ( ver <= 6.0 ) 
   		   return false;  // disables the fade for ie 6.0 only
	else
	
	//return false;
	// fires the fade for IE 7
 		 new Effect.Opacity('divTopLeft', { duration:.75, transition:Effect.Transitions.linear, from:0, to:1});
		 }
	
	// now evaluate if this is firefox and eliminate fade or for all other browsers allow fade.
		 
		} else 	{ 
		
			if(navigator.userAgent.indexOf("Firefox") != -1) {
				 
			new Effect.Opacity('divTopLeft', { duration:.75, transition:Effect.Transitions.linear, from:0, to:1});   
				
			} else { new Effect.Opacity('divTopLeft', { duration:1.75, transition:Effect.Transitions.linear, from:0, to:1});    } // elimiates fade from firefox
		}
			
		}
		}
	

if (navigator.appName.indexOf("Microsoft")!=-1) {  // sets up initail positioning

floatMenu('divTopLeft', 0,40).floatIt();} else {
floatMenu('divTopLeft',0,0).floatIt();}
