

var n, ie, ns6; // browserCheck variables
var floatOffset, iw; // floatCheck variables
var hideLock = 0;
var homeOffset = -60;
		
function init() {
	windowPreset();
	browserCheck();
	floatCheck();
	hideAll();
}
		
function windowPreset() { // used for floatCheck
	if (n || ns6) iw = window.innerWidth;
	else if (ie) iw = document.body.clientWidth;
}

if(document.layers) document.captureEvents(Event.MOUSEMOVE);
	document.onmousemove=newPos;

function newPos(e){
	X=(navigator.appName.indexOf("Microsoft")!=-1)?(event.clientX + document.body.scrollLeft):e.pageX;
	Y=(navigator.appName.indexOf("Microsoft")!=-1)?(event.clientY + document.body.scrollTop):e.pageY;
	// if ((X < (floatOffset + homeOffset + 49) || X > (floatOffset + 900)) && (hideLock == 1)) {
	if (X < (floatOffset + homeOffset + 49) || X > (floatOffset + 900) || (Y < 0) || Y > 300) {
		hideAll();
		// hideLock = 0;
	}
}
		
function linkOn() {
	hideLock=1;
}
			
function browserCheck() {
	if (document.layers) {
		ns6=0; n=1; ie=0;
	}
	else if (document.all) {
		ns6=0; n=0; ie=1;
	}
	else {
		if (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 5) {
			ns6=1; n=0; ie=0;
		}
	}
}
			
function floatCheck() { // this recalculates the correct position of a floating layer in a centered layout.
	tableWidth = 900; // width of table containing content
	if (n || ns6) {
		if (window.innerWidth > tableWidth) floatOffset = ((window.innerWidth - tableWidth)/ 2) - 8; // -8 is a browser spacing correction
		else floatOffset = 0;
	}
	else if (ie) {
		if (document.body.clientWidth > tableWidth) floatOffset = ((document.body.clientWidth - tableWidth)/ 2);
		else floatOffset = 0;
	}
	if (floatOffset < 0) floatOffset = 0;
		floatOffset = Math.ceil(floatOffset);
}
				
function setIdProperty( id, property, value ) { // used for ns6 actions
	var styleObject = document.getElementById( id );
	if (styleObject != null) {
		styleObject = styleObject.style;
		styleObject[ property ] = value;
	}
}
		
function layerOn(divName, horizPos) {
	hideAll();
	floatCheck();
	if (n) {
		document.eval(divName).left = floatOffset + horizPos;
		// divName.left = floatOffset + horizPos;
		document.eval(divName).visibility = "show";
	}
	if (ie) {
		eval(divName).style.left = floatOffset + horizPos;
		// divName.left = floatOffset + horizPos;
		eval(divName).style.visibility = "visible";
	}
	if (ns6) {
		setIdProperty(divName, "left", floatOffset + horizPos);
		setIdProperty(divName, "visibility", "visible");
	}
}
		
function layerHide(divName) {
	if (n) document.eval(divName).visibility = "hide";
	if (ie) eval(divName).style.visibility = "hidden";
	if (ns6) setIdProperty(divName, "visibility", "hidden");
}
		
function hideAll() {
	layerHide("IndustriesDiv");
	layerHide("ProductsDiv");
	layerHide("AboutDiv");
	layerHide("NewsDiv");
	layerHide("SupportDiv");
	layerHide("ContactDiv");

	return;
}
		
topNavs = new Array();
		
function topConst(imgPath) {
	x = topNavs.length;
	topNavs[x] = new Image();
	topNavs[x].src = imgPath;
}
