// JavaScript Document

var ie5=document.all && !window.opera;
var opera = window.opera;
var isOverTab = false;

function tabOut() {
	if (!isOverTab) { hideTabs() };
}

function writeMenuItem(txtItem,txtLink,intWidth,menuCellBG,menuCellBGover) {
	document.write("<tr><td class=\"menuCell\"><a href=\"" + txtLink + "\" class=\"menuLink\"  style='text-decoration:hover;'>");
	document.write("<div class=\"" + menuCellBG + "\" onMouseover=\"" + menuCellBGover + "\" ");
	document.write(" onMouseout=\"this.style.backgroundColor='';\" style=\"hover:underline;width:" + intWidth + "\" ");
	document.write(" onclick=\"location.href='" + txtLink + "'\">");
	document.write("<div style='margin-left:6px;'>" + txtItem + "<\/div>");
	document.write("<\/div><\/a><\/td><\/tr>");
}

function writeTab(txtObjName,txtTitle,txtMenuTitle,arrMenuItems,tabLink,intWidth,menuCellBG,intOffset,menuTable,menuHeader,menuBox,tabShadow,menuCellBGover,menuCellBorder,mainTabDiv) {
	document.write("<div id=\"" + txtObjName + "\" class=\"" + mainTabDiv + "\" onMouseOut=\"isOverTab=false;menuTimer = setTimeout('tabOut()',2000)\" onMouseOver=\"isOverTab=true\">");
	document.write("	<span style=\"position:absolute\" id=\"" + txtObjName + "_wrap\"  onMouseOut=\"isOverTab=false;menuTimer = setTimeout('tabOut()',2000)\" onMouseOver=\"isOverTab=true\"");
	document.write("	><span id=\"" + txtObjName + "_menu\" class=\"menuSpan\" style=\"left:" + intOffset + "px;text-indent:" + intOffset + ";\"  onMouseOut=\"isOverTab=false;menuTimer = setTimeout('tabOut()',2000)\" onMouseOver=\"isOverTab=true\">");
		document.write(		"<table class=\"" + menuTable + "\" cellpadding=\"0\" cellspacing=\"0\"  onMouseOut=\"isOverTab=false;menuTimer = setTimeout('tabOut()',2000)\" onMouseOver=\"isOverTab=true\"");
		document.write(" 		width=\"" + intWidth + "\" "); 
		document.write(">		<tr>");
		document.write("			<th>");
		document.write("				<div class=\"" + menuHeader + "\" style=\"width:" + intWidth + "\">");
		document.write(						"<div style='margin-left:6px'>" + txtMenuTitle + "<\/div>");
		document.write("				<\/div>	");
		document.write("			<\/th>");
		document.write("		<\/tr>");
		if (arrMenuItems) {
			for (var itemCount = 0; itemCount < arrMenuItems.length; itemCount++) {
				writeMenuItem(arrMenuItems[itemCount][0],arrMenuItems[itemCount][1],intWidth,menuCellBG,menuCellBGover);
			}
		}		
		document.write("		<\/table>");
	document.write(		"<\/span");
	document.write("	><\/span>");
	
	document.write("	<a href=\"");
	if (tabLink) {
		document.write( + tabLink + "\" ");
	} else {
		document.write(	"javascript:void(0);\" ");
	}
	document.write(		" onmouseover=\"javascript:showSection('" + txtObjName + "');window.status='';\" title=\"\">");
	
		if (ie5) {
		document.write("		<div id=\"" + txtObjName + "_box\" class=\"" + menuBox + "\" onmouseover=\"window.status=''; " + menuCellBorder + "\" ");
	} else {
		document.write("		<center><div id=\"" + txtObjName + "_box\" class=\"" + menuBox + "\" onmouseover=\"window.status=''; " + menuCellBorder + "\" ");   
	}
	
	if (tabLink) { 				document.write(" style=\"cursor:pointer;\" "); }
	document.write("			>");		
	if (ie5) {
		document.write("		<div style=\"width:114px;height:145px;cursor:pointer;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + imgPath + txtObjName + "_114x145.jpg',sizingMethod='scale');\"><\/div>");
	} else {
		document.write("		<img src='" + imgPath + txtObjName + "_114x145.jpg' border='0' width='114' height='145'>");   
	}
	
		if (ie5) {
		document.write("		<\/div>");
	} else {
		document.write("		<\/div><\/center>");   
	}
	
	document.write("	<\/a>");
	document.write("	<span class=\"tabTitle\"  onMouseOut=\"isOverTab=false;menuTimer = setTimeout('tabOut()',2000)\" onMouseOver=\"isOverTab=true\" ");
	document.write(">" + txtTitle + "<\/span>");
	document.write("<\/div>");
}

document.write ("<table class=\"sectionTable\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>");
document.write ("<td>&nbsp;<\/td><td class=\"sectionTd1\">");
	writeTab(	"domaine_mecanique",	progSector1,		progDescription1,		progLinks1,			null,			160,			"menuCellBG1",		-81,			"menuTable1",	"menuHeader1",	"menuBox1",		"tabShadow1",		"this.style.backgroundColor='#aaaaaa';",	"this.style.border='';",	"mainTabDiv1");
document.write ("<\/td>");
document.write ("<td>&nbsp;<\/td><td class=\"sectionTd2\">");
	writeTab(	"domaine_naval",		progSector2,		progDescription2,		progLinks2,			null,			160,			"menuCellBG2",		-81,			"menuTable2",	"menuHeader2",	"menuBox2",		"tabShadow2",		"this.style.backgroundColor='#aaaaaa';",	"this.style.border='';",	"mainTabDiv2");
document.write ("<\/td>");
document.write ("<td>&nbsp;<\/td><td class=\"sectionTd3\">");
	writeTab(	"domaine_batiment",		progSector3,		progDescription3,		progLinks3,			null,			160,			"menuCellBG3",		-81,			"menuTable3",	"menuHeader3",	"menuBox3",		"tabShadow3",		"this.style.backgroundColor='#aaaaaa';",	"this.style.border='';",	"mainTabDiv3");
document.write ("<\/td>");
document.write ("<td>&nbsp;<\/td><td class=\"sectionTd4\">");
	writeTab(	"domaine_metallique",	progSector4,		progDescription4,		progLinks4,			null,			160,			"menuCellBG4",		-81,			"menuTable4",	"menuHeader4",	"menuBox4",		"tabShadow4",		"this.style.backgroundColor='#aaaaaa';",	"this.style.border='';",	"mainTabDiv4");
document.write ("<\/td><td>&nbsp;<\/td>");

var oldSec = false;
var oldSecShadow = false;
var oldSecMenu = false;

function hideTabs() {
	if (oldSec && oldSecMenu) {
		oldSec.style.border = "none";
		oldSecMenu.style.visibility = "hidden";
		oldSec.style.backgroundColor = "";
	}
}

function showSection(id)
{
	var secWrap = document.getElementById(id + "_wrap");
	var secTab = document.getElementById(id + "_box");
	var secMenu = document.getElementById(id + "_menu");
	if (!ie5 && !opera) {
		secMenu.style.left =  secMenu.style.textIndent.substring(0,secMenu.style.textIndent.length - 10) - 81;
	}
	secTab.style.backgroundColor = "";
	secTab.style.border = "none";
	secMenu.style.top = secWrap.parentNode.offsetTop - (secMenu.offsetHeight) - secTab.offsetTop +8 ;
	if (oldSec != secTab) {
		hideTabs();
	}
	secMenu.style.visibility = "visible";
	oldSec = secTab;
	oldSecMenu = secMenu;
}		

document.write ("<\/tr>");
document.write ("<\/table>");
//document.write ("<\/div>");

