<!--
//preLoads images 
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function brwOnload(doc) {
  var i=0
  var btnDiv
  var btn
  var btnText
  
  if (doc.all)
  {
    for (i=0; i<doc.all.length; i++) {
      if (doc.all(i).id.substr(0,1) == "l") {
		  btnDiv = doc.all(i);
		  btnDiv.style.cursor = "hand";
		  btn = btnDiv.children(0);
		  btnText = btnDiv.children(1);
		  btnOriginal(btnText,btn);
	  }
	}
  }
  else if (doc.layers)
  {
    alert("The MKI corporate website does not support Netscape Navigator 4.+." + 
	  "\rWe suggest using Internet Explorer 4.0 or greater" +
	  " or Netscape Navigator 6.0 or greater." + 
	  "\r\rThe latest Netscape Navigator browser can be downloaded from:" + 
	  "\rhttp://browsers.netscape.com/browsers/main.tmpl" +
	  "\r\rYou may continue to browse our corporate site but you may encounter errors, " +
	  "\rand incorrectly formatted pages.\r\rWe apologize for any inconvenience this may cause."); 
  }
  else
  {
    btnDiv = doc.getElementsByTagName("DIV");
    for (i=0; i<btnDiv.length; i++) {
		if (btnDiv[i].id.substr(0,1) == "l") {
		  	btnDiv[i].style.cursor = "pointer";
		  	btnText = btnDiv[i].firstChild.nextSibling.nextSibling.nextSibling;
		  	btn = btnDiv[i].firstChild.nextSibling;
		  	btnOriginal(btnText,btn);
		}
	}
  }
}

function btnFunction(btnID, fHighlight, fClick, doc) {
  var btnText = getButtonText(btnID, doc)
  var btn = getButton(btnID, doc)
  var frmMain = window.parent.parent.frames["mainFrame"]
  var frmSideNav = window.parent.parent.frames["leftFrame"]
  var hCurrent = frmMain.hButton
  var nCurrent = frmMain.nButton
  
  if (fClick) {
  	if (btnID.substr(0,3) == "btn") {
  		if (btnID == "btnHome") {
  			parent.parent.location.href = "home.htm"
  		}
  		else if (btnID == "btnAbout") {
  			parent.parent.location.href = getAbsRoot() + "/About.htm"
  		}
  		else {
			parent.parent.location.href = "Main.htm?" + btnID.substr(3) + ".htm"
			//frmMain.document.location.href = getAbsRoot() + "/" + btnID.substr(3) + ".htm";
		}
	}
	else {
		parent.parent.location.href = getAbsRoot()+ "/Main.htm?" + 
		 frmSideNav.document.location.href.substr(0,
		 frmSideNav.document.location.href.lastIndexOf("/")) + "/" + btnID.substr(3) + ".htm"
		//frmMain.document.location.href = btnID.substr(3) + ".htm";
	}
  }
  if (fHighlight && !((btnID == hCurrent) || (btnID == nCurrent))) 
   {btnHighlight(btnText,btn);}
  else if (btnID == hCurrent || btnID == nCurrent)
   {btnCurrent(btnText,btn);}
  else {btnOriginal(btnText,btn);}
}

function btnHighlight(btnText, btn) {
   	if (btn.name == "btnAbout") {
		btn.src = getAbsRoot() + "/images/SideNav/Button_Highlight.gif";
   		btnText.style.color = "#FFFFFF";
	}
	else if (btn.name.substr(0,3) == "btn") {
   		btn.src = getRoot(btn) + "/Button_Highlight.gif";
   		btnText.style.color = "#FFFFFF";
	}
	else if (btn.name.substr(0,3) == "nav") {
		btn.src = getAbsRoot() + "/images/SideNav/ButtonBar_highlight.gif";
		if (btnText.all && msieversion() >= 5.5) {btnText.filters.dropshadow.enabled = 1;}
	}
	else {alert("Invalid buttonID for btnHighlight function");}
}

function btnCurrent(btnText, btn) {
	if (btn.name == "btnAbout") {
		btn.src = getAbsRoot() + "/images/SideNav/Button_Highlight.gif";
   		btnText.style.color = "#FFFFFF";
	}
	else if (btn.name.substr(0,3) == "btn") {
   		btnText.style.color = "#0066FF";
   		btn.src = getRoot(btn) + "/Button_Current.gif";
	}
	else if (btn.name.substr(0,3) == "nav") {
		//btn.src = getAbsRoot() + "/images/SideNav/ButtonBar_highlight.gif";
		btnText.style.color = "#CC0000";
	}
	else {alert("Invalid buttonID for btnCurrent function");}
}

function btnOriginal(btnText, btn) {
   	if (btn.name == "btnAbout") {
		btn.src = getRelRoot() + "/Button.gif";
   		btnText.style.color = "#0000CC";
	}
	else if (btn.name.substr(0,3) == "btn") {
   		btn.src = getRoot(btn) + "/Button.gif";
   		btnText.style.color = "#0000CC";
	}
	else if (btn.name.substr(0,3) == "nav") {
		btn.src = getRelRoot() + "/ButtonBar.gif";
		btnText.style.color = "#0000CC";
		if (btnText.all && msieversion() >= 5.5) {btnText.filters.dropshadow.enabled = 0;}
	}
	else {alert("Invalid buttonID for btnOriginal function");}
}

function getButton(btnID, doc) {
  var btn
  
  if (doc.all) {btn = doc.all(btnID);}
  else if (!doc.layers) {btn = doc.images[btnID];}
  return btn;
}

function getButtonText(btnID, doc) {
  var btnText
  
  if (doc.all) {btnText = doc.all(btnID+"text");}
  else if (!doc.layers) {btnText = doc.getElementById(btnID+"text");}
  return btnText;
}

function NavReload() {
	if (parent.parent.topFrame.Header_Loaded) {
		setFrames()
	}
	else {
		setTimeout("NavReload()",1000);
	}
}

function setFrames() {
	setHeader();
	loadSideNav();
	setSubNav();
}

function setHeader() {
	var frmHeader = window.parent.parent.frames["topFrame"]
	var hCurrent = window.parent.parent.frames["mainFrame"].hButton
	var btn 
    var btnText
	
	brwOnload(frmHeader.document);
	if (hCurrent) {
		btn = getButton(hCurrent, frmHeader.document);
		btnText = getButtonText(hCurrent, frmHeader.document);
		btnCurrent(btnText, btn);
	}
}

function setSideNav() {
	var frmSideNav = window.parent.parent.frames["leftFrame"]
	var frmMain = window.parent.parent.frames["mainFrame"]
	var nCurrent = frmMain.nButton
	var btn 
    var btnText
	
	brwOnload(frmSideNav.document);
	if (nCurrent) {
		btn = getButton(nCurrent, frmSideNav.document);
		btnText = getButtonText(nCurrent, frmSideNav.document);
		if(btn) {btnCurrent(btnText, btn);}
	}
}

function loadSideNav() {
	var frmHeader = window.parent.parent.frames["topFrame"];
	var frmMain = window.parent.parent.frames["mainFrame"];
	var frmSideNav = window.parent.parent.frames["leftFrame"];
	var hCurrent = frmMain.hButton.substring(3);
	var sButton = frmMain.sButton;
	var strPath
	var hRef = frmSideNav.document.location.href;
	
	if (hCurrent == "") {
		setSideNav();
		return;
	}
	strPath = frmHeader.document.location.href;
	strPath = strPath.substring(0,strPath.lastIndexOf("/"));
	if (sButton) {
		if (sButton.substr(0,3) == "nav") {
			strPath = strPath + "/" + hCurrent + "/nav" + sButton.substring(3) + ".htm";
			frmSideNav.document.location.replace(strPath);
		}
		else {
			strPath = strPath + "/" + hCurrent + "/" + sButton + "/nav" + sButton + ".htm";
			if (hRef != strPath) {frmSideNav.document.location.replace(strPath);}
			else {setSideNav();}
		}
	}
	else {
		strPath = strPath + "/" + hCurrent + "/nav" + hCurrent + ".htm";
		if (hRef != strPath) {frmSideNav.document.location.replace(strPath);}
		else {setSideNav();}
	}
}

function setSubNav() {
	var frmHeader = window.parent.parent.frames["topFrame"]
	var frmMain = window.parent.parent.frames["mainFrame"]
	var frmsubNav = window.parent.parent.frames["subNav"]
	var hCurrent = frmMain.hButton
	var nButton = frmMain.nButton
	var sButton = frmMain.sButton
	var strPath
	
	strPath = frmHeader.document.location.href;
	strPath = strPath.substring(0,strPath.lastIndexOf("/"));
	if (sButton) {
		if (sButton.substr(0,3) != "nav") {
			frmsubNav.document.location.replace(strPath + "/" + hCurrent.substr(3) + "/"
			 + sButton + "/" + sButton + ".htm");
			getButton(hCurrent.substring(3) + "_bar", frmHeader.document).style.visibility = "visible";
		}
		else {
			frmsubNav.document.location.replace(strPath + "/Blank.htm");
			getButton("Products_bar", frmHeader.document).style.visibility = "hidden";
			getButton("Applications_bar", frmHeader.document).style.visibility = "hidden";
		}
	}
	else {
		frmsubNav.document.location.replace(strPath + "/Blank.htm");
		//if (frmHeader.document.all.length<=5) {frmHeader.document.reload}
		getButton("Products_bar", frmHeader.document).style.visibility = "hidden";
		getButton("Applications_bar", frmHeader.document).style.visibility = "hidden";
	}
}

function msieversion()
// Return Microsoft Internet Explorer (major) version number, or 0 for others.
// This function works by finding the "MSIE " string and extracting the version number
// following the space, up to the semicolon
{
    var ua = window.navigator.userAgent
    var msie = ua.indexOf ( "MSIE " )
    
    if ( msie > 0 )        // is Microsoft Internet Explorer; return version number
        return parseFloat ( ua.substring ( msie+5, ua.indexOf ( ";", msie ) ) )
    else
        return 0    // is other browser
}

function setPointer(doc) {
  var i=0;
  var btnDiv
  
  if (doc.all)
  {
    for (i=0; i<doc.all.length; i++) {
      if (doc.all(i).id.substr(0,1) == "l") {
		  btnDiv = doc.all(i);
		  btnDiv.style.cursor = "hand";
	  }
	}
  }
  else if (!doc.layers) {
    btnDiv = doc.getElementsByTagName("DIV")
    for (i=0; i<btnDiv.length; i++) {
		if (btnDiv[i].id.substr(0,1) == "l") {
		  	btnDiv[i].style.cursor = "pointer";
		}
	}
  }
}

function getRoot(btn) {
	return btn.src.substring(0,btn.src.lastIndexOf("/"));
}

function getRelRoot() {
	var strPath
	if (document.all) {
		strPath = window.parent.parent.frames["leftFrame"].document.all("bgrd").src;
		return strPath.substring(0,strPath.lastIndexOf("/"));
	}
	else {
		strPath = window.parent.parent.frames["leftFrame"].document.images['bgrd'].src;
		return strPath.substring(0,strPath.lastIndexOf("/"));
	}
}

function getAbsRoot() {
	var strPath = window.parent.parent.frames["topFrame"].document.location.href
	return strPath.substring(0,strPath.lastIndexOf("/"));
}

function setImage(imgName) {
	var frmHeader = window.parent.parent.frames["topFrame"]
	var hImg
	var strPath = frmHeader.document.location.href;
	
	strPath = strPath.substring(0,strPath.lastIndexOf("/"));
	hImg = getButton("navTile", frmHeader.document);
	hImg.src = strPath + "/images/Header/" + imgName + "_Header.jpg";
}



function setSubColor() {
	if (window.parent.parent.mainFrame.sButton) {
		var frmsubNav = window.parent.parent.frames["subNav"];
		var frmMain = window.parent.parent.frames["mainFrame"];
		var sButton = frmMain.sButton;
		var nCurrent = frmMain.nButton;
	
		if (nCurrent == "") {
			getButtonText("btn" + sButton, frmsubNav.document).style.color = "#CC0000";
			frmsubNav.Current = true;
		}
		else {
			getButtonText("btn" + sButton, frmsubNav.document).style.color = "#0066FF";
			frmsubNav.Current = false;
		}
	}
	else {setTimeout("setSubColor",1000);}
}
//-->
