var vMenu = [
				[
					['Home', './images/home.png', './images/home_ovr.png', './index.htm']
				],
				[
					['About', './images/about.png', './images/about_ovr.png', './about.htm', 185]
				],

				[
					['Products', './images/product.png', './images/product_ovr.png', './weaving.htm', 92],
					[
						[
							['Weaving', 'Weaving', './weaving.htm']
						],
						[
							['Spinning', 'Spinning', './spinning.htm']
						],
						[
							['Sizing', 'Sizing', './sizing.htm']
						]
					]
				],				
				[
					['News', './images/news.png', './images/news_ovr.png', './news.htm']
				],
				[
					['Download', './images/download.png', './images/download_ovr.png', './download.htm']
				],
				[
					['Inquiry', './images/inquiry.png', './images/inquiry_ovr.png', './inquiry.php']
				],
				[
					['Contact Us', './images/contact.png', './images/contact_ovr.png', './contact.htm'],
					[
					]
				]				
			];

var vTemp = window.location.href.split('/');
var vSelf = vTemp[vTemp.length-1];

function LoadMenu()
{
	var i, j, k, isPage = false;
	
	var obj = document.getElementById('menu'); if(!obj) return;
	
	var vTemp = '';
	var vHTML = '<ul class="level1">';
	
	for(i=0; i<vMenu.length; i++)
	{
		vTemp = '';
		isPage = false;

		if(vSelf.toLowerCase()==vMenu[i][0][3].toLowerCase().replace('./', '')) isPage = true;

		if(vMenu[i].length>1)
		{
			vTemp = '<br/><ul class="level2"' + ((vMenu[i][0].length>4) ? ' style="width:' + vMenu[i][0][4] + '"' : '') + '>';

			for(j=0; j<vMenu[i][1].length; j++)
			{
				if(!isPage && vSelf.toLowerCase()==vMenu[i][1][j][0][2].toLowerCase().replace('./', '')) isPage = true;

				if(vMenu[i][1][j][0].length>3)
					vTemp += '<li class="special" onmouseover="this.className=\'over\'; if(this.childNodes.length>1) this.childNodes[1].style.display=\'inline\';" onmouseout="this.className=\'special\'; if(this.childNodes.length>1) this.childNodes[1].style.display=\'none\';"><a title="' + vMenu[i][1][j][0][0] + '" href="' + vMenu[i][1][j][0][2] + '">' + vMenu[i][1][j][0][1] + '</a></li>';
				else
					vTemp += '<li onmouseover="this.className=\'over\'; if(this.childNodes.length>1) this.childNodes[1].style.display=\'inline\';" onmouseout="this.className=\'\'; if(this.childNodes.length>1) this.childNodes[1].style.display=\'none\';"><a title="' + vMenu[i][1][j][0][0] + '" href="' + vMenu[i][1][j][0][2] + '">' + vMenu[i][1][j][0][1] + '</a></li>';
			}

			vTemp += '</ul>';
		}
		
		if(isPage)
			vHTML += '<li onmouseover="if(this.childNodes.length>1) this.childNodes[2].style.display=\'inline\';" onmouseout="if(this.childNodes.length>1) this.childNodes[2].style.display=\'none\';" style="z-index:100"><a title="' + vMenu[i][0][0] + '" href="' + vMenu[i][0][3] + '"><img border="0" src="' + vMenu[i][0][2] + '"></a>';
		else
			vHTML += '<li onmouseover="this.childNodes[0].childNodes[0].src=\'' + vMenu[i][0][2] + '\'; if(this.childNodes.length>1) this.childNodes[2].style.display=\'inline\';" onmouseout="this.childNodes[0].childNodes[0].src=\'' + vMenu[i][0][1] + '\'; if(this.childNodes.length>1) this.childNodes[2].style.display=\'none\';"><a title="' + vMenu[i][0][0] + '" href="' + vMenu[i][0][3] + '"><img border="0" src="' + vMenu[i][0][1] + '"></a>';

		vHTML += vTemp + '</li>';

//		if(i!=vMenu.length-1) vHTML += '<li><img border="0" src="./images/menu_sep.jpg" /></li>';
	}

	vHTML += '</ul>';

	obj.innerHTML = vHTML;
}

if(window.attachEvent) window.attachEvent('onload', LoadMenu);
else window.addEventListener('load', LoadMenu, false);