/*
	This JavaScript file shows or hides collapsible DIVs
	on the Altrux Product Map front-end page.
	
	When a user clicks a product's name, the associated
	representative's information will appear on the right.
*/

function show(divid)
{
	if(document.getElementById(divid).style.display == 'none') {
		document.getElementById(divid).style.display = 'block';
		// hide the "Click product to show rep info" paragraph
		document.getElementById("hide").style.display = 'none';
	}
}

function hide(divid)
{
	if(!document.getElementById(divid))
		return;
	if(document.getElementById(divid).style.display == 'none')
		return;
	else
		document.getElementById(divid).style.display = 'none';
}

function product(number)
{
	var i = 1;
	/*  pick some large number and loop through all divs
		with ID# equal to i, setting the display of each
		to "none" */
	for (i = 1; i <= 100; i++) {
		hide(i);
	}
	// then set the display of the passed in ID to "block"
	show(number);
}