// JavaScript Document

startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
window.onload=startList;



function validate() {

    var theMessage = "Please complete the following: \n-----------------------------------\n";
    var noErrors = theMessage

    // make sure field is not blank
    if (document.form1.name.value=="") {
    theMessage = theMessage + "\n --> Your name";
    }


    // Make sure entry is a certain lenght
    var lengthCheck = document.form1.votenumber.value
    if (lengthCheck.length < 4) {
    theMessage = theMessage + "\n --> Your 4 digit Vote Number";
    }

 
    // Make sure a selection list is used
    var listCheck = document.form1.womens.selectedIndex;
    if (document.form1.womens.options[listCheck].value=="none") {
    theMessage = theMessage + "\n --> Choose a Women's Fragrance";
    }
	
	// Make sure a selection list is used
    var listCheck = document.form1.mens.selectedIndex;
    if (document.form1.mens.options[listCheck].value=="none") {
    theMessage = theMessage + "\n --> Choose a Men's Fragrance";
    }
	
	// Make sure a selection list is used
    var listCheck = document.form1.ltdwomens.selectedIndex;
    if (document.form1.ltdwomens.options[listCheck].value=="none") {
    theMessage = theMessage + "\n --> Choose a Limited Women's Fragrance";
    }
	
	// Make sure a selection list is used
    var listCheck = document.form1.ltdmens.selectedIndex;
    if (document.form1.ltdmens.options[listCheck].value=="none") {
    theMessage = theMessage + "\n --> Choose a Limited Men's Fragrance";
    }


    // If no errors, submit the form
    if (theMessage == noErrors) {
    return true;

    } else {

    // If errors were found, show alert message
    alert(theMessage);
    return false;
    }
    }

