
var menuNames = new 
Array('queries', 'maintenance', 'subscriptions','help','services');
var menuWidths = new Array(100,100,100,100,100);
var IE = document.all;
var NN4 = document.layers;
var compatable = (IE || parseInt(navigator.appVersion) > 4);
var showingmenu = false;


function changeBox(Lid, htm) {
	
	if (document.all) {
			document.all(Lid).innerHTML = htm;
	}
	else if (document.layers) {
		with(document.layers[Lid].document) {
			open();
			write(htm);
			close();
		}
	}
	else {
		document.getElementById(Lid).innerHTML = htm;
	}
		
}

function getWidth() {
	var w;
	if (IE) { w = document.body.clientWidth; }
	else { w = window.innerWidth; }
	return(w);	
}

function getHeight() {
	var w;
	if (IE) { w = document.body.clientHeight; }
	else { w = window.innerHeight; }
	return(w);	
}

function changeFloat(htm, ev) {
     
 	if (htm) { htm = "<table cellspacing=\"0\" cellpadding=\"1\" style=\"border: 1px solid #958a6a;\" bgcolor=\"#f3ebcf\"><tr><td valign=\"top\" class=w>" + htm + "</td></tr></table>"; }
 	vis = htm ? "visible" : "hidden";
 
 	evx = 0;
 	evy = 0;
 	// By default, put it to the right, and above the mouse
 	xbuff = 40;
 	ybuff = -20;
 	
 	// Get offset
 	if (document.all) {
 		offY = document.body.scrollTop;
 	} else {
 		offY = window.pageYOffset;	
 	}
 	
 	if ((document.all || document.layers) && event) {
 		evx = event.x;	
 		evy = event.y; 
 	}
 	else if (ev) {
 		evx = ev.pageX;
 		evy = ev.pageY;
 	}
 	
 	// Position if too far
 	// The windows are like 300 wide, so if the evx is > width - 300
	if (evx > getWidth() - 300) {
		xbuff = -350;	
	}
	// If the mouse is too far down, push the popup up the difference about 250 px
	if (evy > getHeight() - 200) {
		ybuff = -200 - (100 - (getHeight() - evy));
	}
	//alert("Mouse is at: "+ evx + "," + evy);

	changeBox('floatBox',htm);

 	if (document.all) {
 		document.all('floatBox').style.visibility = vis;
 		document.all('floatBox').style.top = evy + ybuff + offY;
 		document.all('floatBox').style.left = evx + xbuff;
 		//alert("Layer top is at: " + (evy + ybuff))
 	}
 	else if (document.layers) {
 		document.layers['floatBox'].style.visibility = vis;
     	document.layers['floatBox'].style.top = evy + offY;
     	document.layers['floatBox'].style.left = evx + xbuff;
 	}
 	else if (ev) {
 		document.getElementById('floatBox').style.visibility = vis;
 		document.getElementById('floatBox').style.top = ev.pageY + ybuff + offY;
 		document.getElementById('floatBox').style.left = ev.pageX + xbuff;
 	}
}





