            var anyErrors = false;
            var anyMessages = "";

            //
            //  Start function: convToUpperCase
            //  Convert specified text to UpperCase
            //
            // commented out 1/28/2005
            //
            //function convToUpperCase(string) {
            //    var newstr = string.toUpperCase();
            //    return newstr;
            //}

            //
            //  Start function: validateForm
            //  Verify that user entered required fields
            //
            function validateForm(passForm) {

                var strHyphen = "-";
                var tempString = "";
                var anythingClicked = false;
                var position = 0;
                var high_position = 0;
                anyErrors = false;
                anyMessages = "";

                //alert ("inside function validateForm()");


                //
                // Validate that user read the legal language and
                // clicked the Approve radio button
                //
                if (eval("passForm.Approve.checked") == true) {
                    anythingClicked = true;
                }

                if (anythingClicked == false) {
                    anyMessages += "Please read the legal requirements and click 'I Agree to the above terms' before submitting this form.\n";
                    anyErrors = true;
                }


                //
                // Validate that user clicked a RequestType
                //
                anythingClicked = false;  // initialize

                if (eval("passForm.RequestType[0].checked") == true) {
                    anythingClicked = true;
                }
                if (eval("passForm.RequestType[1].checked") == true) {
                    anythingClicked = true;
                }
                if (eval("passForm.RequestType[2].checked") == true) {
                    anythingClicked = true;
                }

                if (anythingClicked == false) {
                    anyMessages += "Please specify the request type, New, Update or Delete.\n";
                    anyErrors = true;
                }

                //
                // Validate First Name
                //
                tempString = passForm.FirstName.value;
                if ( tempString.length == 0 ) {
                    anyMessages += "Please enter the First Name.\n";
                    anyErrors = true;
                }
                else if ( tempString.length > 40 ) {
                        anyMessages += "First Name must be less than 40 characters long.\n";
                        anyErrors = true;
                }

                //
                // Validate Last Name
                //
                tempString = passForm.LastName.value;
                if ( tempString.length == 0 ) {
                    anyMessages += "Please enter the Last Name.\n";
                    anyErrors = true;
                }
                else if ( tempString.length > 40 ) {
                        anyMessages += "Last Name must be less than 40 characters long.\n";
                        anyErrors = true;
                }

                //
                // Validate Organization
                //
                tempString = passForm.Organization.value;
                if ( tempString.length == 0 ) {
                    anyMessages += "Please enter the organization (CMRS provider).\n";
                    anyErrors = true;
                }
                else if ( tempString.length > 100 ) {
                        anyMessages += "Organization (CMRS provider) must be less than 100 characters long.\n";
                        anyErrors = true;
                }

                //
                // Validate Phone
                //
                tempString = passForm.Phone.value;
                if ( tempString.length == 0 ) {
                    anyMessages += "Please enter the phone number.\n";
                    anyErrors = true;
                }
                else if ( tempString.length > 20 ) {
                        anyMessages += "Phone must be less than 20 characters long.\n";
                        anyErrors = true;
                }

                //
                // Validate E-Mail Address
                //
                tempString = passForm.EmailAddress.value;
                if ( tempString.length == 0 ) {
                    anyMessages += "Please enter the E-mail address.\n";
                    anyErrors = true;
                }
                else if ( tempString.length > 50 ) {
                        anyMessages += "E-mail Address must be less than 50 characters long.\n";
                        anyErrors = true;
                }

                //
                // Validate Address1
                //
                tempString = passForm.Address1.value;
                if ( tempString.length == 0 ) {
                    anyMessages += "Please enter the address1.\n";
                    anyErrors = true;
                }
                else if ( tempString.length > 50 ) {
                        anyMessages += "Address1 must be less than 50 characters long.\n";
                        anyErrors = true;
                }

                //
                // Address2 is optional.
                //
                tempString = passForm.Address2.value;
                if ( tempString.length > 50 ) {
                    anyMessages += "Address2 must be less than 50 characters long.\n";
                    anyErrors = true;
                }

                //
                // Validate City
                //
                tempString = passForm.City.value;
                if ( tempString.length == 0 ) {
                    anyMessages += "Please enter the city.\n";
                    anyErrors = true;
                }
                else if ( tempString.length > 50 ) {
                        anyMessages += "City must be less than 50 characters long.\n";
                        anyErrors = true;
                }

                //
                // Validate State
                //
                if ( passForm.State.selectedIndex == 0 ) {
                    anyMessages += "Please enter the state.\n";
                    anyErrors = true;
                }

                //
                // Validate Zip
                //
                tempString = passForm.Zip.value;
                if ( tempString.length == 0 ) {
                    anyMessages += "Please enter the zip.\n";
                    anyErrors = true;
                }
                else if ( tempString.length != 5 && tempString.length != 10 ) {
                        anyMessages += "Zip must be 5 or 10 characters long.\n";
                        anyErrors = true;
                }
                else {
                    tempString = '0123456789-';    // define valid characters
                    if ( validateField(passForm.Zip.value, tempString) ) {
                        anyMessages += "Zip must be numeric.\n";
                        anyErrors = true;
                    }

                    // check for hyphen if zip is 10 chars long
                    // code must go here, it won't work after the above else
                    tempString = passForm.Zip.value;
                    if ( tempString.length == 10 ) {
                        if (strHyphen.indexOf(tempString.charAt(5)) == -1) {
                            anyMessages += "Zip must contain a hyphen in position 5.\n";
                            anyErrors = true;
                        }
                    }
                }

                //
                // Validate Domain Name
                //
                tempString = passForm.DomainName.value;
                if ( tempString.length == 0 ) {
                    anyMessages += "Please enter the Domain Name.\n";
                    anyErrors = true;
                }
                else if ( tempString.length > 75 ) {
                        anyMessages += "Domain Name must be less than 75 characters long.\n";
                        anyErrors = true;
                }
                else if ( tempString.length < 5 ) {
                        anyMessages += "Domain Name must be less at least 5 characters long.\n";
                        anyErrors = true;
                }
                else if ( tempString.indexOf(".") < 0 ) {
                        anyMessages += "Domain Name must follow the dot notation.  For example, MyDomain.com, MyDomain.edu, etc...\n";
                        anyErrors = true;
                }
                else {
                    tempString = passForm.DomainName.value.charAt(0);  // obtain leftmost character
                    if ( validateField(tempString, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') ) {
                        anyMessages += "1st character of Domain Name must be a letter or a number.\n";
                        anyErrors = true;
                    }
                }

                //
                // Make sure there is something after the last dot.  For
                // example .com, .edu., .gov
                //
                tempString = passForm.DomainName.value;
                position =  tempString.indexOf(".");
                while(position > 0) {
                    high_position = position;
                    position =  tempString.indexOf(".", high_position+1);
                }
                position = (tempString.length - high_position) - 1;

                if ( position < 2 ) {
                    anyMessages += "Domain Name must end with a top-level Domain such as .gov, .com, .edu...\n";
                    anyErrors = true;
                }


                tempString = passForm.DomainName.value;



                //
                // if errors found, do not build the the select statement to be passed to Perl
                //
                if (anyErrors) {
                    alert (anyMessages);
                    return false;
                }
                else {
                    document.DomainNameInput.action = "http://fjallfoss.fcc.gov/cgb/domain_name/DomainNameProcess.cfm";
                    //document.DomainNameInput.action = "http://fccdev01w.fcc.gov/cgb/domain_name/DomainNameProcess.cfm";
                    return true;
                }
            }
            //  End function: validateForm


            //  Start function: validateNumber
            //  Passed field should contain all numbers
            //
            function validateField(passField, passCharsAllowed) {

                var BadCharFound = false;

                for (var i=0; i< passField.length; i++) {
                    if (passCharsAllowed.indexOf(passField.charAt(i)) == -1) {
                        BadCharFound = true;
                    }
                }
                return BadCharFound;
            }
            //  End function: validateNumber



            //  Start function: sendHelpForm
            //  Display the help form
            //
            function sendHelpForm() {
                popupWin = window.open('DomainNameInputHelp.html',
                           'open_window',
                           'menubar,toolbar,location,directories,status,scrollbars,resizable,dependent,width=680,height=500,left=20,top=20')
            }
            //  End function: sendHelpForm
