// BEGIN	user defined constants
	var leftMainOffset = 10;
	var topMainOffset = -5;
	var leftSubOffset = 0;
	var topSubOffset = 2;
	var popuppic = 'arrow.gif';
	var popupw = 10;
	var popuph = 10;
// END user defined constants 
	
	var menus = new Array();
	var activeMenu = -1;
	var activeMenus = new Array();
	var timer = null;
	var loaded = false;

	function quickNav() {
		if (navigator.appName == "Netscape" && navigator.appVersion.indexOf(4.7) != -1) {
			if(document.A.quick.length > 0) {
			for(var i = 0; i < document.A.quick.options.length; i++)
				if(document.A.quick.options[i].selected)
					leapTo(document.A.quick.options[i].value);
			}
		}
		else { // NTSC 6.01 and MSIE
			if(document.A.quick.length > 0) {
				leapTo(document.A.quick.value);
			}
		}
	}
	
	function checkData() {
		if (document.REQ.FORM_NAME.value == '') {
			alert("You should fill Your name !");
			document.REQ.FORM_NAME.focus();
			return false;
		}
		if (document.REQ.FORM_COMPANY.value == '') {
			alert("You should fill Your company name !");
			document.REQ.FORM_COMPANY.focus();
			return false;
		}
		if (document.REQ.FORM_EMAIL.value == '') {
			alert("You should fill Your email address !");
			document.REQ.FORM_EMAIL.focus();
			return false;
		}
		if (document.REQ.FORM_COMMENT.value == '') {
			alert("You should fill Your comments !");
			document.REQ.FORM_COMMENT.focus();
			return false;
		}
		return true;
	}


	function leapTo (link)
	{
		var new_url=link;
		if (  (new_url != "")  &&  (new_url != null)  )
			window.location=new_url;
		else
			window.location='index.htm';
	}
	
	function mainLoad() {
// outcommented
//		document.A.quick.options[0].selected = true;
	}

	function wind(adresa, width, height) {
		var o = window.open(adresa,"memo","width=" + width + ",height=" + height);
	}

	function wind_s(adresa, width, height) {
		var o = window.open(adresa,"memo","scrollbars,width=" + width + ",height=" + height);
	}

	function setTimer() {
		if (!loaded) return;
		if (timer != null) clearTimeout(timer);
		timer = setTimeout("clearMenu(0)", 200);
	}
	
	function clearTimer() {
		if (!loaded) return;
		if (timer != null) {
			clearTimeout(timer);
			timer = null;
		}
	}

	function clearAllMenu() {	
		if (!loaded) return;
		clearMenu(0);
		activeMenu = -1;
	}

	function clearMenu(level) {	
		if (!loaded) return;
		for (i = level; activeMenus.length > level && activeMenus[i] != null; i++) {
			if (document.all.item("m"+activeMenus[i]) != null) {
				document.all.item("m"+activeMenus[i]).style.display = "none";
				if (i != 0) {
					document.all.item("mi"+activeMenus[i]).className = "subOff";
					document.all.item("la"+activeMenus[i]).className = "subOff";
				}
			}
			activeMenus[i] = null;
		}
	}

	function subMenuOver(mid, id, level) {
		if (!loaded) return;
		clearTimer(); 
		if (activeMenus.length > level && activeMenus[level] != null) {
			document.all.item("m"+activeMenus[level]).style.display = "none";
			document.all.item("mi"+activeMenus[level]).className = "subOff";
			document.all.item("la"+activeMenus[level]).className = "subOff";
		}
		if (document.all.item("m"+id) != null) {
			var mmel = document.all.item("m"+mid);
			var mel = document.all.item("mi"+id);
			var el  = document.all.item("m"+id);
			mel.className = "subOn";
			document.all.item("la"+id).className = "subOn";
			el.style.posLeft = mmel.offsetLeft + mel.offsetWidth + leftSubOffset;
			el.style.posTop = mmel.offsetTop + mel.offsetTop + topSubOffset;
			el.style.display = "";
			activeMenus[level] = id;
		}
	}
	
	function subMenuOut() {
		if (!loaded) return;
		if (!event.srcElement.contains(event.toElement)) setTimer();
	}

	function subMenuClick() {
		if (!loaded) return;
		event.cancelBubble = true;
	}

	function menuLinkOver(level) {
		if (!loaded) return;
		clearTimer(); 
		clearMenu(level);
		event.srcElement.className = "subOn";
	}
	
	function menuLinkClick(url) {
		if (!loaded) return;
		event.srcElement.className = "subOff";
		clearMenu(0);
		if (url != "") window.location=url;
		event.cancelBubble = true;
	}
	
	function menuLinkOut() {
		if (!loaded) return;
		if (!event.srcElement.contains(event.toElement)) setTimer();
		event.srcElement.className = "subOff";
	}
	
	
	function mainMenuOver(id, idsub) {
		if (!loaded) return;
		clearTimer(); 
		var mel = event.srcElement;
		if (id !=	activeMenu) {
			clearMenu(0);
			activeMenu = id;
		}
		if (document.all.item("m"+ idsub) != null) {
			activeMenus[0] = idsub;
			var el = document.all.item("m"+ idsub);
			el.style.posLeft = mel.offsetLeft + leftMainOffset;
			el.style.posTop = mel.offsetTop + mel.style.pixelHeight + topMainOffset;
			el.style.display = "";
		}
//		var img = mel.src.substring(0, mel.src.length - 8);
//		mel.src = img + "_on.gif"
	}

	function mainMenuOut() {
		if (!loaded) return;
		if (!event.srcElement.contains(event.toElement)) setTimer();
//		var img = event.srcElement.src.substring(0, event.srcElement.src.length - 7);
//		event.srcElement.src = img + "_off.gif"
	}

	function writeMenus() {
		if (!document.all) return;
		for (i = 0; i < menus.length; i++) {
			document.write ("<table class='menuTable' border='0' id='m" + i + "' style='display: none; position: absolute; z-index: " + (2+menus[i][0].level) + ";' cellspacing='1' cellpadding='0' onselectstart='event.cancelBubble=true;'>");
			for (j = 1; j < menus[i].length; j++) {
				document.write ("<tr>");
				if (menus[i][j].idMenu == -1)
					document.write ("<td class='subOff' onmouseout='menuLinkOut()' onmouseover='menuLinkOver(" + menus[i][j].level + ")' onClick=\"menuLinkClick('" + menus[i][j].url + "');\">&nbsp;" + menus[i][j].label + "</td>");
				else {
					document.write ("<td class='subOff' id='mi" + menus[i][j].idMenu + "' onMouseOut='subMenuOut()' onMouseOver=\"subMenuOver(" + i + ", " + menus[i][j].idMenu + ", " + menus[i][j].level + ");\" onClick=\"subMenuClick()\">");
					document.write ("<table border='0' width='100%' cellspacing='0' cellpadding='0'>");
					document.write ("<tr>");
					document.write ("<td class='subOff' nowrap width='99%' id='la" + menus[i][j].idMenu + "'>&nbsp;" + menus[i][j].label + "</td>");
document.write ("<td width='1%'><img border='0' hspace='3' src='images/" + popuppic + "' width='" + popupw + "' height='" + popuph + "'></td>");
					document.write ("</tr>");
					document.write ("</table>");
					document.write ("</td>");				
				}
				document.write ("</tr>");
			}
			document.write ("</table>");
		}
		loaded = true;
	}
	
	function menuItem (label, url, idMenu, level) {
		this.label = label;
		this.url = url;
		this.idMenu = idMenu;
		this.level = level;
	}
	
	document.onclick = clearAllMenu;

	function writeNavBar() {
		var str = "";
		if (document.all) {
      str = "<TD><IMG border=0 height=23 style=\"cursor: hand; position: relative; width: 104; height: 23\" name=Image3 onmouseover=\"mainMenuOver(0, 0)\" onMouseOut=\"mainMenuOut()\" src=\"images/about_off.gif\" width=104></TD>";
      str += "<TD><IMG border=0 height=23 style=\"cursor: hand; position: relative; width: 104; height: 23\" name=Image3 onmouseover=\"mainMenuOver(1, 7)\" onMouseOut=\"mainMenuOut()\" src=\"images/offering_off.gif\" width=104></TD>";
      str += "<TD><IMG border=0 height=23 style=\"cursor: hand; position: relative; width: 104; height: 23\" name=Image3 onmouseover=\"mainMenuOver(2, 11)\" onMouseOut=\"mainMenuOut()\" src=\"images/jobs_off.gif\" width=104></TD>";
      str += "<TD><IMG border=0 height=23 style=\"cursor: hand; position: relative; width: 104; height: 23\" name=Image3 onmouseover=\"mainMenuOver(4, 13)\" onMouseOut=\"mainMenuOut()\" src=\"images/contact_off.gif\" width=104></TD>";
    }
    else {
      str = "<TD><A HREF=\"1.htm\"><IMG border=0 height=23 src=\"images/about_off.gif\" width=104></A></TD>";
      str += "<TD><A HREF=\"2.htm\"><IMG border=0 height=23 src=\"images/offering_off.gif\" width=104></A></TD>";
      str += "<TD><A HREF=\"3.htm\"><IMG border=0 height=23 src=\"images/jobs_off.gif\" width=104></A></TD>";
      str += "<TD><A HREF=\"4.htm\"><IMG border=0 height=23 src=\"images/contact_off.gif\" width=104></A></TD>";
    }
    document.write(str);
	}

