var vImagePath = './images/';
var vInnerPage = '';

var vMenu = [
				[
					['home.jpg', 'homeovr.jpg', 'Home', 'index.htm']
				],
				[
					['company.jpg', 'companyovr.jpg', 'The Company', '#', 160],
					[
						['Overview', 'Overview', 'company.htm'],
						['Infrastructure', 'Infrastructure', 'infrastructure.htm'],
						['Management', 'Management', 'management.htm'],
						['Achievements', 'Achievements', 'achievements.htm']
					]
				],
				[
					['products.jpg', 'productsovr.jpg', 'Products', '#', 140],
					[
						['Fine Wires', 'Fine Wires', 'finewires.htm'],
						['Nails', 'Nails', 'nails.htm']
					]
				],
				[
					['applications.jpg', 'applicationsovr.jpg', 'Applications', 'applications.htm', 160],
					[
						['Conveyer Belts', 'Conveyer Belts', 'applications.htm#conveyer'],
						['Braiding Hoses', 'Braiding Hoses', 'applications.htm#braiding'],
						['Flexible Connectors', 'Flexible Connectors', 'applications.htm#flexible'],
						['Wire Mesh', 'Wire Mesh', 'applications.htm#mesh'],
						['Ropes', 'Ropes', 'applications.htm#ropes'],
						['Springs', 'Springs', 'applications.htm#springs'],
						['Scrubbers', 'Scrubbers', 'applications.htm#scrubbers'],
						['Automobile', 'Automobile', 'applications.htm#automobile']
					]
				],
				[
					['quality.jpg', 'qualityovr.jpg', 'Quality', '#', 150],
					[
						['Quality Policy', 'Quality Policy', 'quality_policy.htm'],
						['Quality Certifications', 'Quality Certifications', 'quality_certifications.htm']
					]
				],
				[
					['inquiry.jpg', 'inquiryovr.jpg', 'Inquiry', 'inquiry.asp']
				],
				[
					['contact.jpg', 'contactovr.jpg', 'Contact Us', 'contact.htm']
				]
			];
			
var vTemp = window.location.href.split("/");
var vHREF = vTemp[vTemp.length-1];
if(vHREF.indexOf('#')!=-1) vHREF = vHREF.substring(0, vHREF.indexOf('#'));

function prepareandrendermenu()
{
	var vTemp = '';
	var vHTML = '';
	var IsPage = false;
	
	vHTML = '<ul class="level1">';
	
	for(var i=0; i<vMenu.length; i++)
	{
		vTemp = ''; IsPage = false;
		
		if(vHREF.toLowerCase()==vMenu[i][0][3].toLowerCase()) IsPage = true;
				 
		if(vMenu[i].length==2)
		{
			vTemp = '<br><ul class="level2" style="width:' + vMenu[i][0][4] + ';' + (window.attachEvent ? '' : 'margin-top:-3px;') + '">';

			for(var j=0; j<vMenu[i][1].length; j++)
			{
				if(!IsPage) if(vHREF.toLowerCase()==vMenu[i][1][j][2].toLowerCase()) IsPage = true;
				vTemp += '<li><a title="' + vMenu[i][1][j][1] + '" href="' + vMenu[i][1][j][2] + '"><span></span>' + vMenu[i][1][j][0] + '</a></li>';
			}

			vTemp += '</ul>';
		}
		
		if(IsPage) vHTML += '<li class="over" onmouseover="if(this.childNodes.length>1) this.childNodes[2].style.visibility=\'visible\';" onmouseout="if(this.childNodes.length>1) this.childNodes[2].style.visibility=\'hidden\';"><a href="' + vMenu[i][0][3] + '"><img alt="' + vMenu[i][0][2] + '" border="0" src="' + vImagePath + vMenu[i][0][1] + '"></a>' + vTemp + '</li>';
		else vHTML += '<li onmouseover="this.className=\'over\'; this.childNodes[0].childNodes[0].src=\'' +  vImagePath + vMenu[i][0][1] + '\'; if(this.childNodes.length>1) this.childNodes[2].style.visibility=\'visible\';" onmouseout="this.className=\'\'; this.childNodes[0].childNodes[0].src=\'' +  vImagePath + vMenu[i][0][0] + '\'; if(this.childNodes.length>1) this.childNodes[2].style.visibility=\'hidden\';"><a href="' + vMenu[i][0][3] + '"><img alt="' + vMenu[i][0][2] + '" border="0" src="' + vImagePath + vMenu[i][0][0] + '"></a>' + vTemp + '</li>';

		if(i!=vMenu.length-1) vHTML += '<li class="sep"></li>';

	}

	vHTML += '</ul>';
	
	var obj = document.getElementById('menu');
	if(obj) obj.innerHTML = vHTML;
}

if(window.attachEvent) window.attachEvent('onload', prepareandrendermenu);
else window.addEventListener('load', prepareandrendermenu, false);
