function Validate(arNames){    Mssge1 = 'Sorry, '    Mssge2 = ' is a required field.'    var VldTxt = 0;     var ElNum = document.myForm.elements.length;    for (var i=0;i<document.myForm.elements.length;i++){ // for all of the elements on the form..        if ((document.myForm.elements[i].name.indexOf('rqd') > -1)) { // if the element has the letters 'rqd' in it's name..            if (document.myForm.elements[i].type == 'select-one' || document.myForm.elements[i].type == 'select-multiple') {                // if it's a list element(for Nav)..                if (!document.myForm.elements[i].options[document.myForm.elements[i].selectedIndex].value){                    // and if the element is empty give a wrning                    alert(Mssge1 + arNames[VldTxt] + Mssge2)                    // return false to the form...                    return false;                }            }            else                if (!document.myForm.elements[i].value) {                    alert(Mssge1 + arNames[VldTxt] + Mssge2);                    return false;                }              // Increment the number of required fields based on the Rqd prefix            VldTxt++;        }     } } 