<!--

//For Office Phone No.

function CharCount1a()
{
	if (document.frmmember.textdtelo1.value.length==3)
	{
		  document.frmmember.textdtelo2.focus();
		  return true;
	}
}

function CharCount1b()
{
	if (document.frmmember.textdtelo2.value.length==3)
	{
		  document.frmmember.textdtelo3.focus();
		  return true;
	}
}

function CharCount1c()
{
	if (document.frmmember.textdtelo3.value.length==4)
	{
		  document.frmmember.textdtelr1.focus();
		  return true;
	}
}




//For Residence Phone No.
function CharCount2a()
{
	if (document.frmmember.textdtelr1.value.length==3)
	{
		  document.frmmember.textdtelr2.focus();
		  return true;
	}
}

function CharCount2b()
{
	if (document.frmmember.textdtelr2.value.length==3)
	{
		  document.frmmember.textdtelr3.focus();
		  return true;
	}
}

function CharCount2c()
{
	if (document.frmmember.textdtelr3.value.length==4)
	{
          document.frmmember.textdemail.focus();
		  return true;
	}
}




function  submitform()
{
//Company Name Validation
		if (TrimString(document.frmmember.textdid.value) == "")
                {
                alert("please enter the Company Name.");
                document.frmmember.textdid.focus();
                return false;
                }

//First Name Validation
		if (TrimString(document.frmmember.textdfname.value) == "")
                {
                alert("please enter the First Name.");
                document.frmmember.textdfname.focus();
                return false;
                }
//Last Name Validation
		if (TrimString(document.frmmember.textdlname.value) == "")
                {
                alert("please enter the Last Name.");
                document.frmmember.textdlname.focus();
                return false;
                }

//Manufacturers Sales Company Account Number Validation
		if (TrimString(document.frmmember.textAccountNo.value) == "")
                {
                alert("please enter the Manufacturers Sales Company Account Number.");
                document.frmmember.textAccountNo.focus();
                return false;
                }


//Password & Confirm Password  Validation
		if (TrimString(document.frmmember.textdpassword.value) == "")
                {
                alert("please enter the password.");
                document.frmmember.textdpassword.focus();
                return false;
                }
        if (TrimString(document.frmmember.textdcpass.value) == "")
                {
                alert("please confirm the password.");
                document.frmmember.textdcpass.focus();
                return false;
                }
        if (document.frmmember.textdpassword.value != document.frmmember.textdcpass.value)
                {
                alert("please re-confirm the password properly.");
                document.frmmember.textdcpass.focus();
                return false;
                }

//Office Phone No. Validation
		//First Inpur Box Validation
		if (TrimString(document.frmmember.textdtelo1.value) == "")
                {
                alert("please enter Your telephone number(office).");
                document.frmmember.textdtelo1.select();
                document.frmmember.textdtelo1.focus();
                return false;
                }
        if (isNaN(document.frmmember.textdtelo1.value))
                {
                alert("telephone number(office) should be numeric.");
                document.frmmember.textdtelo1.select();
                return false;
                }

		//Second Inpur Box Validation
		if (TrimString(document.frmmember.textdtelo2.value) == "")
                {
                alert("please enter Your telephone number(office).");
                document.frmmember.textdtelo2.select();
                document.frmmember.textdtelo2.focus();
                return false;
                }
        if (isNaN(document.frmmember.textdtelo2.value))
                {
                alert("telephone number(office) should be numeric.");
                document.frmmember.textdtelo2.select();
                return false;
                }

		//Third Inpur Box Validation
		if (TrimString(document.frmmember.textdtelo3.value) == "")
                {
                alert("please enter Your telephone number(office).");
                document.frmmember.textdtelo3.select();
                document.frmmember.textdtelo3.focus();
                return false;
                }
        if (isNaN(document.frmmember.textdtelo3.value))
                {
                alert("telephone number(office) should be numeric.");
                document.frmmember.textdtelo3.select();
                return false;
                }


        if (TrimString(document.frmmember.textdemail.value) == "")
                {
                alert("please enter a valid e-mail address.");
                document.frmmember.textdemail.focus();
                return false;
                }
        if (emailCheck(document.frmmember.textdemail.value) == false)
                {
                document.frmmember.textdemail.focus();
                return false;
                }

/////////////////////////////////////////////////////////
//			   ADDRESS INFORMATION VALIDATION		  //
////////////////////////////////////////////////////////

// Address1 Validation
        if (TrimString(document.frmmember.textdaddress1.value)=="")
                {
                alert("please enter the address.");
                document.frmmember.textdaddress1.focus();
                return false;
                }

// City1 Validation
        if (TrimString(document.frmmember.textdcity.value)== "")
                {
                alert("please enter the city")
                document.frmmember.textdcity.focus();
                return false;
                }

// State1 Validation
		if (TrimString(document.frmmember.textstate.value)== "")
                {
                alert("please choose the state")
                document.frmmember.textstate.focus();
                return false;
                }

// Zip1 Validation
		// First Input Validation
		var list="1234567890()-"
        var Ostr
        if (TrimString(document.frmmember.textdzip1.value)== "")
                {
                        alert("please enter the 'zip'")
                        document.frmmember.textdzip1.focus();
                        return false;
                }
        else
                {
                        Ostr = new String(document.frmmember.textdzip1.value);
                        for (var i=0;i < Ostr.length;++i)
                        {
                               if (list.indexOf(Ostr.charAt(i))== -1)
                                {
                                        alert("invalid character in 'zip'!  only 0-9, - , and ( , ) are allowed.");
                                        document.frmmember.textdzip1.select();
                                        document.frmmember.textdzip1.focus();
                                        return false;
                                }

                        }

                }	


////////////////////////////////////////////////////////////////
//			   SHIPPING ADDRESS INFORMATION VALIDATION		  //
////////////////////////////////////////////////////////////////

if(document.frmmember.chkship.checked==false)
{
// Address1 Validation in Shipping Address
        if (TrimString(document.frmmember.textdsaddress1.value)=="")
                {
                alert("please enter the shipping address.");
                document.frmmember.textdsaddress1.focus();
                return false;
                }

// City1 Validation in Shipping Address
        if (TrimString(document.frmmember.textdscity.value)== "")
                {
                alert("please enter the city in shipping address")
                document.frmmember.textdscity.focus();
                return false;
                }

// State1 Validation in Shipping Address
		if (TrimString(document.frmmember.textshstate.value)== "")
                {
                alert("please choose the state in shipping address")
                document.frmmember.textshstate.focus();
                return false;
                }

// Zip1 Validation in Shipping Address
		// First Input Validation
		var list="1234567890()-"
        var Ostr
        if (TrimString(document.frmmember.textdszip1.value)== "")
                {
                        alert("please enter the 'zip' in shipping address")
                        document.frmmember.textdszip1.focus();
                        return false;
                }
        else
                {
                        Ostr = new String(document.frmmember.textdszip1.value);
                        for (var i=0;i < Ostr.length;++i)
                        {
                               if (list.indexOf(Ostr.charAt(i))== -1)
                                {
                                        alert("invalid character in 'zip'!  only 0-9, - , and ( , ) are allowed.");
                                        document.frmmember.textdszip1.select();
                                        document.frmmember.textdszip1.focus();
                                        return false;
                                }

                        }

                }	

		// Second Input Validation
		var list="1234567890()-"
        var Ostr
        if (TrimString(document.frmmember.textdszip2.value)== "")
                {
                        alert("please enter the 'zip' in shipping address")
                        document.frmmember.textdszip2.focus();
                        return false;
                }
        else
                {
                        Ostr = new String(document.frmmember.textdszip2.value);
                        for (var i=0;i < Ostr.length;++i)
                        {
                               if (list.indexOf(Ostr.charAt(i))== -1)
                                {
                                        alert("invalid character in 'zip'!  only 0-9, - , and ( , ) are allowed.");
                                        document.frmmember.textdszip2.select();
                                        document.frmmember.textdszip2.focus();
                                        return false;
                                }

                        }

                }	
}
}
//-->
