<!--
var now = new Date();
var cyear=now.getYear();
		
	function ValidateNo( NumStr, String )
	{
 		for( var Idx = 0; Idx < NumStr.length; Idx ++ )
 		{
			 var Char = NumStr.charAt( Idx );
			 var Match = false;

				for( var Idx1 = 0; Idx1 < String.length; Idx1 ++)
				{
					 if( Char == String.charAt( Idx1 ) )
					 Match = true;
				}

				if ( !Match )
					return false;
 		}

        	return true;
	}


	function ValidateEmail( Email )
	{
		var atCharPresent = false;
		var dotPresent = false;

		for ( var Idx = 0; Idx < Email.length; Idx++ )
		{
			if ( Email.charAt ( Idx ) == '@' )
				atCharPresent = true;
			if ( Email.charAt ( Idx ) == '.' )
				dotPresent = true;
		}

		if ( !atCharPresent || !dotPresent )
			return false;

		return true;
	}

	// Function to validate all the inputs
	function Validate(  )
	{
		var ResellerSignup = this.document.ResellerSignup;

		if ( ResellerSignup.FirstName.value == "" )
		{
			alert( "Please enter the First Name." );
			ResellerSignup.FirstName.focus( );
			return false;
		}		

		if ( ResellerSignup.LastName.value == "" )
		{
			alert( "Please enter the Last Name." );
			ResellerSignup.LastName.focus( );
			return false;
		}		

		if ( ResellerSignup.CompanyName.value == "" )
		{
			alert( "Please enter the Company Name." );
			ResellerSignup.CompanyName.focus( );
			return false;
		}		

		if ( ResellerSignup.Address1.value == "" )
		{
			alert( "Please enter the Address." );
			ResellerSignup.Address1.focus( );
			return false;
		}		

		if ( ResellerSignup.Town.value == "" )
		{
			alert( "Please enter the Town." );
			ResellerSignup.Town.focus( );
			return false;
		}		

		if ( ResellerSignup.County.value == "" )
		{
			alert( "Please enter the County/State." );
			ResellerSignup.County.focus( );
			return false;
		}		

		
		if ( parseInt( ResellerSignup.CountryCode.options[ResellerSignup.CountryCode.selectedIndex].value ) == 0 )
		{
			alert( "Please select Country." );
			ResellerSignup.CountryCode.focus( );
			return false;
		}


		if ( ResellerSignup.PostCode.value == "" )
		{
			alert( "Please enter the Post Code." );
			ResellerSignup.PostCode.focus( );
			return false;
		}		

		
		// Check E-mail
		if ( ResellerSignup.PrimaryEmail.value == "" )
		{
			alert( "Please enter E-mail ID." );
			ResellerSignup.PrimaryEmail.focus( );
			return false;
		}
		else
		{
			if ( !ValidateEmail( ResellerSignup.PrimaryEmail.value ) )
			{
				alert( "Invalid E-mail " + ResellerSignup.PrimaryEmail.value );
				ResellerSignup.PrimaryEmail.focus( );
				return false;
			}
			for ( var Idx = 0; Idx < ResellerSignup.PrimaryEmail.value.length; Idx++ )
			{
				if ( ResellerSignup.PrimaryEmail.value.charAt(Idx) == '	'
					|| ResellerSignup.PrimaryEmail.value.charAt(Idx) == ' '
					|| ResellerSignup.PrimaryEmail.value.charAt(Idx) == ','
					|| ResellerSignup.PrimaryEmail.value.charAt(Idx) == '/'
					|| ResellerSignup.PrimaryEmail.value.charAt(Idx) == '\\'
					|| ResellerSignup.PrimaryEmail.value.charAt(Idx) == ';' )
				{
					alert( "Blanks or other invalid characters are not allowed in the E-mail ID.\nPlease enter only one E-mail ID." );
					ResellerSignup.PrimaryEmail.focus( );
					return false;
				}
			}
		}

		if ( ResellerSignup.SecondaryEmail.value != "" )
		{
			if ( !ValidateEmail( ResellerSignup.SecondaryEmail.value ) )
			{
				alert( "Invalid E-mail " + ResellerSignup.SecondaryEmail.value );
				ResellerSignup.SecondaryEmail.focus( );
				return false;
			}
			for ( var Idx = 0; Idx < ResellerSignup.SecondaryEmail.value.length; Idx++ )
			{
				if ( ResellerSignup.SecondaryEmail.value.charAt(Idx) == '	'
					|| ResellerSignup.SecondaryEmail.value.charAt(Idx) == ' '
					|| ResellerSignup.SecondaryEmail.value.charAt(Idx) == ','
					|| ResellerSignup.SecondaryEmail.value.charAt(Idx) == '/'
					|| ResellerSignup.SecondaryEmail.value.charAt(Idx) == '\\'
					|| ResellerSignup.SecondaryEmail.value.charAt(Idx) == ';' )
				{
					alert( "Blanks or other invalid characters are not allowed in the E-mail ID.\nPlease enter only one E-mail ID." );
					ResellerSignup.SecondaryEmail.focus( );
					return false;
				}
			}
		}


		if( !(ResellerSignup.TERMS.checked) )
		{
			alert("Please read and accept the terms and conditions.");
			return false;
		}
						
		return true;		
					
	}	

//  -->

