 if (document.images)
 {var imglist = new Array ("images/craftmaster_o.gif", "images/miratec_o.gif", "images/extira_o.gif", "images/news_o.gif", "images/info_o.gif", "images/contact_o.gif", "images/international_o.gif", "images/enviro_o.gif");
 var imgs = new Array(); 
 var count;
 for (count=0; count<imglist.length; count++)
 {imgs[count]=new Image(); imgs[count].src=imglist[count];}
 }
 function hilite(name,m)
 {if (document.images)
 {imgswap(name, imgs[m])}
 }
 function imgswap(i1,i2)
 {if (document.images)
 {var temp = i1.src; i1.src=i2.src; i2.src=temp;}
 }

function openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function drawAlert () {
alert ("This is an alert message that can say whatever you want!");
}

window.onerror = null;
 var bName = navigator.appName;
 var bVer = parseInt(navigator.appVersion);
 var NS4 = (bName == "Netscape" && bVer < 5);
 var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
 var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);
 var NS5 = (bName == "Netscape" && bVer >= 5);
 var menuActive = 0
 var menuOn = 0
 var onLayer
 var timeOn = null
 
 // LAYER SWITCHING CODE
if (NS4 || IE4) {
 if (navigator.appName == "Netscape") {
 layerStyleRef="layer.";
 layerRef="document.layers";
 styleSwitch="";
 }else{
 layerStyleRef="layer.style.";
 layerRef="document.all";
 styleSwitch=".style";}
 }
 if (NS5) {
 	layerStyleRef="layer.style.";
 	layerRef="document.getElementById";
 	styleSwitch=".style";
}

// SHOW MENU
function showLayer(layerName){
	if (NS5) {
 		if (timeOn != null) {
 		clearTimeout(timeOn)
 		hideLayer(onLayer)
 			}
 		}
	if (NS4 || IE4) {
 		if (timeOn != null) {
 		clearTimeout(timeOn)
 		hideLayer(onLayer)
 			}
 		}
 	if (NS4 || IE4) {
 		eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
 		} 
 	if (NS5) {
  		eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="visible"');
		}
 	onLayer = layerName
 	}


// HIDE MENU
function hideLayer(layerName){
	if (menuActive == 0) {
 		if (NS4 || IE4) {
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
 			} 
 		if (NS5) {
  			eval(layerRef+'("'+layerName+'")'+styleSwitch+'.visibility="hidden"');
			}
	}
}

// TIMER FOR BUTTON MOUSE OUT
function btnTimer() {
 timeOn = setTimeout("btnOut()",500)
}

// BUTTON MOUSE OUT
function btnOut(layerName) {
 if (menuActive == 0) {
 hideLayer(onLayer)
 }
}

// MENU MOUSE OVER 
function menuOver(itemName) {
 clearTimeout(timeOn)
 menuActive = 1
}

// MENU MOUSE OUT 
function menuOut(itemName) {
 menuActive = 0 
 timeOn = setTimeout("hideLayer(onLayer)", 500)
 }
 
function checkForm(){
	 //List of form element names that are required
	 var elementsList = "requiredName,requiredEmail,userType,comments";
	 var descriptionList = "Name Field,E-mail Address,Customer Type,Comments";
     var elementsArray = elementsList.split(",");
	 var descriptionArray = descriptionList.split(",");
	 var msgHeader = "You must complete the following required field(s) \n before submitting your comments:\r"
	 var msg = ""
	 // Check for empty fields and build message list
	 //
	 for (i=0; i < elementsArray.length; i ++) { 
		var currentElement = elementsArray[i];
		if (eval("document.mail." + currentElement + ".value")==""){
			msg += "\t" + descriptionArray[i] + "\n"
        }
     }
	 //If there are no blank fields, submit the form,
	 // else give an alert message
	 if (msg==""){
	 	return true
	}
	else {
		alert(msgHeader +"\r" + msg)
		return false
	}
}
