function phoneNumber(p_keyEvent){

        var key = (navigator.appName != "Netscape") ? window.event.keyCode : p_keyEvent.which;

        if((key < 48 || key > 57 || key ==32 || key==45) && key!=8 && key!=40 && key!=41 && key!=13){

                if(isIE){

                        window.event.keyCode = 8;

                }

                else if(isNav){

                                return false;

                }

        }

        return true;

}







function FormatPhone(t)

{

        var a =t.value;

        var lenIP =a.length;

        switch (lenIP)

        {

                case 1 :

                                a = "" + a;

                                t.value =a;

                                break;



                case 3 :

                                a =a + "-";

                                t.value =a;

                                break;

                case 7 :

                                a =a + "-";

                                t.value =a;

                                break;

        }

}



function check_required(thisform){

        var agt=navigator.userAgent.toLowerCase();



        //if (agt.indexOf("win98")!= -1) {

        //        return true;

        //} else {

                browser='Win98';



                form1 = document.forms[thisform];

                //alert ('checking');

                var error = '';

                var error = checkFormValid(form1);

                if (error == '') {

                        if (document.getElementById("before_submit") != null) {

                                document.getElementById("before_submit").style.visibility = "hidden";

                                var before_div = 1;

                        }

                        if (document.getElementById("after_submit") != null) {

                                document.getElementById("after_submit").style.visibility = "visible";

                                var after_div = 1;

                        }

                        if (before_div && after_div)

                                animate('after_submit', "#FF6600");

                        return true;

                } else {

                        alert("Some information you submitted is incomplete or invalid,\nPlease correct the following:"+"\n"+error);

                        return false;

                }

        //}

}



function compare(thisform,field1,field2) {



          theForm = document.forms[thisform];



        var myarray = new Array(theForm.elements.length);

        for (formElementCounter = 0; formElementCounter < theForm.elements.length; formElementCounter++) {

                theElement = theForm.elements[formElementCounter];

                elementName = new String(theElement.name);



                myarray[elementName] = theElement;



        }



        if (myarray[field1].value != myarray[field2].value) {

                var nicename1 = str_replace("_"," ",myarray[field1].name);

                var nicename2 = str_replace("_"," ",myarray[field2].name);

                alert(nicename1 + ' must match ' + nicename2);

                myarray[field1].focus();

                myarray[field1].select();

        }

}



//

// Define Validate class constructor

// From Professional JavaScript 2nd Edition

// Baartse, Mark; et. al.

// WROX Press Ltd. 2001

//



// Flooble.com's Animated Text script. Will animate a specified

// bit of text (determined by the ID of containing tag) by

// highlighting it with specified color one character at a time

// in a moving pattern.

//

// Summary of use:

//     call animate(tagID, color); where "tagID" is the ID

//     of the tag that contains text to be animated,

//     and "color" is the color to use to highlight the text with.

//

// For more information, and detailed instructions, see

//     http://www.flooble.com/scripts/animate.php

//

// Copyright (c) 2002 by Animus Pactum Consulting Inc.

// This script comes with no warranties whatsoever.

// Animus Pactum Consulting will not be responsible

// for any damages resulting from its use.



var ie4 = false;

if(document.all) {

                ie4 = true;

}

function setContent(name, value) {

        var d;

        if (ie4) {

                        d = document.all[name];

        } else {

                        d = document.getElementById(name);

        }

        d.innerHTML = value;

}



function getContent(name) {

        var d;

        if (ie4) {

                        d = document.all[name];

        } else {

                        d = document.getElementById(name);

        }

        return d.innerHTML;

}



function setColor(name, value) {

        var d;

        if (ie4) {

                        d = document.all[name];

        } else {

                        d = document.getElementById(name);

        }

        d.style.color = value;

}



function getColor(name) {

        var d;

        if (ie4) {

                        d = document.all[name];

        } else {

                        d = document.getElementById(name);

        }

        return d.style.color;

}



function animate(name, col) {

var value = getContent(name);

if (value.indexOf('<span') >= 0) { return; }

var length = 0;

                var str = '';

var ch;

var token = '';

var htmltag = false;

                for (i = 0; i < value.length; i++) {

        ch = value.substring(i, i+1);

        if (i < value.length - 1) { nextch = value.substring(i+1, i+2); } else { nextch = ' '; }

        token += ch;

        if (ch == '<' && '/aAbBpPhHiIoOuUlLtT'.indexOf(nextch) >= 0) { htmltag = true; }

        if (ch == '>' && htmltag) { htmltag = false; }

        if (!htmltag && ch.charCodeAt(0) > 30 && ch != ' ' && ch != '\n') {

                                        str += '<span id="' + name + '_' + length + '">' + token + '</span>';

                token = '';

                length++;

        }

                }

                setContent(name, str);

                command = 'animateloop(\'' + name + '\', ' + length + ', 0, 1, \'' + col + '\')';

                setTimeout(command , 100);

}



function animateloop(name, length, ind, delta, col) {

var next = ind + delta;

if (next >= length) { delta = delta * -1; next = ind + delta; }

if (next < 0) { delta = delta * -1; next = ind + delta; }

                setColor(name + '_' + ind, getColor(name + '_' + next));

                setColor(name + '_' + next, col);

                command = 'animateloop(\'' + name + '\', ' + length + ', ' + next + ', ' + delta + ', \'' + col + '\')';

                setTimeout(command , 100);

}



//+++++++++++++++++++++++++++++++++++++++++++++++++++







function isEmpty(s) {

        return ((s == null) || (s.length == 0))

}



// Returns true if string s is empty or

// whitespace characters only.



function isWhitespace (s) {



        var whitespace = " \t\n\r";

        var i;

        // Is s empty?

        if (isEmpty(s)) return true;



        // Search through string's characters one by one

        // until we find a non-whitespace character.

        // When we do, return false; if we don't, return true.



        for (i = 0; i < s.length; i++) {

                 var c = s.charAt(i);

                if (whitespace.indexOf(c) == -1) return false;

        }



        // All characters are whitespace.

        return true;

}



function str_replace (c1, c2, s)



{   var i;

    var returnString = "";



    // Search through string's characters one by one.

    // If character is not in bag, append to returnString.



    for (i = 0; i < s.length; i++)

    {

        // Check that current character isn't whitespace.

        var c = s.charAt(i);

        if (c == c1) {

                 returnString += c2;

        } else {

                returnString += c;

        }

    }



    return returnString;

}







function isOnlyAlphaNumeric(string)

{

        var invalidCharactersRegExp = /[^a-z\d ]/i;

        var isValid = !(invalidCharactersRegExp.test(string));



        return isValid;

}





function isOnlyAlphaNumericNoSpace(string)

{

   var invalidCharactersRegExp = /[^a-z\d]/i;

   var isValid = !(invalidCharactersRegExp.test(string));



   return isValid;

}



function isOnlyAlphabetic(string)

{

        invalidCharactersRegExp = /[^a-z ]/i;

        var isValid = !(invalidCharactersRegExp.test(string));



        return isValid;

}



function isOnlyNumeric(string)

{

        var invalidCharactersRegExp = /[^\d]/;

        var isValid = !(invalidCharactersRegExp.test(string));



        return isValid;

}



function isValidInteger(string)

{

        var invalidCharactersRegExp = /[^\d-]/;

        var isValid = !(invalidCharactersRegExp.test(string));



        return isValid;

}



function isValidCountry(country)

{

        if (isEmpty(country)) {

                country = 'US';

        }



        //country = toUpperCase(str_replace("|"," ",country));

         //var invalidCharactersRegExp = /[AD|AE|AF|AL|AM|AO|AS|AT|AZ|BA|BD|BE|BF|BG|BH|BI|BJ|BN|BT|BW|BY|CD|CF|CG|CH|CI|CK|CM|CN|CV|CY|CZ|DE|DJ|DK|DZ|EE|EG|ER|ES|ET|FI|FJ|FM|FR|GA|GE|GH|GI|GL|GM|GN|GQ|GR|HR|HU|ID|IE|IL|IN|IQ|IR|IS|IT|JO|JP|KE|KG|KH|KI|KM|KP|KR|KW|LA|LB|LI|LK|LR|LS|LT|LU|LV|LY|MA|MC|MD|MG|MH|MK|ML|MM|MN|MR|MT|MU|MV|MW|MY|MZ|NA|NE|NG|NL|NO|NP|NR|NU|OM|PG|PH|PK|PL|PT|PW|QA|RO|RU|RW|SA|SB|SC|SD|SE|SG|SI|SK|SL|SM|SN|SO|ST|SY|SZ|TD|TG|TH|TK|TM|TN|TO|TR|TV|TZ|UA|UG|UK|UZ|VA|VN|VU|YE|YU|ZA|ZM|ZW]/;

        validFormat = '|AD|AE|AF|AL|AM|AO|AS|AT|AZ|BA|BD|BE|BF|BG|BH|BI|BJ|BN|BT|BW|BY|CA|CD|CF|CG|CH|CI|CK|CM|CN|CV|CY|CZ|DE|DJ|DK|DZ|EE|EG|ER|ES|ET|FI|FJ|FM|FR|GA|GE|GH|GI|GL|GM|GN|GQ|GR|HR|HU|ID|IE|IL|IN|IQ|IR|IS|IT|JO|JP|KE|KG|KH|KI|KM|KP|KR|KW|LA|LB|LI|LK|LR|LS|LT|LU|LV|LY|MA|MC|MD|MG|MH|MK|ML|MM|MN|MR|MT|MU|MV|MW|MY|MZ|NA|NE|NG|NL|NO|NP|NR|NU|OM|PG|PH|PK|PL|PT|PW|QA|RO|RU|RW|SA|SB|SC|SD|SE|SG|SI|SK|SL|SM|SN|SO|ST|SY|SZ|TD|TG|TH|TK|TM|TN|TO|TR|TV|TZ|UA|UG|UK|US|UZ|VA|VN|VU|YE|YU|ZA|ZM|ZW';

        if ((validFormat.indexOf(country) > 0) && (country.length == 2)) {

                isValid = true;

        } else {

                isValid = false;

        }



        //if (isValid) { alert (country + ' is okay') } else { alert (country + ' is not okay') };

        return isValid;

}



function isValidState(state, country)

{



            switch(country)

                {

                        case "US":

                                   var validFormat = 'XX|AL|AK|AZ|AR|CA|CO|CT|DE|DC|FL|GA|HI|ID|IL|IN|IA|KS|KY|LA|ME|MD|MA|MI|MN|MS|MO|MT|NE|NV|NH|NJ|NM|NY|NC|ND|OH|OK|OR|PA|RI|SC|SD|TN|TX|UT|VT|VA|WA|WV|WI|WY|AL';

                                if ((validFormat.indexOf(state) > 0) && (state.length == 2)) {

                                        isValid = true;

                                } else {

                                        isValid = false;

                                }

                                 break;



                        case "CA":

                                   var validFormat = 'AB|BC|MB|NB|NF|NT|NS|ON|PE|QC|SK|YT';

                                if ((validFormat.indexOf(state) > 0) && (state.length == 2)) {

                                        isValid = true;

                                } else {

                                        isValid = false;

                                }



                        default:

                                var isValid = true;

                                break;

                }



   /*if (isValid)

           alert(state +' in ' + country + ' is okay');

   else

           alert (state +' in ' + country + ' is not okay');

           */

   return isValid;



}











function isValidFloatingPoint(string)

{

        var invalidCharactersRegExp = /[^\d\.-]/;

        var isValid = !(invalidCharactersRegExp.test(string));



        return isValid;

}



function isValidAge(age)

{

        var isValid = false;

        if (isOnlyNumeric(age))

        {

                isValid = (parseInt(age) > 0 && parseInt(age) < 140)

        }



        return isValid;

}









function isValidPassword(password)

{

        var invalidCharactersRegExp = /[^a-z\d]/i

        var isValid = !(invalidCharactersRegExp.test(password));

        if (isValid)

        {

                isValid = (password.length >= 6);

        }

        return isValid;



}





function isValidTelephone(telephone, country)

{



            switch(country)

                {

                        case "US":

                                //alert ('us phone');

                                   var validFormat = /\d\d\d-\d\d\d-\d\d\d\d/

                                 var isValid = validFormat.test(telephone);



                                break;



                        default:

                                   var validFormat = /^\d(\d|-)/

                                var isValid = validFormat.test(telephone);

                                break;

                }



   //return isValid;

   return true;



}







function isValidZip(zip, country)

{

   //var validFormat = /^(?(^00000(|-0000))|(\d(-\d)?))$/i



           switch(country)

                {

                        case "US":

                                   var validFormat = /^\d\d\d\d\d(-\d\d\d\d)?$/;

                                 var isValid = validFormat.test(zip);

                                break;



                        case "CA":

                                //Letter, digit, letter, space, digit, letter, digit.

                                   var validFormat = /^[A-Za-z]\d[A-Za-z] ?\d[A-Za-z]\d$/

                                var isValid = validFormat.test(zip);

                                break;



                        default:

                                var isValid = true;

                                break;

                }



   return isValid;

}





function isValidEmail(email)

{



   var validFormatRegExp = /^[\w\.\-]+@[^\.][\w\-\.]*\.[a-z]/i;



   var isValid = validFormatRegExp.test(email);

   return isValid;

}



function isValidDate(day, month,year)

{

        //var validFormat = /^\d/|-\d/|-\d$/



        var isValid = true;



        var enteredDate = new Date(day + " " + month + " " + year);

        if (enteredDate.getDate() != day)

        {

                isValid = false;

        }

        return isValid;

}





function isValidDateOfBirth(day, month, year)

{

        var isValid = true;

        var nowDate = new Date();

        year = parseInt(year);

        dateOfBirth =  new Date(day + " " + month + " " + year);

        if (!isValidDate(day,month,year))

        {

                isValid = false;

        }

        else if (dateOfBirth > nowDate || (year + 140) < nowDate.getFullYear())

        {

                isValid = false;

        }



        return isValid;

}





function isValidCreditCardExpiry(expiresMonth, expiresYear)

{

        var isValid = true;

        var nowDate = new Date();

        if (expiresMonth < (nowDate.getMonth() + 1) && expiresYear <= nowDate.getFullYear())

        {

                isValid = false;

        }

        else if (expiresYear < nowDate.getFullYear())

        {

                isValid = false;

        }





        return isValid;

}







function isValidCreditCardNumber(cardNumber, cardType)

{

        var isValid = false;

        var ccCheckRegExp = /[^\d ]/;

        isValid = !ccCheckRegExp.test(cardNumber);



        if (isValid)

        {

                var cardNumbersOnly = cardNumber.replace(/ /g,"");

                var cardNumberLength = cardNumbersOnly.length;

                var lengthIsValid = false;

                var prefixIsValid = false;

                var prefixRegExp;



                switch(cardType)

                {

                        case "mastercard":

                                lengthIsValid = (cardNumberLength == 16);

                                prefixRegExp = /^5[1-5]/;

                                break;



                        case "visa":

                                lengthIsValid = (cardNumberLength == 16 || cardNumberLength == 13);

                                prefixRegExp = /^4/;

                                break;



                        case "amex":

                                lengthIsValid = (cardNumberLength == 15);

                                prefixRegExp = /^3/;

                                break;



                        default:

                                prefixRegExp = /^\d/;

                                lengthIsValid = true;

                                break;

                }



                prefixIsValid = prefixRegExp.test(cardNumbersOnly);

                isValid = prefixIsValid && lengthIsValid;

        }







        if (isValid)

        {

                var numberProduct;

                var numberProductDigitIndex;

                var checkSumTotal = 0;



                for (digitCounter = cardNumberLength - 1; digitCounter > 0; digitCounter--)

                {



                 checkSumTotal += parseInt(cardNumbersOnly.charAt(digitCounter));

                 digitCounter--;



                 numberProduct = new String((cardNumbersOnly.charAt(digitCounter) * 2));



                  for (        var productDigitCounter = 0;

                                productDigitCounter < numberProduct.length;

                                productDigitCounter++

                            )

                  {

                        checkSumTotal += parseInt(numberProduct.charAt(productDigitCounter));

                  }



            }



            isValid = (checkSumTotal % 10 == 0);



     }





        return isValid;

}



function copyFields(theForm) {





        var myarray = new Array(theForm.elements.length);

        for (formElementCounter = 0; formElementCounter < theForm.elements.length; formElementCounter++) {

                theElement = theForm.elements[formElementCounter];

                elementName = new String(theElement.name);



                myarray[elementName] = theElement;



        }

        for (formElementCounter = 0; formElementCounter < theForm.elements.length; formElementCounter++) {

                theElement = theForm.elements[formElementCounter];

                elementName = new String(theElement.name);

                pattern = /^s.*/;



                if (pattern.test(elementName)) {



                        if (myarray[elementName] != null) { //this field exists on the form?

                                var plainElementName = myarray[elementName].name.substring(1);

                                if (myarray[plainElementName] != null) {

                                        myarray[elementName].value = myarray[plainElementName].value;

                                }

                        }

                }

        }



}



function checkFormValid(theForm)

{

        var isWholeFormValid = true;

        var isValid = true;

        var theElement;

        var isToBeValidatedElementRegExp = /(_Compulsory)|(_NotCompulsory)/i;

        var isCompulsoryRegExp = /(_Compulsory)/i;

        var invalidDataType;

        var elementName;

        var errorDivId;

        var isCompulsoryElement;

        var isToBeCheckedElement;

        var isTextBoxElement;

        var required_elements = '';

        var error_message = '';

        var formElementCounter = 0;



        if (theForm.required != null) {

                required_elements = theForm.required.value;

        }



        if (theForm.Country != null) {theForm.Country.value = theForm.Country.value.toUpperCase(); this_Country = theForm.Country.value;} else {this_Country = 'US';}

        if (theForm.sCountry != null) {theForm.sCountry.value = theForm.sCountry.value.toUpperCase(); this_sCountry = theForm.sCountry.value;} else {this_sCountry = 'US';}

        if (theForm.State != null) {theForm.State.value = theForm.State.value.toUpperCase() }

        if (theForm.sState != null) {theForm.sState.value = theForm.sState.value.toUpperCase()}



// Check Text boxes completed and/or correct data type

        for (formElementCounter = 0; formElementCounter < theForm.elements.length; formElementCounter++)

        {

                theElement = theForm.elements[formElementCounter];

                elementName = new String(theElement.name);

                elementID = new String(theElement.id);



                isCompulsoryElement = false;

                isToBeValidatedElement = false;



                if (required_elements.indexOf(elementName) != -1) {//if this field name is in the required list

                        isCompulsoryElement = true;

                        isToBeValidatedElement = true;

                }

                //isToBeValidatedElement = isToBeValidatedElementRegExp.test(elementName);

                if ((!isCompulsoryElement) && (!isWhitespace(theElement.value))) { //if this field has something in it

                        isToBeValidatedElement = true;

                }



                if (isToBeValidatedElement)

                {

                        //errorDivId = new String(theElement.name);

                        //errorDivId = errorDivId.slice(3,errorDivId.indexOf("_")) + "Error";

                        //hideErrorDiv(errorDivId,theDocument);

                        //alert ('validating ' + theElement.name + ' ' + theElement.value+' type: '+theElement.type +' selected: '+theElement.selectedIndex);

                        isTextBoxElement =  theElement.type == "text" ||

                                                                theElement.type == "password" ||

                                                                theElement.type == "select-one" ||

                                                                theElement.type == "file";



                        var thisvalue = theElement.value;



                        if (theElement.type == "select-one"){

                                if ((isCompulsoryElement) && (theElement.selectedIndex == 0)) {

                                        thisvalue = '';

                                } else {

                                        thisvalue = theElement.options[theElement.selectedIndex].value;

                                }

                        }

                        if ( isTextBoxElement )

                        {

                                //alert ('name: '+theElement.name+' value: '+thisvalue);

                                if ((isCompulsoryElement) && (isWhitespace(thisvalue))) {

                                        if ((elementID != '') && (elementID != 'undefined')) {

                                                error_message += elementID +" (required)\n";

                                        } else {

                                                error_message += str_replace("_"," ",elementName)+" (required)\n";

                                        }

                                        isWholeFormValid = false;

                                } else {

                                        //isValid = isTextElementValid(theElement,isCompulsoryElement);



                                        switch (theElement.name) {



                                                case "Email_Address":

                                                        isValid = isValidEmail(thisvalue);

                                                        break;



                                                case "Country":

                                                        isValid = isValidCountry(thisvalue);

                                                        break;



                                                case "sCountry":

                                                        isValid = isValidCountry(thisvalue);

                                                        break;



                                                case "Telephone":

                                                        isValid = isValidTelephone(thisvalue,this_sCountry);

                                                        break;



                                                case "sTelephone":

                                                        isValid = isValidTelephone(thisvalue,this_Country);

                                                        break;



                                                case "Zip":

                                                        isValid = isValidZip(thisvalue,this_Country);

                                                        break;



                                                case "sZip":

                                                        isValid = isValidZip(thisvalue,this_sCountry);

                                                        break;



                                                case "State":

                                                        isValid = isValidState(thisvalue,this_Country);

                                                        break;



                                                case "sState":

                                                        isValid = isValidState(thisvalue,this_sCountry);

                                                        break;



                                                default:

                                                        //validDataTypeRegExp.exec(theElement.name);

                                                        //validDataType = new String(RegExp.lastMatch); //gets the last _and characters that follow from the form element name

                                                        //validDataType = validDataType.toLowerCase();

                                                        validDataType = 'valid';

                                                        var temp_arr = theElement.name.split('_');



                                                        if (temp_arr != null)

                                                                if (temp_arr.length > 1)

                                                                        validDataType = '_' + temp_arr[temp_arr.length - 1];



                                                        validDataType = validDataType.toLowerCase();

                                                        isValid = isElementDataValid(thisvalue,validDataType);

                                        }



                                        if ( !isValid )

                                        {

                                                //showErrorDiv(errorDivId,theDocument);

                                                //theElement.focus();

                                                //alert(elementName + 'ID is ' + elementID);

                                                if ((elementID != '') && (elementID != 'undefined')){

                                                        error_message += elementID + " (invalid)\n";

                                                } else {

                                                        error_message += str_replace("_"," ",elementName)+" (invalid)\n";

                                                }

                                                isWholeFormValid = false;

                                        }

                                        isWholeFormValid = false;

                                }

                        } //Check Compulsory Radio Buttons Completed

                        else if (theElement.type == "radio")

                        {



                                if (isCompulsoryElement)

                                {

                                        //elementName = theElement.name;

                                        theElement = theForm.elements[theElement.name];

                                        isValid = isOneRadioButtonInGroupSelected(theElement);



                                        if (isValid == false)

                                        {

                                                // (elementName + 'ID is ' + elementID);

                                                if ((elementID != '') && (elementID != 'undefined')){

                                                        error_message += elementID+" (required)\n";

                                                } else {

                                                        error_message += str_replace("_"," ",elementName)+" (required)\n";

                                                }

                                                //showErrorDiv(errorDivId,theDocument);

                                                isWholeFormValid = false;

                                        }



                                        do

                                        {

                                                formElementCounter++;

                                                theElement = theForm.elements[formElementCounter];

                                        }

                                        while (theElement.name == elementName && formElementCounter < theForm.length)



                                        formElementCounter--;

                                }

                        }

                }

        }

        return error_message;

}



function isTextElementValid(theElement,

                                                        validDataTypeRegExp,

                                                        isCompulsoryElement)

{



        var validDataTypeRegExp = /_[a-zA-Z]+$/i;

        var isValid = true;

        var validDataType = '';



        if (isCompulsoryElement && theElement.value == "")

        {

                isValid = false;

        }

        else

        {

                //validDataTypeRegExp.exec(theElement.name);

                //validDataType = new String(RegExp.lastMatch); //gets the last _and characters that follow from the form element name

                //validDataType = validDataType.toLowerCase();

                validDataType = 'valid';



                var temp_arr = theElement.name.split('_');



                if (temp_arr != null)

                        if (temp_arr.length > 1)

                                validDataType = '_' + temp_arr[temp_arr.length - 1];



                validDataType = validDataType.toLowerCase();

                isValid = isElementDataValid(theElement.value,validDataType);





        }



        return isValid;

}





function isElementDataValid(elementValue, validDataType)

{

        var isValid = false;



        switch (validDataType)

        {



                case "_alphanumeric":

                        isValid = isOnlyAlphaNumeric(elementValue);

                        break;



                case "_alphabetic":

                        isValid = isOnlyAlphabetic(elementValue);

                        break;



                case "_numeric":

                        isValid = isOnlyNumeric(elementValue);

                        break;



                case "_integer":

                        isValid = isValidInteger(elementValue);

                        break;



                case "_floatingpoint":

                        isValid = isValidFloatingPoint(elementValue);

                        break;



                case "_age":

                        isValid = isValidAge(elementValue);

                        break;



                case "_password":

                        isValid = isValidPassword(elementValue);

                        break;



                case "_telephone":

                        isValid = isValidTelephoneNum(elementValue);

                        break;



                case "_zip":

                        isValid = isValidUSZip(elementValue);

                        break;



                case "_email":

                        isValid = isValidEmail(elementValue);

                        break;



                case "_country":

                        isValid = isValidCountry(elementValue);

                        break;



                default:

                        isValid = true;

                        break;

        }



        return isValid;

}



function isOneRadioButtonInGroupSelected(theElement)

{



        var radioCounter;

        var isValid = false;

        for (radioCounter = theElement.length - 1; radioCounter >= 0; radioCounter--)

        {



                isValid = theElement[radioCounter].checked;

                if (isValid)

                {

                        break;

                }

        }



        return isValid;



}





function showErrorDiv (  errorDescripDivId,

                                                                theDocument)

{

  if (document.layers)

  {

         theDocument.layers[errorDescripDivId].visibility = "visible";

  }

  else if (document.all)

  {

        theDocument.all(errorDescripDivId).style.visibility = "visible"

  }

  else

  {

    theDocument.getElementById(errorDescripDivId).style.visibility = "visible"

  }

}





function hideErrorDiv (errorDescripDivId, theDocument)

{

  if (theDocument.layers)

  {

        theDocument.layers[errorDescripDivId].visibility = "hidden";

  }

  else if (document.all)

  {

        theDocument.all(errorDescripDivId).style.visibility = "hidden"

  }

  else

  {

         theDocument.getElementById(errorDescripDivId).style.visibility = "hidden"

  }

}
