
function CheckRegister() {
			if(document.RegForm.conname.value=="")
			{
				window.alert('Enter your company name, please!');
				document.RegForm.conname.focus();
				return false;
			}
			if(document.RegForm.email.value=="")
			{
				window.alert('Enter your email, please!');
				document.RegForm.email.focus();
				return false;
			}
			if (document.RegForm.email.value !== '')
			{
				var reEmail = /^.+\@.+\..+$/
				if (!(reEmail.test(document.RegForm.email.value))) 
				{ 
				   window.alert('Enter a valid email address, please!');
				   document.RegForm.email.value="";
				   document.RegForm.email.focus();
				   return false;
				}
			}
			if(document.RegForm.add1.value=="")
			{
				window.alert('Enter your address, please!');
				document.RegForm.add1.focus();
				return false;
			}
			
			//if (document.RegForm.phnum.value == ''){
//				window.alert('Enter your phone number, please!');
//				document.RegForm.phnum.focus();
//				return false;
//			}
//			if (document.RegForm.phnum.value !== '')
//			{
//			var check = /^\d+$/  
//			if (!(check.test(document.RegForm.phnum.value))) {
//			window.alert('Enter only numbers for contact number, please!');
//			document.RegForm.phnum.value = '';
//			document.RegForm.phnum.focus();			
//			return false;			
//				}		
//			}
			if (document.RegForm.phnum1.value !== '')
			{
			var check = /^\d+$/  
			if (!(check.test(document.RegForm.phnum1.value))) {
			window.alert('Enter only numbers for contact number, please!');
			document.RegForm.phnum1.value = '';
			document.RegForm.phnum1.focus();			
			return false;			
				}		
			}
			if (document.RegForm.phnum2.value == ''){
				window.alert('Enter your phone number, please!');
				document.RegForm.phnum2.focus();
				return false;
			}
			if (document.RegForm.phnum2.value !== '')
			{
			var check = /^\d+$/  
			if (!(check.test(document.RegForm.phnum2.value))) {
			window.alert('Enter only numbers for contact number, please!');
			document.RegForm.phnum2.value = '';
			document.RegForm.phnum2.focus();			
			return false;			
				}		
			}
			if (document.RegForm.phnum3.value == ''){
				window.alert('Enter your phone number, please!');
				document.RegForm.phnum3.focus();
				return false;
			}
			if (document.RegForm.phnum3.value !== '')
			{
			var check = /^\d+$/  
			if (!(check.test(document.RegForm.phnum3.value))) {
			window.alert('Enter only numbers for contact number, please!');
			document.RegForm.phnum3.value = '';
			document.RegForm.phnum3.focus();			
			return false;			
				}		
			}
			if (document.RegForm.faxnum.value !== '')
			{
			var check = /^\d+$/  
			if (!(check.test(document.RegForm.faxnum.value))) {
			window.alert('Enter only numbers for contact number, please!');
			document.RegForm.faxnum.value = '';
			document.RegForm.faxnum.focus();			
			return false;			
				}		
			}
			if(document.RegForm.NewUsername.value=="")
			{
				window.alert('Enter your username, please!');
				document.RegForm.NewUsername.focus();
				return false;
			}
			if(document.RegForm.NewUsername.value!="")
			{
				if (document.RegForm.NewUsername.value.length  < 6 || document.RegForm.p1.value.length  > 25 )
				{
					window.alert('Your username must be between 6 to 25 characters !');
					document.RegForm.NewUsername.value="";					
					document.RegForm.NewUsername.focus();
					return false;
				}
				
			}

			if(document.RegForm.p1.value=="")
			{
				window.alert('Enter your password, please!');
				document.RegForm.p1.focus();
				return false;
			}
			if(document.RegForm.p1.value!="")
			{
				if (document.RegForm.p1.value.length  < 6 || document.RegForm.p1.value.length  > 25 )
				{
					window.alert('Your password must be between 6 to 25 characters !');
					document.RegForm.p1.value="";
					document.RegForm.p2.value="";	
					document.RegForm.p1.focus();
					return false;
				}
				
			}

			if(document.RegForm.p2.value=="")
			{
				window.alert('Confirm your password, please!');
				document.RegForm.p2.focus();
				return false;
			}
			

			if(document.RegForm.p1.value != "" && document.RegForm.p2.value != "" && document.RegForm.p1.value != document.RegForm.p2.value)
			{
				window.alert('Enter and confirm your password again!');
				document.RegForm.p1.value="";
				document.RegForm.p2.value="";
				document.RegForm.p1.focus();
				return false;
			}
			
			
			
			
			//checkdealer(document.RegForm.comname.value,document.RegForm.selstate.value,document.RegForm.selcounty.value,document.RegForm.selcity.value,document.RegForm.zip.value,document.RegForm.phone.value);

		}
		

function resetform(formname){

			document.formname.refresh;
}


