// JavaScript Document

/*function changeTD(td,count)
{
	if(count==1)
	{
		td.bgColor = "#0075eb";
		td.style.color = "#ffffff";
		td.borderColor = "#ffffff";
		
	}
	else
	{
		td.bgColor = "#0075eb";
		td.style.color = "#ffffff";
		td.borderColor = "#0075eb";
	}
}*/

function hideTD()
{
//	document.all.subHome.style.display="none";
//	document.all.subProduct.style.display="block";
}
var i=0;

function showSubMenu(th)
{
//	alert(i);
	

	if ( i > 0)
	{
		for ( j = i-1; j >= 0; j-- )
			tblSubmenu.rows('trSubmenu').deleteCell(j);
	}
	
	i = 0;
	
	
		
	if ( th == 1)
	{
		insertNewCell("Enterprise Solutions","../browsers/products.php");
		insertBlank("|");
		insertNewCell("e-Commerce","../browsers/ecom.php");
		insertBlank("|");
		insertNewCell("IBM Products","../ibm/");
		insertBlank("|");
		insertNewCell("Microsoft Products","../microsoft/");
		showImage(1);
		document.all('tdProduct').bgColor = '#a10303';
		document.all('fnProduct').style.color = '#ffffff';
		document.all('allSubmenu').bgColor = '#fcd2d2';
		document.all('allImage').bgColor = '#fcd2d2';
	}
	else if(th == 2)
	{
		insertNewCell("Technical Supports","../browsers/tech_support.php");
		insertBlank("|");
		insertNewCell("In House Training","../browsers/in_house_training.php");
		insertBlank("|");
		insertNewCell("After Sales Training","../browsers/after_sales_training.php");
		insertBlank("|");
		insertNewCell("Licencing","../browsers/license.php");
		insertBlank("|");
		insertNewCell("Software Recharge","../browsers/soft_recharge.php");
		showImage(2);
		document.all('tdSupport').bgColor = '#549400';
		document.all('fnSupport').style.color = '#ffffff';
		document.all('allSubmenu').bgColor = '#eefcd2';
		document.all('allImage').bgColor = '#eefcd2';
	}
	else if(th ==3)
	{
		insertNewCell("Financer","../browsers/finance.php");
		insertBlank("|");
		insertNewCell("Clients","../browsers/clients.php");
		insertBlank("|");
		insertNewCell("Business Partners","../browsers/partners.php");
		insertBlank("|");
		insertNewCell("Consultants","../browsers/consultant.php");
		showImage(3);
		document.all('tdAssociate').bgColor = '#d95000';
		document.all('allSubmenu').bgColor = '#fce8d2';
		document.all('allImage').bgColor = '#fce8d2';
		document.all('fnAssociate').style.color = '#ffffff';
		
	}
	else if(th ==4)
	{
		insertNewCell("Enquiry","../browsers/query.php");
		insertBlank("|");
		insertNewCell("View Query","../browsers/query_reply.php");
		showImage(4);
		document.all('tdContact').bgColor = '#ec9e2e';
		document.all('allSubmenu').bgColor = '#fcebb9';
		document.all('allImage').bgColor = '#fcebb9';
		document.all('fnContact').style.color = '#ffffff';
	}
	else
	{
		insertNewCell("Main","../browsers/index.php");
		insertBlank("|");
		insertNewCell("Background","../browsers/background.php");
		insertBlank("|");
		insertNewCell("Company Profile","../browsers/profile.php");
		showImage(0);
		document.all('tdHome').bgColor = '#0075eb';
		document.all('allSubmenu').bgColor = '#d2e4fc';
		document.all('allImage').bgColor = '#d2e4fc';
		document.all('fnHome').style.color = '#ffffff';
		
	}
}

function insertNewCell( txtLabel, txtLink)
{
	
	document.all('tblSubmenu').rows('trSubmenu').insertCell(i);
	tblSubmenu.rows('trSubmenu').cells(i).innerHTML = "<a href = \""+txtLink+"\" class=hrsubmenu>"+txtLabel+"</a>";
	tblSubmenu.rows('trSubmenu').cells(i).align = 'center';
	tblSubmenu.rows('trSubmenu').borderColor = '#75a3ed';
	tblSubmenu.rows('trSubmenu').border = '2px';
	i++;
}

function insertBlank (txtLabel)
{
	
	document.all('tblSubmenu').rows('trSubmenu').insertCell(i);
	tblSubmenu.rows('trSubmenu').cells(i).innerHTML = "<font class = hrsubmenu>"+txtLabel+"</font>";
	tblSubmenu.rows('trSubmenu').cells(i).align = 'center';
	i++;
}


function showImage(value)
{
	document.all('arrHome').style.visibility = 'hidden';
	document.all('arrProduct').style.visibility = 'hidden';
	document.all('arrSupport').style.visibility = 'hidden';
	document.all('arrAssociate').style.visibility = 'hidden';
	document.all('arrContact').style.visibility = 'hidden';
	
	document.all('tdHome').bgColor = '#ffffff';
	document.all('tdProduct').bgColor = '#ffffff';
	document.all('tdSupport').bgColor = '#ffffff';
	document.all('tdAssociate').bgColor = '#ffffff';
	document.all('tdContact').bgColor = '#ffffff';
	
	document.all('fnHome').style.color = '#444444';
	document.all('fnProduct').style.color = '#444444';
	document.all('fnSupport').style.color = '#444444';
	document.all('fnAssociate').style.color = '#444444';
	document.all('fnContact').style.color = '#444444';
	
	document.all('tblSubmenu').rows('trSubmenu').bgcolor = '#ec9e2e';
	
	
	if (value == 0 )
		document.all('arrHome').style.visibility = 'visible';
	if (value == 1 )
		document.all('arrProduct').style.visibility = 'visible';
	if (value == 2 )
		document.all('arrSupport').style.visibility = 'visible';
	if (value == 3 )
		document.all('arrAssociate').style.visibility = 'visible';
	if (value == 4 )
		document.all('arrContact').style.visibility = 'visible';		
		
}