var vProducts = new Array(
//				new Array(new Array('Industry...', 'Industry...', ''), new Array('Leather', 'Leather', './leather.htm'), new Array('Pesticide', 'Pesticide', './pesticide.htm'), new Array('Paper', 'Paper', './paper.htm'), new Array('Paint', 'Paint', './paint.htm'), new Array('Road', 'Road', './road.htm')),
				new Array(new Array('Process...', 'Process...', ''), new Array('Sizing', 'Sizing', './sizing.htm'), new Array('Finishing', 'Finishing', './finishing.htm'), new Array('Bleaching', 'Bleaching', './bleaching.htm'), new Array('Dyeing', 'Dyeing', './dyeing.htm'), new Array('Printing', 'Printing', './printing.htm')),
				new Array(new Array('Fabric...', 'Fabric...', ''), new Array('Denim', 'Denim', './denim.htm'), new Array('Terry Towel', 'Terry Towel', './terry.htm'), new Array('Silk', 'Silk', './silk.htm'), new Array('Knits', 'Knits', './knits.htm'), new Array('Jute', 'Jute', './jute.htm'), new Array('Voile', 'Voile', './voile.htm'), new Array('Suiting/Shirting/Bottom Weights', 'Suiting/Shirting/Bottom Weights', './suiting.htm'), new Array('Synthetic Fabric', 'Synthetic Fabric', './fabric.htm'), new Array('Non Woven', 'Non Woven', './nonwoven.htm'), new Array('Bed Sheets', 'Bed Sheets', './bedsheet.htm'), new Array('Auto Textiles', 'Auto Textiles', './auto.htm'), new Array('Garments', 'Garments', './garments.htm'))
				);

function RenderProducts()
{
	var i, j;
	var vHTML = '';
	var obj = document.getElementById('browser'); if(!obj) return;
	
	for(i=0; i<vProducts.length; i++)
	{
		vHTML += '<div class="product"><a title="' + vProducts[i][0][0] + '" href="javascript:" onclick="ShowHideOption(this);"><p class="select" onmouseover="this.className=\'select over\';" onmouseout="this.className=\'select\';">' + vProducts[i][0][1] + '</p></a><ul class="options">';
		for(j=1; j<vProducts[i].length; j++) vHTML += '<li><a title="' + vProducts[i][j][0] + '" href="' + ((vProducts[i][j][2]=="") ? '#' : vProducts[i][j][2]) + '" onclick="HideOption(this);"><p onmouseover="this.className=\'over\';" onmouseout="this.className=\'\';">' + vProducts[i][j][1] + '</p></a></li>';
		vHTML += '</ul></div>';
	}

	if(window.location.href.toLowerCase().indexOf('/search.php')!=-1) obj.innerHTML = vHTML;
	else if(window.location.href.toLowerCase().indexOf('/products.htm')!=-1) obj.innerHTML = '<div id="search"><form method="get" action="search.php"><input name="q" type="text" style="width:95;color:#36547D;" /><input type="submit" value=" Go " /></form></div>';
	else obj.innerHTML = vHTML + '<div id="search"><form method="get" action="search.php"><label for="q" accesskey="S"><u>S</u>earch:&nbsp;</label><input name="q" type="text" style="width:95;color:#36547D;" /><input type="submit" value=" Go " /></form></div>';
}

function ShowHideOption(obj)
{
	var obj = obj.parentNode.childNodes[1];
	obj.style.visibility = ((obj.style.visibility=='visible') ? 'hidden' : 'visible');
}

function HideOption(obj)
{
	var obj1 = obj.parentNode.parentNode;
	obj1.style.visibility = 'hidden';
	obj1 = obj1.parentNode.childNodes[0];
	obj1.setAttribute('title', obj.innerText);
	obj1 = obj1.childNodes[0];
	obj1.innerText = obj.innerText;
}

if(window.attachEvent) window.attachEvent('onload', RenderProducts);
else window.addEventListener('load', RenderProducts, false);