// Blue silicon nav 
// written by Carlos Vargas
// 15th Januari 2001

// this nav includes the following functions:

// 	create_menus
// 	show_menu
// 	hide_menu
// 	show_sub
// 	hide_sub
// 	hide_all
// 	menuOver
// 	menuOut
// 	ns_hidehilights
// 	set_timeout
// 	clear_timer
// 	write_nav

// netscape / IE 3 and less detect
// nsie3_det


function create_menus()
{
	args = create_menus.arguments;
	var ID = args[0];
	var direction;

	if(document.all)
	// Internet Explorer Menu
	{
		dMenu[ID].available = 1;
		for(i=0; i<dMenu[ID].length; i++)
		{
			direction=dSubMenu[ID].direction=="left"?"left":"right";
			document.write('<DIV ID="dNav'+ID+i+'" STYLE="z-index:100; background:'+bgcolormnu+'; position:absolute; visibility:hidden; left:'+dMenu[ID].left+'; top:'+dMenu[ID].top+'; width:'+dMenu[ID].width+'; height:20;" OnMouseOver="menuOver('+ID+','+i+');" OnMouseOut="menuOut('+ID+','+i+');" OnClick="document.location.href=\''+dMenu[ID].links[i]+'\';">');
			document.write('<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH="'+dMenu[ID].width+'">\n');

			document.write('<TR>');
			document.write('<TD COLSPAN="5" BGCOLOR="'+colorgrid+'"><IMG SRC="../images/general/clear.gif" WIDTH="'+dMenu[ID].width+'" HEIGHT=1 BORDER=0></TD>');
			document.write('</TR>');

			document.write('<TR>');
			document.write('<TD BGCOLOR="'+colorgrid+'"><IMG SRC="../images/general/clear.gif" WIDTH=1 HEIGHT=20 BORDER=0></TD>');
			document.write('<TD VALIGN="TOP">');
			if(dSubMenu[ID][i][0] && direction == "left")
			{
				document.write('<IMG NAME="dImage'+ID+i+'" SRC="../images/general/'+direction+'_tri_b.gif" WIDTH=10 HEIGHT=20 BORDER=0>');
			}
			else
			{
				document.write('<IMG SRC="../images/general/clear.gif" WIDTH=10 HEIGHT=20 BORDER=0>');
			}
			document.write('</TD><TD VALIGN="TOP" NOWRAP CLASS="'+classmnu+'" ID="dTable'+ID+''+i+'">');
			document.write('<IMG SRC="../images/general/clear.gif" WIDTH="'+(dMenu[ID].width-20)+'" HEIGHT=2 BORDER=0><BR>');
			document.write(dMenu[ID][i]);
			document.write('</TD><TD>');
			if(dSubMenu[ID][i][0] && direction == "right")
			{
				document.write('<IMG NAME="dImage'+ID+i+'" SRC="../images/general/'+direction+'_tri_b.gif" WIDTH=10 HEIGHT=19 BORDER=0>');
			}
			else
			{
				document.write('<IMG SRC="../images/general/clear.gif" WIDTH=10 HEIGHT=19 BORDER=0>');
			}
			document.write('</TD>');
			document.write('<TD BGCOLOR="'+colorgrid+'"><IMG SRC="../images/general/clear.gif" WIDTH=1 HEIGHT=20 BORDER=0></TD>');
			document.write('</TR>\n');
			if(i==dMenu[ID].length -1)
			{
				document.write('<TR>');
				document.write('<TD COLSPAN="5" BGCOLOR="'+colorgrid+'"><IMG SRC="../images/general/clear.gif" WIDTH="'+dMenu[ID].width+'" HEIGHT=1 BORDER=0></TD>');
				document.write('</TR>');
			}

			document.write('</TABLE>\n');
			document.write('</DIV>\n');

			// Sub Menu Generation
			if(dSubMenu[ID][i].length)
			{
				var top=dMenu[ID].top;
				for(j=0; j<dSubMenu[ID][i].length; j++)
				{
					var submenuleft=(dMenu[ID].left+dMenu[ID].width+1);
					if(direction == "left")
					{
						submenuleft=(dMenu[ID].left-dSubMenu[ID].width-1);
					}
					document.write('<DIV ID="dNav'+ID+i+'O'+j+'" STYLE="z-index:100; background:'+bgcolormnu+'; position:absolute; visibility:hidden; left:'+submenuleft+'; top:'+top+'; width:'+dSubMenu[ID].width+'; height:20;" OnMouseOver="menuOver('+ID+','+i+','+j+');" OnMouseOut="menuOut('+ID+','+i+','+j+');" OnClick="document.location.href=\''+dSubMenu[ID][i].links[j]+'\';">');
					document.write('<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH="'+dSubMenu[ID].width+'">\n');

					document.write('<TR>');
					document.write('<TD COLSPAN="5" BGCOLOR="'+colorgrid+'"><IMG SRC="../images/general/clear.gif" WIDTH="'+dSubMenu[ID].width+'" HEIGHT=1 BORDER=0></TD>');
					document.write('</TR>');

					document.write('<TR>');
					document.write('<TD BGCOLOR="'+colorgrid+'"><IMG SRC="../images/general/clear.gif" WIDTH=1 HEIGHT=20 BORDER=0></TD>');
					document.write('<TD VALIGN="TOP">');
					document.write('<IMG SRC="../images/general/clear.gif" WIDTH=10 HEIGHT=20 BORDER=0>');
					document.write('</TD><TD VALIGN="TOP" NOWRAP CLASS="'+classmnu+'" ID="dTable'+ID+''+i+'O'+j+'">');
					document.write('<IMG SRC="../images/general/clear.gif" WIDTH="'+(dSubMenu[ID].width-20)+'" HEIGHT=2 BORDER=0><BR>');
					document.write(dSubMenu[ID][i][j]);
					document.write('</TD><TD>');
					document.write('<IMG SRC="../images/general/clear.gif" WIDTH=10 HEIGHT=19 BORDER=0>');
					document.write('</TD>');
					document.write('<TD BGCOLOR="'+colorgrid+'"><IMG SRC="../images/general/clear.gif" WIDTH=1 HEIGHT=20 BORDER=0></TD>');
					document.write('</TR>\n');
					if(j==dSubMenu[ID][i].length -1)
					{
						document.write('<TR>');
						document.write('<TD COLSPAN="5" BGCOLOR="'+colorgrid+'"><IMG SRC="../images/general/clear.gif" WIDTH="'+dSubMenu[ID].width+'" HEIGHT=1 BORDER=0></TD>');
						document.write('</TR>');
					}
					document.write('</TABLE>\n');
					document.write('</DIV>\n');
					top+=20;
				}
			}
			dMenu[ID].top+=20;
		}
	}
	else if(document.layers)
	// Netscape Navigator/Communicator Menu
	{
		dMenu[ID].available = 1;
		for(i=0; i<dMenu[ID].length; i++)
		{
			direction=dSubMenu[ID].direction=="left"?"left":"right";

			// Navigation Menu Item
			document.write('<LAYER NAME="dNav'+ID+i+'" Z-INDEX="100" BGCOLOR="'+bgcolormnu+'" POSITION="absolute" VISIBILITY="hide" LEFT="'+dMenu[ID].nsleft+'" TOP="'+dMenu[ID].top+'" WIDTH="'+dMenu[ID].nswidth+'" HEIGHT="20" OnMouseOver="menuOver('+ID+','+i+');" OnMouseOut="menuOut('+ID+','+i+');">\n');
			document.write('<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH="'+dMenu[ID].nswidth+'">\n');
			document.write('<TR>');
			document.write('<TD COLSPAN="5" BGCOLOR="'+colorgrid+'"><IMG SRC="../images/general/clear.gif" WIDTH="'+dMenu[ID].nswidth+'" HEIGHT=1 BORDER=0></TD>');
			document.write('</TR>');
			document.write('<TR>');
			document.write('<TD BGCOLOR="'+colorgrid+'"><IMG SRC="../images/general/clear.gif" WIDTH=1 HEIGHT=20 BORDER=0></TD>');
			document.write('<TD VALIGN="TOP">');
			if(dSubMenu[ID][i][0] && direction == "left")
			{
				document.write('<IMG SRC="../images/general/'+direction+'_tri_b.gif" WIDTH=10 HEIGHT=20 BORDER=0>');
			}
			else
			{
				document.write('<IMG SRC="../images/general/clear.gif" WIDTH=10 HEIGHT=20 BORDER=0>');
			}
			document.write('</TD><TD VALIGN="TOP" NOWRAP>');
			document.write('<IMG SRC="../images/general/clear.gif" WIDTH="'+(dMenu[ID].nswidth-20)+'" HEIGHT=2 BORDER=0><BR>');
			document.write('<A HREF="'+dMenu[ID].links[i]+'" CLASS="'+classmnu+'">');
			document.write(dMenu[ID][i]);
			document.write('</A>');
			document.write('</TD><TD>');
			if(dSubMenu[ID][i][0] && direction == "right")
			{
				document.write('<IMG SRC="../images/general/'+direction+'_tri_b.gif" WIDTH=10 HEIGHT=19 BORDER=0>');
			}
			else
			{
				document.write('<IMG SRC="../images/general/clear.gif" WIDTH=10 HEIGHT=19 BORDER=0>');
			}
			document.write('</TD>');
			document.write('<TD BGCOLOR="'+colorgrid+'"><IMG SRC="../images/general/clear.gif" WIDTH=1 HEIGHT=20 BORDER=0></TD>');
			document.write('</TR>\n');
			if(i==dMenu[ID].length -1)
			{
				document.write('<TR>');
				document.write('<TD COLSPAN="5" BGCOLOR="'+colorgrid+'"><IMG SRC="../images/general/clear.gif" WIDTH="'+dMenu[ID].nswidth+'" HEIGHT=1 BORDER=0></TD>');
				document.write('</TR>');
			}
			document.write('</TABLE>\n');
			document.write('</LAYER>\n');
			
			// Over Navigation Menu Item
			document.write('<LAYER NAME="dNav'+ID+i+'Over" Z-INDEX="100" BGCOLOR="'+ovcolormnu+'" POSITION="absolute" VISIBILITY="hide" LEFT="'+dMenu[ID].nsleft+'" TOP="'+dMenu[ID].top+'" WIDTH="'+dMenu[ID].nswidth+'" HEIGHT="20" OnMouseOver="menuOver('+ID+','+i+');" OnMouseOut="menuOut('+ID+','+i+');">\n');
			document.write('<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH="'+dMenu[ID].nswidth+'">\n');

			document.write('<TR>');
			document.write('<TD COLSPAN="5" BGCOLOR="'+colorgrid+'"><IMG SRC="../images/general/clear.gif" WIDTH="'+dMenu[ID].nswidth+'" HEIGHT=1 BORDER=0></TD>');
			document.write('</TR>');

			document.write('<TR>');
			document.write('<TD BGCOLOR="'+colorgrid+'"><IMG SRC="../images/general/clear.gif" WIDTH=1 HEIGHT=20 BORDER=0></TD>');
			document.write('<TD VALIGN="TOP">');
			if(dSubMenu[ID][i][0] && direction == "left")
			{
				document.write('<IMG SRC="../images/general/'+direction+'_tri.gif" WIDTH=10 HEIGHT=20 BORDER=0>');
			}
			else
			{
				document.write('<IMG SRC="../images/general/clear.gif" WIDTH=10 HEIGHT=20 BORDER=0>');
			}
			document.write('</TD><TD VALIGN="TOP" NOWRAP>');
			document.write('<IMG SRC="../images/general/clear.gif" WIDTH="'+(dMenu[ID].nswidth-20)+'" HEIGHT=2 BORDER=0><BR>');
			document.write('<A HREF="'+dMenu[ID].links[i]+'" CLASS="'+classovmnu+'">');
			document.write(dMenu[ID][i]);
			document.write('</A>');
			document.write('</TD><TD>');
			if(dSubMenu[ID][i][0] && direction == "right")
			{
				document.write('<IMG SRC="../images/general/'+direction+'_tri.gif" WIDTH=10 HEIGHT=19 BORDER=0>');
			}
			else
			{
				document.write('<IMG SRC="../images/general/clear.gif" WIDTH=10 HEIGHT=19 BORDER=0>');
			}
			document.write('</TD>');
			document.write('<TD BGCOLOR="'+colorgrid+'"><IMG SRC="../images/general/clear.gif" WIDTH=1 HEIGHT=20 BORDER=0></TD>');
			document.write('</TR>\n');
			if(i==dMenu[ID].length -1)
			{
				document.write('<TR>');
				document.write('<TD COLSPAN="5" BGCOLOR="'+colorgrid+'"><IMG SRC="../images/general/clear.gif" WIDTH="'+dMenu[ID].nswidth+'" HEIGHT=1 BORDER=0></TD>');
				document.write('</TR>');
			}
			document.write('</TABLE>\n');
			document.write('</LAYER>\n');
			
			if(dSubMenu[ID][i].length)
			{
				var top=dMenu[ID].top;
				for(j=0; j<dSubMenu[ID][i].length; j++)
				{
					var submenuleft=(dMenu[ID].nsleft+dMenu[ID].nswidth+1);
					if(direction == "left")
					{
						submenuleft=(dMenu[ID].nsleft-dSubMenu[ID].nswidth-1);
					}
					// Navigation Menu Item
					document.write('<LAYER NAME="dNav'+ID+i+'O'+j+'" Z-INDEX="100" BGCOLOR="'+bgcolormnu+'" POSITION="absolute" VISIBILITY="hide" LEFT="'+submenuleft+'" TOP="'+top+'" WIDTH="'+dSubMenu[ID].nswidth+'" HEIGHT="20" OnMouseOver="menuOver('+ID+','+i+','+j+');">\n');
					document.write('<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH="'+dSubMenu[ID].nswidth+'">\n');

					document.write('<TR>');
					document.write('<TD COLSPAN="5" BGCOLOR="'+colorgrid+'"><IMG SRC="../images/general/clear.gif" WIDTH="'+dSubMenu[ID].nswidth+'" HEIGHT=1 BORDER=0></TD>');
					document.write('</TR>');

					document.write('<TR>');
					document.write('<TD BGCOLOR="'+colorgrid+'"><IMG SRC="../images/general/clear.gif" WIDTH=1 HEIGHT=20 BORDER=0></TD>');
					document.write('<TD VALIGN="TOP">');
					document.write('<IMG SRC="../images/general/clear.gif" WIDTH=10 HEIGHT=20 BORDER=0>');
					document.write('</TD><TD VALIGN="TOP" NOWRAP>');
					document.write('<IMG SRC="../images/general/clear.gif" WIDTH="'+(dSubMenu[ID].nswidth-20)+'" HEIGHT=2 BORDER=0><BR>');
					document.write('<A HREF="'+dSubMenu[ID][i].links[j]+'" CLASS="'+classmnu+'">');
					document.write(dSubMenu[ID][i][j]);
					document.write('</A>');
					document.write('</TD><TD>');
					document.write('<IMG SRC="../images/general/clear.gif" WIDTH=10 HEIGHT=19 BORDER=0>');
					document.write('</TD>');
					document.write('<TD BGCOLOR="'+colorgrid+'"><IMG SRC="../images/general/clear.gif" WIDTH=1 HEIGHT=20 BORDER=0></TD>');
					document.write('</TR>\n');
					if(j==dSubMenu[ID][i].length -1)
					{
						document.write('<TR>');
						document.write('<TD COLSPAN="5" BGCOLOR="'+colorgrid+'"><IMG SRC="../images/general/clear.gif" WIDTH="'+dSubMenu[ID].nswidth+'" HEIGHT=1 BORDER=0></TD>');
						document.write('</TR>');
					}
					document.write('</TABLE>\n');
					document.write('</LAYER>');

					// Over Navigation Menu Item
					document.write('<LAYER NAME="dNav'+ID+i+'O'+j+'Over" Z-INDEX="100" BGCOLOR="'+ovcolormnu+'" POSITION="absolute" VISIBILITY="hide" LEFT="'+submenuleft+'" TOP="'+top+'" WIDTH="'+dSubMenu[ID].nswidth+'" HEIGHT="20" OnMouseOut="menuOut('+ID+','+i+','+j+');">\n');
					document.write('<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH="'+dSubMenu[ID].nswidth+'">\n');

					document.write('<TR>');
					document.write('<TD COLSPAN="5" BGCOLOR="'+colorgrid+'"><IMG SRC="../images/general/clear.gif" WIDTH="'+dSubMenu[ID].nswidth+'" HEIGHT=1 BORDER=0></TD>');
					document.write('</TR>');

					document.write('<TR>');
					document.write('<TD BGCOLOR="'+colorgrid+'"><IMG SRC="../images/general/clear.gif" WIDTH=1 HEIGHT=20 BORDER=0></TD>');
					document.write('<TD VALIGN="TOP">');
					document.write('<IMG SRC="../images/general/clear.gif" WIDTH=10 HEIGHT=20 BORDER=0>');
					document.write('</TD><TD VALIGN="TOP" NOWRAP>');
					document.write('<IMG SRC="../images/general/clear.gif" WIDTH="'+(dSubMenu[ID].nswidth-20)+'" HEIGHT=2 BORDER=0><BR>');
					document.write('<A HREF="'+dSubMenu[ID][i].links[j]+'" CLASS="'+classovmnu+'">');
					document.write(dSubMenu[ID][i][j]);
					document.write('</A>');
					document.write('</TD><TD>');
					document.write('<IMG SRC="../images/general/clear.gif" WIDTH=10 HEIGHT=19 BORDER=0>');
					document.write('</TD>');
					document.write('<TD BGCOLOR="'+colorgrid+'"><IMG SRC="../images/general/clear.gif" WIDTH=1 HEIGHT=20 BORDER=0></TD>');
					document.write('</TR>\n');
					if(j==dSubMenu[ID][i].length -1)
					{
						document.write('<TR>');
						document.write('<TD COLSPAN="5" BGCOLOR="'+colorgrid+'"><IMG SRC="../images/general/clear.gif" WIDTH="'+dSubMenu[ID].nswidth+'" HEIGHT=1 BORDER=0></TD>');
						document.write('</TR>');
					}
					document.write('</TABLE>\n');
					document.write('</LAYER>');
					top+=20;
				}
			}
			dMenu[ID].top+=20;
		}
	}
}

function show_menu(menu)
{
	hide_all(1);
	if(document.layers) ns_hidehilights(menu);
	clear_timer();
	if(document.all)
	{
		for(i=0; i<dMenu[menu].length; i++)
		{
			document.all['dNav'+menu+i].style.visibility='visible';
		}
	}
	else if(document.layers)
	{
		for(i=0; i<dMenu[menu].length; i++)
		{
			document.layers['dNav'+menu+i].visibility='show';
		}
	}
	axvar = String.fromCharCode(menu+48)
	MM_swapImage('document.h'+axvar,'document.h'+axvar,'../images/general/top-nav-icon-down.gif','#935749600900');
	openmenu=menu;
}

function hide_menu(menu)
{
	if(dMenu[menu].available)
	{
		if(document.all)
		{
			for(i=0; i<dMenu[menu].length; i++)
			{
				document.all['dNav'+menu+i].style.visibility='hidden';
			}
		}
		else if(document.layers)
		{
			for(i=0; i<dMenu[menu].length; i++)
			{
				document.layers['dNav'+menu+i].visibility='hide';
				document.layers['dNav'+menu+i+'Over'].visibility='hide';
			}
		}
	}
	MM_swapImgRestore();
	return menu;
}

function show_sub(menu,item)
{
	if(document.all && dSubMenu[menu][item][0] != "undefined")
	{
		for(i=0; i<dSubMenu[menu][item].length; i++)
		{
			document.all['dNav'+menu+item+'O'+i].style.visibility='visible';
			document.all['dNav'+menu+item].style.background=ovcolormnu;
			document.all['dTable'+menu+item].className=classovmnu;
			var image=(document.all['dImage'+menu+item])?document.all['dImage'+menu+item].src:0;
			if(image && image.indexOf("_b.gif") != -1)
			{
				document.all['dImage'+menu+item].src = image.substring(0,image.indexOf("_b.gif")) + ".gif"
			}
		}
	}
	else if(document.layers && dSubMenu[menu][item][0] != "undefined")
	{
		for(i=0; i<dSubMenu[menu][item].length; i++)
		{
			document.layers['dNav'+menu+item+'O'+i].visibility='show';
		}
	}
}

function hide_sub(menu,item)
{
	if(document.all)
	{
		if(document.all['dNav'+menu+item+'O'+'0'])
		{
			if(dSubMenu[menu][item].length)
			for(i=0; i<dSubMenu[menu][item].length; i++)
			{
				document.all['dNav'+menu+item+'O'+i].style.visibility='hidden';
				document.all['dNav'+menu+item].style.background=bgcolormnu;
				document.all['dTable'+menu+item].className=classmnu;
				var image=(document.all['dImage'+menu+item])?document.all['dImage'+menu+item].src:0;
				if(image && image.indexOf("_b.gif") == -1)
				{
					document.all['dImage'+menu+item].src = image.substring(0,image.indexOf(".gif")) + "_b.gif"
				}
			}
		}
	}
	else if(document.layers)
	{
		if(document.layers['dNav'+menu+item+'O'+'0'])
		{
			if(dSubMenu[menu][item].length)
			for(i=0; i<dSubMenu[menu][item].length; i++)
			{
				document.layers['dNav'+menu+item+'O'+i].visibility='hide';
				document.layers['dNav'+menu+item+'O'+i+'Over'].visibility='hide';
			}
		}
	}
	return item;
}

/* function hide_all()
{
	for(i=0; i<dMenu.length; i++)
	{
		i = hide_menu(i);
	}
	var dsmi;
	for(k=0; k<dSubMenu.length; k++)
	{  
		if(dMenu[k].available)
		{
			dsmi = dSubMenu[k].length;
			for(j=0; j<dsmi; j++)
			{
				hide_sub(k,j);
			}
		}
	}
	hide_contact();	
}
*/

 function hide_all()
{
	if(openmenu >= 0)
	{
		hide_menu(openmenu);
		var dsmi;
		k = openmenu;
		if(dMenu[k].available)
		{
			dsmi = dSubMenu[k].length;
			for(j=0; j<dsmi; j++)
			{
				hide_sub(k,j);
			}
		}
	}
	if(document.all) contact.style.visibility='hidden'
	else if(document.layers) document.contact.visibility='hide';
}


function mOvr(src,clrOver){ 
	if (!src.contains(event.fromElement)){ 
		src.style.cursor = 'hand'; 
		src.bgColor = clrOver; 
	} 
} 

function mOut(src,clrIn){ 
	if (!src.contains(event.toElement)){ 
		src.style.cursor = 'default'; 
		src.bgColor = clrIn; 
	} 
} 


function mClk(src){ 
	if(event.srcElement.tagName=='TD')
		src.children.tags('A')[0].click();
}



function menuOver(menu,item,sub)
{
	if(document.layers) ns_hidehilights(menu,item);
	clear_timer();
	if(sub || sub == 0)
	{
		show_sub(menu,item);
		if(document.all)
		{
			document.all['dNav'+menu+item+'O'+sub].style.background=ovcolormnu;
			document.all['dTable'+menu+item+'O'+sub].className=classovmnu;
		} 
		else if(document.layers)
		{
			document.layers['dNav'+menu+item+'O'+sub].visibility='hide';
			document.layers['dNav'+menu+item+'O'+sub+'Over'].visibility='show';
			document.layers['dNav'+menu+item+'Over'].visibility='show';
		}
	}
	else
	{
		if(document.all)
		{
			document.all['dNav'+menu+item].style.background=ovcolormnu;
			document.all['dTable'+menu+item].className=classovmnu;
			var image=(document.all['dImage'+menu+item])?document.all['dImage'+menu+item].src:0;
			if(image && image.indexOf("_b.gif") != -1)
			{
				document.all['dImage'+menu+item].src = image.substring(0,image.indexOf("_b.gif")) + ".gif"
			}
			if(dMenu[menu][item].length>0)
			{
				hide_sub(openmenu,openitem);
				show_sub(menu,item);
			}
		} 
		else if(document.layers)
		{
			document.layers['dNav'+menu+item].visibility='hide';
			document.layers['dNav'+menu+item+'Over'].visibility='show';
			if(dMenu[menu][item].length>0)
			{
				hide_sub(openmenu,openitem);
				show_sub(menu,item);
			}
		}
	}
	openmenu=menu;
	openitem=item;
}

function menuOut(menu,item,sub)
{
	if(document.layers) ns_hidehilights(menu,item);
	if(sub || sub == 0)
	{
		if(document.all)
		{
			document.all['dNav'+menu+item+'O'+sub].style.background=bgcolormnu;
			document.all['dTable'+menu+item+'O'+sub].className=classmnu;
		} 
		else if(document.layers)
		{
			document.layers['dNav'+menu+item+'O'+sub].visibility='show';
			document.layers['dNav'+menu+item+'O'+sub+'Over'].visibility='hide';
			document.layers['dNav'+menu+item+'Over'].visibility='show';
		}
	}
	else
	{
		if(document.all)
		{
			document.all['dNav'+menu+item].style.background=bgcolormnu;
			document.all['dTable'+menu+item].className=classmnu;
			var image=(document.all['dImage'+menu+item])?document.all['dImage'+menu+item].src:0;
			if(image && image.indexOf("_b.gif") == -1)
			{
				document.all['dImage'+menu+item].src = image.substring(0,image.indexOf(".gif")) + "_b.gif"
			}
			if(dMenu[menu][item].length>0)
			{
				hide_sub(menu,item);
			}
		}
		else if(document.layers)
		{
			document.layers['dNav'+menu+item].visibility='show';
			document.layers['dNav'+menu+item+'Over'].visibility='hide';
			if(dMenu[menu][item].length>0)
			{
				hide_sub(menu,item);
			}
		}
	}
	set_timeout();
}


function ns_hidehilights(menu,item)
{
	for(i=0; i<dMenu[menu].length; i++)
	{
		document.layers['dNav'+menu+i+'Over'].visibility='hide';
		document.layers['dNav'+menu+i].visibility='show';
	}
	
	if(item)
	{
		for(i=0; i<dSubMenu[menu][item].length; i++)
		{
			document.layers['dNav'+menu+item+'O'+i+'Over'].visibility='hide';
		}
	}
}

function set_timeout()
{
	closewindows = setTimeout('hide_all();',100);
}

function clear_timer(menu)
{
	clearTimeout(closewindows);
}


function MM_swapImgRestore() { //v2.0
  if (document.MM_swapImgData != null)
    for (var i=0; i<(document.MM_swapImgData.length-1); i+=2)
      document.MM_swapImgData[i].src = document.MM_swapImgData[i+1];
}

function MM_swapImage() { //v2.0
  var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.MM_swapImgData;
  for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) {
    objStr = MM_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];
    if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
        (objStr.indexOf('document.all[')   ==0 && document.all   ==null))
      objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
    obj = eval(objStr);
    if (obj != null) {
      swapArray[j++] = obj;
      swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j];
      obj.src = MM_swapImage.arguments[i+2];
  } }
  document.MM_swapImgData = swapArray; //used for restore
}


function write_nav(menu_sel) {
	menu_sel_0 = (menu_sel == 0)? back_img_sel:back_img_menu;
	menu_sel_1 = (menu_sel == 1)? back_img_sel:back_img_menu;
	menu_sel_2 = (menu_sel == 2)? back_img_sel:back_img_menu;
	menu_sel_3 = (menu_sel == 3)? back_img_sel:back_img_menu;
	menu_sel_4 = (menu_sel == 4)? back_img_sel:back_img_menu;
	menu_sel_5 = (menu_sel == 5)? back_img_sel:back_img_menu;
	menu_sel_6 = (menu_sel == 6)? back_img_sel:back_img_menu;
	menu_sel_7 = (menu_sel == 7)? back_img_sel:back_img_menu;
	menu_sel_8 = (menu_sel == 8)? back_img_sel:back_img_menu;

	img_sel_0 = (menu_sel == 0)? img_down:img_right;
	img_sel_1 = (menu_sel == 1)? img_down:img_right;
	img_sel_2 = (menu_sel == 2)? img_down:img_right;
	img_sel_3 = (menu_sel == 3)? img_down:img_right;
	img_sel_4 = (menu_sel == 4)? img_down:img_right;
	img_sel_5 = (menu_sel == 5)? img_down:img_right;
	img_sel_6 = (menu_sel == 6)? img_down:img_right;
	img_sel_7 = (menu_sel == 7)? img_down:img_right;
	img_sel_8 = (menu_sel == 8)? img_down:img_right;
	
	document.write('<table width="634" height="19" border="0" cellspacing="0" cellpadding="0">');
	document.write('<tr align="center" valign="middle">\n');
	document.write('<td width="80" height="19" align="center" nowrap background="'+menu_sel_0+'" class="whitelink"><img src="'+img_sel_0+'" width="6" height="6" border="0" alt="" >&nbsp;<A CLASS="whitelink" HREF="../index.html" OnMouseOver="hide_all();">home</A></td>\n');
	document.write('<td width="80" height="19" align="center" nowrap background="'+menu_sel_1+'" class="whitelink"><img src="'+img_sel_1+'" width="6" height="6" border="0" alt="" name="h1">&nbsp;<A CLASS="whitelink" HREF="http://www.blue-silicon.net" OnMouseOver="hide_all();">members</A></td>\n');
	document.write('<td width="100" height="19" align="center" nowrap background="'+menu_sel_2+'" class="whitelink"><img src="'+img_sel_2+'" width="6" height="6" border="0" alt="" name="h2">&nbsp;<A CLASS="whitelink" HREF="../about-us/index.html" OnMouseOver="show_menu(2);" OnMouseOut="set_timeout(2)">about us</A></td>\n');
	document.write('<td width="100" height="19" align="center" nowrap background="'+menu_sel_3+'" class="whitelink"><img src="'+img_sel_3+'" width="6" height="6" border="0" alt="" name="h3">&nbsp;<A CLASS="whitelink" HREF="../solutions/index.html" OnMouseOver="show_menu(3);" OnMouseOut="set_timeout(3)">solutions</A></td>\n');
	document.write('<td width="80" height="19" align="center" nowrap background="'+menu_sel_4+'" class="whitelink"><img src="'+img_sel_4+'" width="6" height="6" border="0" alt="" name="h4">&nbsp;<A CLASS="whitelink" HREF="../careers/index.html" OnMouseOver="show_menu(4);" OnMouseOut="set_timeout(4)">careers</A></td>\n');
	document.write('<td width="80" height="19" align="center" nowrap background="'+menu_sel_5+'" class="whitelink"><img src="'+img_sel_5+'" width="6" height="6" border="0" alt="" name="h5">&nbsp;<A CLASS="whitelink" HREF="../news/news.html" OnMouseOver="show_menu(5);" OnMouseOut="set_timeout(5)">news</A></td>\n');
	document.write('<td width="80" height="19" align="center" nowrap background="'+menu_sel_6+'" class="whitelink"><img src="'+img_sel_6+'" width="6" height="6" border="0" alt="" name="h6">&nbsp;<A CLASS="whitelink" HREF="../sitemap/index.html" OnMouseOver="hide_all();">sitemap</A></td>\n');
	document.write('<td width="34" height="19" align="center" background="'+back_img_menu+'" class="whitelink"><IMG SRC="../images/general/clear.gif" WIDTH="1" HEIGHT="1" BORDER="0" alt=""></td>\n');
	document.write('</tr>\n');
	document.write('</table>\n');
}

function write_nav2() {
	document.write('<table width="617" height="19" border="0" cellspacing="0" cellpadding="0">');
	document.write('<tr align="center" valign="middle">\n');
	document.write('<td width="32" height="19" align="center" nowrap background="#ffffff" class="whitelink"></td>\n');

	document.write('<td width="150" height="19" align="center" nowrap background="../images/general/background-our-team-menu.gif" class="whitelink"><img src="../images/general/top-nav-icon-right.gif" width="6" height="6" border="0" alt="" name="h0">&nbsp;<A CLASS="whitelink" HREF="../about-us/index.html" OnMouseOver="show_menu(0);" OnMouseOut="set_timeout(0)"><b>A - F</b></A></td>\n');
	document.write('<td width="150" height="19" align="center" nowrap background="../images/general/background-our-team-menu.gif" class="whitelink"><img src="../images/general/top-nav-icon-right.gif" width="6" height="6" border="0" alt="" name="h1">&nbsp;<A CLASS="whitelink" HREF="../about-us/index.html" OnMouseOver="show_menu(1);" OnMouseOut="set_timeout(1)"><b>G - L</b></A></td>\n');
	document.write('<td width="150" height="19" align="center" nowrap background="../images/general/background-our-team-menu.gif" class="whitelink"><img src="../images/general/top-nav-icon-right.gif" width="6" height="6" border="0" alt="" name="h6">&nbsp;<A CLASS="whitelink" HREF="../about-us/index.html" OnMouseOver="show_menu(6);" OnMouseOut="set_timeout(6)"><b>M - R</b></A></td>\n');
	document.write('<td width="150" height="19" align="center" nowrap background="../images/general/background-our-team-menu.gif" class="whitelink"><img src="../images/general/top-nav-icon-right.gif" width="6" height="6" border="0" alt="" name="h7">&nbsp;<A CLASS="whitelink" HREF="../solutions/index.html" OnMouseOver="show_menu(7);" OnMouseOut="set_timeout(7)"><b>S - Z</b></A></td>\n');
	document.write('<td width="17" height="19" align="center" background="../images/general/background-our-team-menu.gif" class="whitelink"><IMG SRC="../images/general/clear.gif" WIDTH="1" HEIGHT="1" BORDER="0" alt=""></td>\n');
	document.write('</tr>\n');
	document.write('</table>\n');
}


function contact_menu()
{
	args = contact_menu.arguments;
	var ID   = args[0];
	lpos = args[1];
	var tpos = args[2];
	
	if(document.all)
	// Internet Explorer Menu
	{
		document.write('<div id="contact" style="z-index:100; position:absolute; visibility:hidden; left:'+lpos+'; top:'+tpos+'; width:620; height:19;"  OnMouseOver="show_contact2();" onMouseOut="hide_contact();">');
		document.write('<table width="634" border="0" cellspacing="0" cellpadding="0" align="left" background="../images/general/contact-us-background.gif" class="whitelink">');
		document.write('<tr align="left" valign="middle" class="whitelink">');
		document.write('	<td height="19" class="whitelink">&nbsp;<img src="../images/general/contact-us-icon-phone.gif" width="14" height="19" border="0" alt=""></td>');
		document.write('	<td height="19" class="whitelink">&nbsp;(408) 954-8000 </td>');
		document.write('	<td height="19" class="whitelink"><img src="../images/general/contact-us-icon-fax.gif" width="14" height="19" border="0" alt=""> </td>');
		document.write('	<td height="19" class="whitelink">&nbsp;(408) 954-8840 </td>');
		document.write('	<td height="19" class="whitelink"><img src="../images/general/contact-us-icon-address.gif" width="15" height="19" border="0" alt=""></td>');
		document.write('	<td height="19" class="whitelink">&nbsp;70 bonaventura dr. san jose ca. 95134 usa </td>');
		document.write('	<td height="19" class="whitelink"><img src="../images/general/contact-us-icon-email.gif" width="14" height="19" border="0" alt=""></td>');
		document.write('	<td height="19" class="whitelink">&nbsp;<a class="whitelink" href="mailto:info@blue-silicon.com?Subject=contact us">info@blue-silicon.com</a></td>');
		document.write('</tr>\n');
		document.write('</table>\n');
		document.write('</div>	');

		document.write('<div id="contact02" style="z-index:100; position:absolute; visibility:visible; left:0; top:'+tpos+'; width:135; height:20;" >');
		document.write('<table width="135" height="18" border="0" cellspacing="0" cellpadding="0" align="center">');
		document.write('	<tr>');
		document.write('		<td width="135" height="1" align="left" bgcolor="#6F80A2"><img src="../images/general/clear.gif" width="1" height="1" border="0" alt=""></td>');
		document.write('	</tr>');
		document.write('	<tr align="left">');
		document.write('		<td width="135" height="19" align="center" valign="middle"  bgcolor="#D4D6DC" nowrap><A  OnMouseOver="show_contact();" OnMouseOut="hide_contact();" CLASS="leftnav" href="../about-us/contact-us.html"><b>contact us</b></A></td>');
		document.write('	</tr>');
		document.write('	<tr>');
		document.write('		<td width="135" height="1" align="left" bgcolor="#6F80A2"><img src="../images/general/clear.gif" width="1" height="1" border="0" alt=""></td>');
		document.write('	</tr>');
		document.write('</table>');
		document.write('</div>	');
	}
	else if(document.layers)
	// Netscape Navigator/Communicator Menu
	{
		// Navigation Menu Item
		document.write('<LAYER NAME="contact" Z-INDEX="100"  POSITION="absolute" VISIBILITY="hide" LEFT="'+lpos+'" TOP="'+tpos+'" WIDTH="620" HEIGHT="20" OnMouseOver="show_contact2('+ID+');" OnMouseOut="hide_contact();">\n');
		document.write('<table width="634" border="0" cellspacing="0" cellpadding="0" align="left" background="../images/general/contact-us-background.gif" class="whitelink">');
		document.write('<tr align="left" valign="middle" class="whitelink">');
		document.write('	<td height="19" class="whitelink">&nbsp;<img src="../images/general/contact-us-icon-phone.gif" width="14" height="19" border="0" alt=""></td>');
		document.write('	<td height="19" class="whitelink">&nbsp;(408) 954-8000 </td>');
		document.write('	<td height="19" class="whitelink"><img src="../images/general/contact-us-icon-fax.gif" width="14" height="19" border="0" alt=""> </td>');
		document.write('	<td height="19" class="whitelink">&nbsp;(408) 954-8840 </td>');
		document.write('	<td height="19" class="whitelink"><img src="../images/general/contact-us-icon-address.gif" width="15" height="19" border="0" alt=""></td>');
		document.write('	<td height="19" class="whitelink">&nbsp;70 bonaventura dr. san jose ca. 95134 usa </td>');
		document.write('	<td height="19" class="whitelink"><img src="../images/general/contact-us-icon-email.gif" width="14" height="19" border="0" alt=""></td>');
		document.write('	<td height="19" class="whitelink">&nbsp;<a class="whitelink" href="mailto:info@blue-silicon.com?Subject=contact us">info@blue-silicon.com</a></td>');
		document.write('</tr>\n');
		document.write('</table>\n');
		document.write('</LAYER>\n');


		document.write('<LAYER NAME="contact02" Z-INDEX="100"  POSITION="absolute" VISIBILITY="show" LEFT="0" TOP="'+tpos+'" WIDTH="135" HEIGHT="20">\n');
		document.write('<table width="135" height="18" border="0" cellspacing="0" cellpadding="0" align="center">');
		document.write('	<tr>');
		document.write('		<td width="135" height="1" align="left" bgcolor="#6F80A2"><img src="../images/general/clear.gif" width="1" height="1" border="0" alt=""></td>');
		document.write('	</tr>');
		document.write('	<tr align="left">');
		document.write('		<td width="135" height="19" align="center" valign="middle"  bgcolor="#D4D6DC" nowrap><A  OnMouseOver="show_contact();" OnMouseOut="hide_contact();" CLASS="leftnav" href="../about-us/contact-us.html"><b>contact us</b></A></td>');
		document.write('	</tr>');
		document.write('	<tr>');
		document.write('		<td width="135" height="1" align="left" bgcolor="#6F80A2"><img src="../images/general/clear.gif" width="1" height="1" border="0" alt=""></td>');
		document.write('	</tr>');
		document.write('</table>');
		document.write('</LAYER>\n');
	}	
}



function show_contact2()
{
	block.active = 0;
	clearTimeout(closewindows)
	if(document.all)
		{
		block = contact.style;
		contact.style.visibility='visible';
		}
	else if(document.layers)
		{
		block = document.contact;
		document.contact.visibility='show';
		}
	block.left = lpos;
}


function show_contact()
{
	hide_all();
	clear_timer();
	if(document.all)
	{
		block = contact.style;
		block.visibility='visible';
	}
	else if(document.layers)
	{
		block = document.contact;
		block.visibility='show';
	}
	block.left = parseInt(lpos);
	contacxpos = parseInt(block.left);
	block.xpos = parseInt(block.left) - parseInt(block.width);
	block.active = 1;
	slideRight();
}


function slideRight() 
{
	if (block.active) {
		if(block.xpos < lpos)
			{
			block.xpos += 2;
			block.left = block.xpos;
			closewindows = setTimeout("slideRight()", 0);
			}
	   }
}


function slideLeft()
{	
	//if(block.active)
		{
		contacxpos = parseInt(block.left);
		block.xpos = parseInt(block.left)
		var lefout = parseInt(block.left) - parseInt(block.width);
		if(block.xpos > lefout)
			{
			block.xpos -= 10;
			block.left = parseInt(block.xpos);
			closewindows = setTimeout("slideLeft()", 1);
			}
	   else
	   		{
			if(document.all)
				{contact.style.visibility='hidden';	}
			else if(document.layers)
			{document.contact.visibility='hide';};
			block.xpos = contacxpos;
			block.left = block.xpos;
			}
		}
}


function hide_contact()
{
	// hide all menus
	if(openmenu >= 0)
	{
		hide_menu(openmenu);
		var dsmi;
		k = openmenu;
		if(dMenu[k].available)
		{
			dsmi = dSubMenu[k].length;
			for(j=0; j<dsmi; j++)
			{
				hide_sub(k,j);
			}
		}
	}
	// if iExplores
	if(document.all)
	{
			block = contact.style;
			block.active = 0;
	}
	// for netscape
	else if(document.layers)
	{
			block = document.contact;
			block.active = 0;
	}
	closewindows=setTimeout("slideLeft();",500);
}


var isNetscape6 = (!document.all && !document.layers && navigator.appName == "Netscape" && parseInt(navigator.appVersion) >=5)?true:false;
var openmenu   =  -1 ;
var openitem;
var closewindows;
var count      = 0;
var contacxpos = 0
var lpos       = 0

