var opened = false;
var canhide = false;
var items = new Array;

//items[] = '[text_of_link]_separator_[url_of_page]';
items[0] = 'Hydraulic_separator_hydraulic.asp';
items[1] = 'Pneumatic_separator_pneumatic.asp';
items[2] = 'Mechanical_separator_mechanical.asp';
items[3] = 'Electric_separator_electric.asp';
items[4] = 'Lubrication_separator_lubrication.asp';
items[5] = 'Safety/Rigging_separator_safety.asp';
items[6] = 'General Supplies_separator_general.asp';

var div_height = (items.length * 20) + 18;

function show()
{
	i = 0;
	while (items[i]) {
		m = items[i].split('_separator_');
		document.write('<div class="sub_item" onmouseover="this.style.backgroundColor=\'#FFEEA9\'; vis();" onmouseout="this.style.backgroundColor=\'#FDCD01\'; hide();"><a href="' + m[1] + '">' + m[0] + '</a></div>');
		i++;
	}
}

function vis(from)
{
	canhide = false;
	if (!opened) {
		if (!parseInt(document.getElementById('sub_prod').style.height)) {
			document.getElementById('sub_prod').style.height = '0px';
		}
		if (parseInt(document.getElementById('sub_prod').style.height) < div_height) {
			document.getElementById('sub_prod').style.height = (parseInt(document.getElementById('sub_prod').style.height) + 8) + 'px';
			setTimeout('vis(1)', 10);
		}else{
			opened = true;
		}
	}
}

function hide()
{
	canhide = true;
	setTimeout('hid()', 100);
}

function hid()
{
	if (canhide) {
		document.getElementById('sub_prod').style.height = '0px';
		opened = false;
		canhide = false;
	}
}
