var isNav, isIE;
var coll = "";
var styleObj = "";

//this is a list of all the menu headers
//its useful when we want to rollover a header, and the ones
//before it change
//var headerList = ["inside", "products", "services", "customers", "showcase", "partners"]
var headerList = ["products", "customers", "resources", "partners", "inside"]

if( navigator.appName == "Netscape")
	isNav = true;
else{
	isIE = true;
	coll = "all.";
	styleObj = ".style";
}
function getObject( obj ){
	var theObj;
	if(typeof obj == "string"){
		theObj = eval("document."+coll+obj+styleObj);
	}else{
		theObj = obj;
	}
	return theObj;
}


function hide( obj ){
		var theObj = getObject(obj);
		theObj.visibility = "hidden";

}


function show( obj ){
		var theObj = getObject(obj);
		theObj.visibility = "visible";
}


function place( obj, x, y ){
		if( isNav ) obj = "menuContainer.document." + obj;
		var theObj = getObject(obj);
		theObj.left = x;
		theObj.top = y;
}



//the mighty rollover effects, must handle layers for netscape
function rollOver(  imageName, imageSrc ){
		if( isNav ){
			if( layer != "" ){
				var obj = eval("document."+layer+".document");
				obj.images[imageName].src = imageSrc;
			}
			else
				document.images[imageName].src = imageSrc;
		}
		else{
			document[imageName].src = imageSrc;
		}
}


//another rollover
//this handles the way the mainmenu works
//if something is rolled over, then the previous items have to show something different
function mmRoll(imageName, imageSrc, action){

// if we have nothing selected, then we want to go over so it looks like our line extends forever
sectionFlag = 6;
rollFlag = 6;



// find the position of the section and the things we rolled over
for (var i = 0; i< headerList.length; i ++) {
	if (headerList[i] == section) {sectionFlag = i;}
	if (headerList[i] == imageName) {rollFlag = i;}
}

// set navLength to be as long as what we rolled over or selected
if (action == "out") { navLength = sectionFlag;} 
else {navLength = rollFlag;}


//alert("navLength: " + navLength);

for (var i = 0; i< headerList.length; i ++) {
	if (i < navLength) {document[headerList[i]].src = "../images/buttons/rollovers/3" + headerList[i] + ".gif";}
	if (i == navLength) {document[headerList[i]].src = "../images/buttons/rollovers/2" + headerList[i] + ".gif";}
	if (i > navLength) {document[headerList[i]].src = "../images/buttons/1" + headerList[i] + ".gif";}
}


}


//another rollover for Section Headeres
//this handles the way the mainmenu works
//if something is rolled over, then the previous items have to show something different
function mmRollToSection(){

// if we have nothing selected, then we want to go over so it looks like our line extends forever
sectionFlag = 6;
rollFlag = 6;



// find the position of the section and the things we rolled over
for (var i = 0; i< headerList.length; i ++) {
	if (headerList[i] == section) {sectionFlag = i;}
}

// set navLength to be as long as what we rolled over or selected
navLength = sectionFlag;

//alert("navLength close: " + navLength);

for (var i = 0; i< headerList.length; i ++) {
	if (i < navLength) {document[headerList[i]].src = "../images/buttons/rollovers/3" + headerList[i] + ".gif";}
	if (i == navLength) {document[headerList[i]].src = "../images/buttons/rollovers/2" + headerList[i] + ".gif";}
	if (i > navLength) {document[headerList[i]].src = "../images/buttons/1" + headerList[i] + ".gif";}
}


}

function mmRollHome(imageName, imageSrc, action){

// if we have nothing selected, then we want to go over so it looks like our line extends forever
sectionFlag = 6;
rollFlag = 6;



// find the position of the section and the things we rolled over
for (var i = 0; i< headerList.length; i ++) {
	if (headerList[i] == section) {sectionFlag = i;}
	if (headerList[i] == imageName) {rollFlag = i;}
}

// set navLength to be as long as what we rolled over or selected
if (action == "out") {navLength = sectionFlag;} 
else {navLength = rollFlag;}


for (var i = 0; i< headerList.length; i ++) {
	if (i < navLength) {document[headerList[i]].src = "images/buttons/rollovers/3" + headerList[i] + ".gif";}
	if (i == navLength) {document[headerList[i]].src = "images/buttons/rollovers/2" + headerList[i] + ".gif";}
	if (i > navLength) {document[headerList[i]].src = "images/buttons/1" + headerList[i] + ".gif";}
}


}



function parseWhiteSpace( string ){
	temp = new String();
	temp = "";
	for( var i = 0; i <= string.length; i++ ){
		if( string.charAt( i ) != " " ){
			temp += string.charAt(i)
		}
	}
	return temp;
}

function header(name, link){
		this.name = name;
		this.link = link;
}
	
function getSubmenu(){
		var temp = this.submenu;
		temp = temp.toString();
		return temp;
}



function header(name, link){
		this.name = name;
		this.link = link;
}
	
function subMenu(name, links, labels){
		tempLinks = new Array();
		tempLabels = new Array();
		tempLinks = links.split(";");
		tempLabels = labels.split(";");
		
		this.name = name;
		this.links = tempLinks;
		this.labels = tempLabels;
}

function hideMenu( obj ){
		if( isNav ) obj = "menuContainer.document." + obj;
		var theObj = getObject(obj);
		theObj.visibility = "hidden";

	}
	
function hideSubMenu( obj ){
		obj = obj + "Layer";
		var theObj = getObject(obj);
		theObj.visibility = "hidden";

	}

var currentSubMenu = "inside";
	
function showSubMenu( obj ){
	currentSubMenu = obj;
	obj = obj + "Layer";
	if( currentSubMenu != "")
	hideSubMenu( currentSubMenu );
	show (obj);
	}


var shotClock;
	function timerOn(){
	if( currentSubMenu != "")
	shotClock = setTimeout("hideSubMenu( currentSubMenu )", 5000);
	}
	
	function timerOff(){
	clearTimeout(shotClock);
	}
	
function resize(){
//document.location = document.location
}
