ns = (document.layers)? true:false
ie = (document.all)? true:false
ns6 = (navigator.appName == "Netscape" && document.getElementById)? true:false
winIE5 = false;
var browserString = navigator.appVersion;
if (navigator.userAgent.indexOf("Win") > -1 && navigator.appName == "Microsoft Internet Explorer"){
	if (parseInt(browserString.charAt(22)) < 6){
		winIE5 = true;
	}
}
macIE = false;
var browserString = navigator.appVersion;
if (navigator.userAgent.indexOf("Mac") > -1 && navigator.appName == "Microsoft Internet Explorer"){
	macIE = true;
}
function hide(id){
	if (ns) document.layers[id].visibility = "hide"
	if (ns6){
		var obj = eval("document.getElementById('" + id + "')")
		obj.style.visibility = "hidden"
	}
	else if (ie) document.all[id].style.visibility = "hidden"
}
function show(id){
	if (ns) document.layers[id].visibility = "show"
	if (ns6){
		var obj = eval("document.getElementById('" + id + "')")
		obj.style.visibility = "visible"
	}
	else if (ie) document.all[id].style.visibility = "visible"
}
function openWin(page,name,width,height,scroll,resize){
window.open(page,name,"toolbar=0,location=0,status=0,menubar=0,scrollbars=" + scroll + ",resizable=" + resize + ",top=0,left=0,width=" + width + ",height=" + height)
}
//Needed for form validation:
var whitespace = " \t\n\r";
function isEmpty(s){   
	return ((s == null) || (s.length == 0));
}
function isStringWhitespace(s){   
	var i;
	if (isEmpty(s)) return true;
	for (i = 0; i < s.length; i++)
	{
		var c = s.charAt(i);
		if (whitespace.indexOf(c) == -1) return false;
	}
	return true;
}
//

loaded = false;
mainNavs = 0;
totalSubs = 6;
totalSubSubs = 4;
function mainNavMouse(ele,state,Lid){
	if(loaded){
		if(state > 0){
			//ele.style.backgroundColor='333333';
			//ele.style.color='FFD817';
			if(ie){
				for(x = 0; x < mainNavs; x ++){
					if(x == Lid){
						ele.style.backgroundColor='333333';
						ele.style.color='FFD817';
					}else{
						document.all["mainNavTD" + x].style.backgroundColor='000000';
						if( x == mainNavHighLight ){
							document.all["mainNavTD" + x].style.color='FFD817';
						}else{
							document.all["mainNavTD" + x].style.color='ffffff';
						}
					}
				}
			}else if(ns6){
				for(x = 0; x < mainNavs; x ++){
					if(x == Lid){
						ele.style.backgroundColor='333333';
						ele.style.color='FFD817';
					}else{
						var obj = eval("document.getElementById('mainNavTD" + x + "')")
						obj.style.backgroundColor='000000';
						if( x == mainNavHighLight ){
							obj.style.color='FFD817';
						}else{
							obj.style.color='ffffff';
						}
					}
				}
			}
			for(i = 0; i < totalSubs; i ++){
				if(i == Lid){
					show("subMenu" + i);
				}else{
					hide("subMenu" + i);
				}
			}
			for(j = 0; j < totalSubSubs; j ++){
				hide("subsubMenu" + j);
			}
			if(!ns){
				resetAllRows();
			}
			show("bigHide");
		}
	}
}
function showSubNS(n){
	if(loaded){
		for(x = 0; x < mainNavs; x ++){
			if(x == n){
				show("subMenu" + x);
			}else{
				hide("subMenu" + x);
			}
		}
		show("bigHide");
	}
}
function showSubSub(ele, hasSub, subIndex){
	//ele.style.color = "FFD817";
	for( b = 0; b < totalSubSubs; b ++){
		if( hasSub > 0 && b == subIndex ){
			show("subsubMenu" + b);
		}else{
			hide("subsubMenu" + b);
		}
	}
}
function showSubSubTest(ele, hasSub, subIndex, rowID){
	//ele.style.color = "FFD817";
	//alert(rowID);
	//alert(macIE);
	if(!macIE){
		for(i = 0; i < totalRows; i ++){
			if(i == rowID){
				if(ns6){
					var obj = eval("document.getElementById('row" + i + "')")
					obj.style.backgroundColor='575252';
					obj.style.color='FFD817';
				}else{
					if(!winIE5){
						document.all["row" + i].style.backgroundColor='575252';
						document.all["row" + i].style.color='FFD817';
					}
				}
			}else{
				if(ns6){
					var obj = eval("document.getElementById('row" + i + "')")
					obj.style.backgroundColor='333333';
					obj.style.color='ffffff';
				}else{
					if(!winIE5){
						document.all["row" + i].style.backgroundColor='333333';
						document.all["row" + i].style.color='ffffff';
					}
				}
			}
		}
	}
	for( b = 0; b < totalSubSubs; b ++){
		if( hasSub > 0 && b == subIndex ){
			show("subsubMenu" + b);
		}else{
			hide("subsubMenu" + b);
		}
	}
}
function resetAllRows(){
	for(i = 0; i < totalRows; i ++){
		if(ns6){
			var obj = eval("document.getElementById('row" + i + "')")
			obj.style.backgroundColor='333333';
			obj.style.color='ffffff';
		}else{
			document.all["row" + i].style.backgroundColor='333333';
			document.all["row" + i].style.color='ffffff';
		}
	}
}
function hideEverything(){
	//if(loaded){
		if(!ns){
			resetAllRows();
		}
		for(i = 0; i < totalSubs; i ++){
			hide("subMenu" + i);
		}
		if(!ns){
			for(j = 0; j < totalSubSubs; j ++){
				hide("subsubMenu" + j);
			}
		}
		hide("bigHide");
		if(ie){
			for(x = 0; x < mainNavs; x ++){
				document.all["mainNavTD" + x].style.backgroundColor='000000';
				if( x == mainNavHighLight ){
					document.all["mainNavTD" + x].style.color='FFD817';
				}else{
					document.all["mainNavTD" + x].style.color='ffffff';
				}
			}
		}else if(ns6){
			for(x = 0; x < mainNavs; x ++){
				var obj = eval("document.getElementById('mainNavTD" + x + "')")
				obj.style.backgroundColor='000000';
				if( x == mainNavHighLight ){
					obj.style.color='FFD817';
				}else{
					obj.style.color='ffffff';
				}
			}
		}
	//}
}
theWidth = new Array()
	theWidth[0] = 143;//"'17%'";//
	theWidth[1] = 120;//"'16%'";//
	theWidth[2] = 120;//"'16%'";//
	theWidth[3] = 120;//"'16%'";//
	theWidth[4] = 120;//"'16%'";//
	theWidth[5] = 120;//"'16%'";//
outHtml = "";
function makeMainNav(highLight){
	for(i = 0; i < mainNav.length; i ++){
		mainNavs ++;
		space = "";
		alignment = "";
		if(i == 0){
			//space = "";
			//alignment = "align=center";
		}else if(i == 1){
			alignment = "align=center";
			//space = "<img src='../images/spacer.gif' height=1 width=5 align=absmiddle>";
		}else if(i > 1 && i < 5){
			alignment = "align=center";
		}else{
			alignment = "align=center";//"align=right";
			//space = "<img src='../images/spacer.gif' height=1 width=12 align=absmiddle>";
		}
		if( i == highLight ){
			theClass = "On";
			color = "FFD817";
		}else{
			theClass = "";
			color = "ffffff";
		}
		if(ns){
			//theLink = "<a href='" + mainNav[i].goLink + "' class='navele" + theClass + "'>" + mainNav[i].displayText + "</a>";
		}else if(winIE5){
			theLink = "<font class='naveleIE5" + theClass + "'><a href='" + mainNav[i].goLink + "'>" + mainNav[i].displayText; + "</a></font>";
		}else{
			theLink = mainNav[i].displayText;
		}
		if(ns){
			outHtml += "<td width=" + theWidth[i] + "><ilayer name='mainNavTD" + i + "'><layer width=" + theWidth[i] + " class='NSMenu' onMouseOver=\"showSubNS(" + i + ");this.bgColor='333333';\" onMouseOut=\"this.bgColor='000000';\"><a href='" + mainNav[i].goLink + "'><font face='arial' size=1 color='" + color + "'><b>" + mainNav[i].displayText + "</b></font></a><br><img src='../images/spacer.gif' width=1 height=5></layer></ilayer></td>";
		}else{
			outHtml += "<td id='mainNavTD" + i + "' class='navele" + theClass + "' onMouseOver=\"mainNavMouse(this,1," + i + ");\" " + alignment + " width=" + theWidth[i] + " onClick=\"parent.location='" + mainNav[i].goLink + "';\" nowrap>" + space + theLink + "</td>";
		}
	}
document.write(outHtml);
}
function findPosX(obj){
	var curleft = 0;
	if (document.getElementById || document.all){
		while (obj.offsetParent){
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
		//alert(curleft);
		return curleft;
	}
}
totalRows = 0;
thisLayer = "";
master_top = 86;
function makeSubNav(){
	theWidth = new Array()
	theWidth[0] = 155;//140;
	theWidth[1] = 155;//123;
	theWidth[2] = 155;//124;
	theWidth[3] = 155;//119;
	theWidth[4] = 155;//121;
	theWidth[5] = 155;//120;
	if(ns){
		//alert(totalSubs);
		for(i = 0; i <= totalSubs; i ++){
			//alert(i);
			thisSub = eval("sub" + i);
			if(i == 0){
				thisLayer += "<div id='mud' style='position:absolute; left:0px; top:0px; visibility:hidden'></div>";
			}
			if(thisSub.length == 0){
				//alert("yes. subMenu" + i);
				thisLayer += "<div id='subMenu" + i + "' style=\"position:absolute; left:0px; top:0px; visibility:hidden;\"></div>";
			}else{
				//alert(thisSub.length);
				curLayer = document.layers["mainNavTD" + i];
				thisLayer += "<div id='subMenu" + i + "' style=\"position:absolute; left:" + curLayer.pageX + "px; top:" + master_top + "px; visibility:hidden; z-index:10;\">";
				thisLayer += "<table cellpadding=0 cellspacing=0 border=0 bgcolor='000000'>";
				for(j = 0; j < thisSub.length; j ++){
					thisLayer += "<tr><td><ilayer><layer width=155 class='NSMenu' onMouseOver=\"this.bgColor='333333';\" onMouseOut=\"this.bgColor='000000';\"><a href='" + thisSub[j].goLink + "'><font face='arial' size=1 color='ffffff'><b>" + thisSub[j].displayText + "</b></font></a></layer></ilayer></td></tr>";
				}
				thisLayer += "</table></div>";
			}
		}
		thisLayer += "<div id='bigHide' style=\"position:absolute; left:0px; top:" + master_top + "px; visibility:hidden; z-index:2;\"><a href='#' onMouseOver=\"hideEverything();\"><img src='../images/spacer.gif' height=300 width=766 border=0></a></div>";
		document.write(thisLayer);
		loaded = true;
		//alert(thisLayer);
	}else{
		/*subSubArrwWidth = new Array();
		subSubArrwWidth[0] = 55;
		subSubArrwWidth[1] = 57;
		subSubArrwWidth[2] = 45;
		subSubArrwWidth[3] = 5;*/
		thisLayer += "<div id='bigHide' style=\"position:absolute; left:0px; top:" + master_top + "px; visibility:hidden; z-index:2;\"><a href='#' onMouseOver='hideEverything()'><img src='../images/spacer.gif' height=300 width=766 border=0></a></div>";
		for(i = 0; i < totalSubs; i ++){
			thisSub = eval("sub" + i);
			if(thisSub.length == 0){
				thisLayer += "<div id='subMenu" + i + "' style=\"position:absolute; left:0px; top:0px; visibility:hidden;\"></div>";
			}else{
				if (ie)
					currentEle = document.all("mainNavTD" + i);
				else if(ns6){
					currentEle = document.getElementById("mainNavTD" + i);
				}
				leftPos = findPosX(currentEle);
				thisLayer += "<div id='subMenu" + i + "' style=\"position:absolute; left:" + leftPos + "px; top:" + master_top + "px; visibility:hidden; z-index:10;\">";
				thisLayer += "<table cellpadding=0 cellspacing=0 border=0 width=" + theWidth[i] + "><tr><td bgcolor='000000'><img src='../images/spacer.gif'></td></tr>";
				for(j = 0; j < thisSub.length; j ++){
					if(thisSub[j].hasSub > 0){
						//theArrw = "  >";
						thisSubSubArrw = eval("subsub" + thisSub[j].subIndex);
						theArrw = "<img src='../images/spacer.gif' width='" + thisSubSubArrw[0].subSubArrwWidth + "' height='18' border=0 align=absmiddle><img src='../images/shared/arrw_white.gif'>";// + thisSubSubArrw[0].subSubArrwWidth;
					}else{
						theArrw = "";
					}
					if(winIE5){
						theLink = "<font class='naveleIE5sub'><a href='" + thisSub[j].goLink + "'>" + thisSub[j].displayText + theArrw + "</a></font>";
					}else{
						theLink = thisSub[j].displayText + theArrw;
					}
					thisLayer += "<tr class='subNavRow'><td id='row" + totalRows + "' class='navSub' onMouseOver=\"showSubSubTest(this," + thisSub[j].hasSub + "," + thisSub[j].subIndex + "," + totalRows + ");\" onClick=\"parent.location = '" + thisSub[j].goLink + "';\">" + theLink + "</td></tr>";

					totalRows ++;
				}
				thisLayer += "</table></div>";
			}
		}
		document.write(thisLayer);
		//alert(totalRows);
		makeSubSubNav();
		//loaded = true;
	}
}
thisSubLayer = "";
function makeSubSubNav(){
	if(ns){

	}else{
		for(a = 0; a < totalSubSubs; a ++){
			thisSubSub = eval("subsub" + a);
			if(a == 2 || a == 3){
				if (ie)
					currentEle = document.all("mainNavTD4");
				else if(ns6){
					currentEle = document.getElementById("mainNavTD4");
				}
				leftPos = findPosX(currentEle);
				leftPos += 130;
			}else{
				leftPos = thisSubSub[0].leftPos;
			}
			thisSubLayer += "<div id='subsubMenu" + a + "' style=\"position:absolute; left:" + leftPos + "px; top:" + thisSubSub[0].topPos + "px; visibility:hidden; z-index:10;\">"
			if(a > 1){
				theWidth = 120;
			}else{
				theWidth = 150;
			}
			thisSubLayer += "<table cellpadding=0 cellspacing=0 border=0 width=" + theWidth + "><tr><td bgcolor='000000'><img src='../images/spacer.gif'></td></tr>";
			for(b = 0; b < thisSubSub.length; b ++){
				if(winIE5){
					theLink = "<font class='naveleIE5sub'><a href='" + thisSubSub[b].goLink + "'>" + thisSubSub[b].displayText; + "</a></font>";
				}else{
					theLink = thisSubSub[b].displayText;
				}
				thisSubLayer += "<tr class='subNavRow'><td class='navSub' onMouseOver=\"this.style.color='FFD817';this.style.backgroundColor='726A6A';\" onMouseOut=\"this.style.color='ffffff'; this.style.backgroundColor='333333';\" onClick=\"parent.location = '" + thisSubSub[b].goLink + "';\">" + theLink + "</td></tr>";
			}
			thisSubLayer += "</table></div>";
		}
		document.write(thisSubLayer);
		loaded = true;
	}
}
function menuItem(displayText,goLink,hasSub,subIndex,leftPos,topPos,subSubArrwWidth){
	this.displayText = displayText;
	this.goLink = goLink;
	this.hasSub = hasSub;
	this.subIndex = subIndex;
	this.leftPos = leftPos;
	this.topPos = topPos;
	this.subSubArrwWidth = subSubArrwWidth;
}
mainNav = new Array();
	mainNav[0] = new menuItem("PRODUCTS & SERVICES","../products/default.asp");
	mainNav[1] = new menuItem("TECHNOLOGY","../tech/default.asp");
	mainNav[2] = new menuItem("APPLICATIONS","../apps/default.asp");
	mainNav[3] = new menuItem("NEWS & EVENTS","../new/news.asp");
	mainNav[4] = new menuItem("ABOUT KORTEC","../company/default.asp");
	mainNav[5] = new menuItem("CONTACT US","../contact/contact.asp");
sub0 = new Array();
	sub0[0] = new menuItem("Products","../products/products.asp",1,0,23);
	sub0[1] = new menuItem("Services","../services/default.asp",1,1);
sub1 = new Array();
	sub1[0] = new menuItem("Multi-Layer Co-Injection","../tech/coinjection.asp",0,0,163);
	sub1[1] = new menuItem("Barrier Performance","../tech/barrier_bottles.asp");
sub2 = new Array();
	sub2[0] = new menuItem("Juice Products","../apps/juices.asp",0,0,286);
	sub2[1] = new menuItem("Beer","../apps/beer.asp");
	sub2[2] = new menuItem("Carbonated Beverages","../apps/carbonated.asp");
	sub2[3] = new menuItem("Tomato-based Products","../apps/tomato.asp");
	sub2[4] = new menuItem("Milk","../apps/milk.asp");
	sub2[5] = new menuItem("Coffee / Tea","../apps/coffee_tea.asp");
	sub2[6] = new menuItem("Alternative Malt Beverages","../apps/malternatives.asp");
	sub2[7] = new menuItem("Paint","../apps/paint.asp");
	sub2[8] = new menuItem("Medical Containers","../apps/medical.asp");
	sub2[9] = new menuItem("Chemicals","../apps/chemicals.asp");
sub3 = new Array();
	sub3[0] = new menuItem("Kortec in the News","../new/in-the-news.asp",0,0,409);
	/*sub3[0] = new menuItem("Upcoming Events","../new/events.asp",0,0,409);
	sub3[1] = new menuItem("News","../new/news.asp");*/
	//alert("hello");
sub4 = new Array();
	sub4[0] = new menuItem("History","../company/history.asp");//,1,2,527
	sub4[1] = new menuItem("Management","../company/management.asp");
	sub4[2] = new menuItem("Employment Opportunities","../company/employment.asp");
	//sub4[3] = new menuItem("Contact Us","../company/contact.asp",1,3);
sub5 = new Array();
	sub5[0] = new menuItem("Request Brochure","../contact/brochure.asp");
	sub5[1] = new menuItem("Directions","../contact/directions.asp");
subsub0 = new Array();
	subsub0[0] = new menuItem("Pro Series","../products/pro.asp",0,0,148,86,55);
	subsub0[1] = new menuItem("Ultra Series","../products/ultra.asp");
	subsub0[2] = new menuItem("Intro Series","../products/intro.asp");
	subsub0[3] = new menuItem("Lab Series","../products/lab.asp");
	subsub0[4] = new menuItem("M.P.I.S.","../products/multilayer_preform.asp");
subsub1 = new Array();
	subsub1[0] = new menuItem("Materials Technology","../services/materials_technology.asp",0,0,148,105,57);
	subsub1[1] = new menuItem("Preform Designs","../services/preform_designs.asp");
	subsub1[2] = new menuItem("Process","../services/process.asp");
	subsub1[3] = new menuItem("Training","../services/training.asp");
subsub2 = new Array();
	subsub2[0] = new menuItem("History","../company/history.asp",0,0,638,86,37);
	subsub2[1] = new menuItem("Management","../company/management.asp");
subsub3 = new Array();
	subsub3[0] = new menuItem("Request Brochure","../company/brochure.asp",0,0,638,143,48);
	subsub3[1] = new menuItem("Directions","../company/directions.asp");
