<!-- ignore for non-javascript browsers

function IsAlphaNumeric(str)
{
        var ch="";
        if (str!=null)
        {
                for (var i=0; i < str.length; i++)
                {
                        ch=str.substring(i,i+1);
                        if (IsNumeric(ch) || IsAlpha(ch))
                           ch="";
                        else
                           //Non alphanumeric character found
                           return false;
                }
                //Only alphanumeric found
                return true;
        }
        //Non alphanumeric character found
        return false;
}

//NOTE: isNaN(iValue) isn't supported by NS 3 (it still gives a non numeric value when called), so create our own functions.
function IsOnlyNumeric(str, bRequired)
{
	       var rResult     = false;
	       var ch          = "";
	       var i;
            
	       if (str==null || str=="")
	       {
	         return !bRequired;  //Flip the required flag. (ie if Required = true, then false is returned because of null, emptystring.  Otherwise, true is returned if not required.
	       }
	       else
	       {
	       
	               for (var i=0; i < str.length; i++)
	               {
	                       ch=str.substring(i,i+1);
	                       if (IsNumeric(ch))
	                       {
	                               rResult=true;
	                       }
	                       else {
	                          rResult=false;
	                          break;
	                       }
	               }
	       }
	            
	       return rResult;
}

function IsDate(str, bRequired)
{
           //Must be 05-02-2000 or 05/02/2000
	       var rResult     = false;
	       var ch          = "";
	       var i;

	       if (str==null || str=="")
	       {
	         return !bRequired;  //Flip the required flag. (ie if Required = true, then false is returned because of null, emptystring.  Otherwise, true is returned if not required.
	       }
	       else
	       {
	               if (IsOnlyNumeric(str.substring(0,2),true) && (str.substring(2,3)=="/" || str.substring(2,3)=="-") && IsOnlyNumeric(str.substring(3,5),true) && (str.substring(5,6)=="/" || str.substring(5,6)=="-") && (IsOnlyNumeric(StripEnds(str.substring(6,10)),true)) && (StripEnds(str.substring(6,10)).length >=4))
	                       {
	                          rResult=true;
	                       }
	                       else {
	                          rResult=false;
	                       }
	       }
	            
	       return rResult;
}

function IsAlpha(ch)
{
        if ((ch.length == 1) && ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')))
        {
                return true;
        }
        else
        {
                return false;
        }
}

function IsNumeric(ch)
{
        if ((ch.length == 1) && (ch >= '0' && ch <= '9'))
        {
                return true;
        }
        else
        {
                return false;
        }
}

function setMailingAddress(form, obj)
{
 form.xmailaddress.value=form.xphysicaladdress.value;
 form.xmailcity.value=form.xcity.value;
 if (form.xmailstate.selectedIndex)
    form.xmailstate.selectedIndex=form.xstate.selectedIndex;
 else
    form.xmailstate.value=form.xstate.value;

 if(form.xmailzip && form.xzip)
   form.xmailzip.value=form.xzip.value;
}

function setBillingContact(form, obj)
{
 form.xbillcontactname.value=form.xcontactname.value;
 form.xbillcontactphone.value=form.xcontactphone.value;
 form.xbillcontactemail.value=form.xcontactemail.value;
}



function StripRight(str)
{
        if (str == null || str == "")
        {
                return "";
        }
        var returnValue = str;
        while (returnValue.substring(returnValue.length-1,returnValue.length)==" " || returnValue.substring(returnValue.length-1,returnValue.length)=="\n")
        {
                returnValue = returnValue.substring(0,returnValue.length-1);
        }
        return returnValue;
}

function StripLeft(str)
{
        if (str == null || str == "")
        {
                return "";
        }
        var returnValue = str;
        while (returnValue.substring(0,1)==" " || returnValue.substring(0,1)=="\n")
        {
                returnValue = returnValue.substring(1,returnValue.length);
        }
        return returnValue;
}

function StripEnds(str)
{
        return StripLeft(StripRight(str));
}


// end of ignore -->
