/*******************/
/** Pre-load Navs **/
/*******************/
aboutNav1off = new Image(112,23);
aboutNav1on = new Image(112,20);
aboutNav2off = new Image(112,20);
aboutNav2on = new Image(112,20);
aboutNav3off = new Image(112,20);
aboutNav3on = new Image(112,20);
aboutNav4off = new Image(112,20);
aboutNav4on = new Image(112,20);
aboutNav5off = new Image(112,20);
aboutNav5on = new Image(112,20);
aboutNav6off = new Image(112,20);
aboutNav6on = new Image(112,20);

productsNav1off = new Image(112,23);
productsNav1on = new Image(112,20);
productsNav2off = new Image(112,20);
productsNav2on = new Image(112,20);
productsNav3off = new Image(112,20);
productsNav3on = new Image(112,20);
productsNav4off = new Image(112,20);
productsNav4on = new Image(112,20);
productsNav5off = new Image(112,20);
productsNav5on = new Image(112,20);

contactsNav1off = new Image(112,23);
contactsNav1on = new Image(112,20);
contactsNav2off = new Image(112,20);
contactsNav2on = new Image(112,20);
contactsNav3off = new Image(112,20);
contactsNav3on = new Image(112,20);

technicalNav1off = new Image(112,23);
technicalNav1on = new Image(112,20);
technicalNav2off = new Image(112,20);
technicalNav2on = new Image(112,20);
technicalNav3off = new Image(112,20);
technicalNav3on = new Image(112,20);
technicalNav4off = new Image(112,20);
technicalNav4on = new Image(112,20);
technicalNav5off = new Image(112,20);
technicalNav5on = new Image(112,20);

aboutNav1off.src = "graphics/top_nav_aboutus.gif";
aboutNav1on.src = "graphics/top_nav_aboutus_rollover.gif";
aboutNav2off.src = "graphics/about_us_1_our_story.gif";
aboutNav2on.src = "graphics/about_us_1_our_story_rollover.gif";
aboutNav3off.src = "graphics/about_us_2_our_team.gif";
aboutNav3on.src = "graphics/about_us_2_our_team_rollover.gif";
aboutNav4off.src = "graphics/about_us_3_our_partnerships.gif";
aboutNav4on.src = "graphics/about_us_3_our_partnerships_rollover.gif";
aboutNav5off.src = "graphics/about_us_5_our_process.gif";
aboutNav5on.src = "graphics/about_us_5_our_process_rollover.gif";
aboutNav6off.src = "graphics/about_us_4_history_timeline.gif";
aboutNav6on.src = "graphics/about_us_4_history_timeline_rollover.gif";


productsNav1off.src = "graphics/top_nav_products.gif";
productsNav1on.src = "graphics/top_nav_products_rollover.gif";
productsNav2off.src = "graphics/products_1_graphite_electrodes.gif";
productsNav2on.src = "graphics/products_1_graphite_electrodes_rollover.gif";
productsNav3off.src = "graphics/products_2_bulk_products.gif";
productsNav3on.src = "graphics/products_2_bulk_products_rollover.gif";
productsNav4off.src = "graphics/products_3_granular.gif";
productsNav4on.src = "graphics/products_3_granular_rollover.gif";
productsNav5off.src = "graphics/products_4_green.gif";
productsNav5on.src = "graphics/products_4_green_rollover.gif";

contactsNav1off.src = "graphics/top_nav_contacts.gif";
contactsNav1on.src = "graphics/top_nav_contacts_rollover.gif";
contactsNav2off.src = "graphics/contacts_1_quote_request.gif";
contactsNav2on.src = "graphics/contacts_1_quote_request_rollover.gif";
contactsNav3off.src = "graphics/contacts_2_company_contacts.gif";
contactsNav3on.src = "graphics/contacts_2_company_contacts_rollover.gif";

technicalNav1off.src = "graphics/top_nav_technical.gif";
technicalNav1on.src = "graphics/top_nav_technical_rollover.gif";
technicalNav2off.src = "graphics/technical_1_troubleshooting.gif";
technicalNav2on.src = "graphics/technical_1_troubleshooting_rollover.gif";
//technicalNav3off.src = "graphics/technical_2_models.gif";
//technicalNav3on.src = "graphics/technical_2_models_rollover.gif";
technicalNav3off.src = "graphics/technical_3_service.gif";
technicalNav3on.src = "graphics/technical_3_service_rollover.gif";
technicalNav4off.src = "graphics/technical_4_specifications.gif";
technicalNav4on.src = "graphics/technical_4_specifications_rollover.gif";
technicalNav5off.src = "graphics/technical_5_quality.gif";
technicalNav5on.src = "graphics/technical_5_quality_rollover.gif";

/**********************/
/** Global Variables **/
/**********************/

var selected = new Array();

count = 0;
while(count <10){
selected[count] = false;
count++;
}

/******************************************************/
/**                Method rollon_a()                 **/
/******************************************************/
/**  This method displays the "selected" navigation  **/
/**  images as the mouse is rolled onto the image    **/
/**  and displays the dropdown menu                  **/
/******************************************************/
function rollon_a(imgName, divToShow){
    document[imgName].src = eval(imgName + "on.src");
	document.getElementById(divToShow).style.visibility = "visible";
}


/****************************************************/
/**               Method rolloff_a()               **/
/****************************************************/
/**  This method displays the "normal" navigation  **/
/**  images as the mouse is rolled off the image   **/
/**  and hides the dropdown menu
/****************************************************/
function rolloff_a(imgName, divToShow){
	document.getElementById(divToShow).style.visibility = "hidden";
    document[imgName].src = eval(imgName + "off.src");

}

/*************************************************/
/** Dummy function; used to make links inactive **/
/** during testing                              **/
/*************************************************/



/****************************************************/
/**                Method rollon()                 **/
/****************************************************/
/** This method displays the "selected" navigation **/
/** images as the mouse is rolled onto the image   **/
/****************************************************/
function rollon(imgName, imgName2, divToShow){
    document[imgName2].src = eval(imgName2 + "on.src");
	document.getElementById(divToShow).style.visibility = "visible";
    document[imgName].src = eval(imgName + "on.src");
}


/**************************************************/
/**               Method rolloff()               **/
/**************************************************/
/** This method displays the "normal" navigation **/
/** images as the mouse is rolled off the image  **/
/**************************************************/
function rolloff(imgName, imgName2, divToShow){
    document[imgName].src = eval(imgName + "off.src");
	document.getElementById(divToShow).style.visibility = "hidden";
	document[imgName2].src = eval(imgName2 + "off.src");
}

/********************************************************/
/**                Method rollonText()                 **/
/********************************************************/
/**   This method changes the color of the "selected"  **/
/**   navigation text as the mouse is rolled           **/
/**   onto the text                                    **/
/********************************************************/
function rollonText(textButton){
	document.getElementById(textButton).style.color = "#FFCC00";
}

/******************************************************/
/**               Method rolloffText()               **/
/******************************************************/
/**   This method changes the color of the "normal"  **/
/**   navigation text as the mouse is rolled         **/
/**   off of the text                                **/
/******************************************************/
function rolloffText(textButton, number){
	if(!selected[number]){
 	document.getElementById(textButton).style.color = "#ED6227";
	}
}

/********************************************************/
/**                 Method clickText()                 **/
/********************************************************/
/**   This method changes the color of the "selected"  **/
/**   navigation text as the mouse is rolled           **/
/**   onto the text and makes the proper specification **/
/**   table display on the page                        **
/********************************************************/
function clickText(textButton, tableToShow, number){

	// Reset flags and colors for the text buttons
	count = 0;
	while(count < selected.length){
		if(selected[count] == true){
			selected[count] = false;
			priorTextButton = "textNav"+count;
			priorTable = "specTable"+count;
			document.getElementById(priorTextButton).style.color = "#ED6227";
			document.getElementById(priorTable).style.visibility = "hidden";
		}
	count++;
	}
	// Set the correct flag for the clicked text
	selected[number] = true;
	// Set the clicked text to the proper text color
	document.getElementById(textButton).style.color = "#FFCC00";
	
	document.getElementById(tableToShow).style.visibility = "visible";
}

/*************************************************/
/** Dummy function; used to make links inactive **/
/** during testing                              **/
/*************************************************/
function doNothing(){}
