/* ----------
	CodeBank - textlayer.js

	This code uses CSS to display a text message when the user rolls over an image.

    Revisions to Included File:
        The text to be displayed in the rollover must be placed in the file where it is to be displayed.
		The text must be wrapped in a DIV tag that starts with ro_
		If this text is custom formatted, change the CSS to reflect that.


    Revisions to This File:
		2001 01 03 - Added support for Mozilla

    General Revisions:
---------- */

LastTimerID = 0;
LastDivision = 0;
HideMenuExecute = 0;

function ShowDivision(divDisplay) {
	// Perform a simple browser check
	UsingNetscape = (document.layers) ? true : false;
	UsingIE = (document.all) ? true : false;

	if (UsingNetscape) {
		Division = document.layers[divDisplay];
		Division.visibility = "show";
		Division.zIndex = 50;
		return;
	} else if (UsingIE) {
		Division = document.all[divDisplay];
		Division.style.visibility = "visible";
		Division.style.zIndex = 50;
		return;
	} else if (document.getElementById(divDisplay)) {
	    Division = document.getElementById(divDisplay);
		Division.style.visibility = "visible";
		Division.style.zIndex = 50;
		return;
	}
}

function EnterMenu(divDisplay) {
	UsingNetscape = (document.layers) ? true : false;
	UsingIE = (document.all) ? true : false;

	if (UsingNetscape) {
		NewDivision = document.layers[divDisplay];
	} else if (UsingIE) {
		NewDivision = document.all[divDisplay];
	} else if (document.getElementById(divDisplay)) {
	    NewDivision = document.getElementById(divDisplay);
	}

	if (LastDivision != 0) {
		if (LastDivision == NewDivision) {
			clearTimeout(LastTimerID);
		} else {
			if (HideMenuExecute != 0) {
				eval(HideMenuExecute);
			}

			if (UsingNetscape) {
				LastDivision.zIndex = 10;
			} else {
				LastDivision.style.zIndex = 10;
			}
		}
	}

	LastDivision = NewDivision;
	ShowDivision(divDisplay);
}

function LeaveMenu(divDisplay) {
    // alert(imgID);
	HideMenuExecute = "HideDivision('" + divDisplay + "');";

	LastTimerID = setTimeout(HideMenuExecute, 500);
}

function HideDivision(divDisplay) {
	// Perform a simple browser check
	UsingNetscape = (document.layers) ? true : false;
	UsingIE = (document.all) ? true : false;

    // alert("HideDivision entered.");

	if (UsingNetscape) {
		Division = document.layers[divDisplay];
		Division.visibility = "hide";
		return;
	} else if (UsingIE) {
		Division = document.all[divDisplay];
		Division.style.visibility = "hidden";
		return;
	} else if (document.getElementById(divDisplay)) {
	    Division = document.getElementById(divDisplay);
		Division.style.visibility = "hidden";
		return;
	}
}

function moveMenus() {
	// this script is for Moz only, to properly align the dropMenus
	
	if(!document.all) {
		documentLeft = document.width;
		
		if(documentLeft > 692) {
			documentLeft = documentLeft - 690;
			documentLeft = documentLeft / 2;
		} else {
			documentLeft = 35;
		}
		
		solutionsOffset = 382;
		clientsOffset = 458;
		companyOffset = 521;
			
		document.getElementById('divSolutions').style.left = (documentLeft + solutionsOffset) + "px";
		document.getElementById('divClients').style.left = (documentLeft + clientsOffset) + "px";
		document.getElementById('divCompany').style.left = (documentLeft + companyOffset) + "px";
	}
}
