function checkform()
{
	
	var errorStr = "";
    
 
    if(Trim(document.getElementById('firstname').value)==""){
		alert("Enter first name");
		document.getElementById('firstname').focus();
		return false;
	}

	if(Trim(document.getElementById('lastname').value)==""){
		alert("Enter last name");
		document.getElementById('lastname').focus();
		return false;
	}

	if(Trim(document.getElementById('email').value)==""){
		alert("Enter email address");
		document.getElementById('email').focus();
		return false;
	}else{
		
		 if (echeck(document.getElementById('email').value)==false){ 
				alert("Invalid E-mail Address! Please re-enter.");
				document.getElementById('email').focus();
				return false;
         }

	}

	if(Trim(document.getElementById('confirmemail').value)==""){
		alert("Enter confirm email address");
		document.getElementById('confirmemail').focus();
		return false;
	}else{
		
		 if (echeck(document.getElementById('confirmemail').value)==false){ 
				alert("Invalid E-mail Address! Please re-enter.");
				document.getElementById('confirmemail').focus();
				return false;
         }

	}

	if(Trim(document.getElementById('confirmemail').value)!="" && Trim(document.getElementById('email').value)!=""){
		if(Trim(document.getElementById('confirmemail').value)!=Trim(document.getElementById('email').value)){
			alert("Entered email and confirm email dont match");
			document.getElementById('confirmemail').focus();
			return false;
		}
	}
	if (CheckEmpty(document.getElementById('password1'))) {

		errorStr = "Please enter a password (min 6 characters)";
		  
	} 	
	else if (document.getElementById('password1').value.length < 6) {

		errorStr += "\n Password must have at least 6 characters. Please Re-enter.";
	} 
	else if (hasSpecialChar(document.getElementById('password1').value)==false){ 
		errorStr += "\n Password can not contain Special charecters.";
	}
	else if (document.getElementById('password1').value.indexOf(" ") >= 0) {
	
		errorStr += "\n Space is not ALLOWED for password. Please re-enter.";
	}

	   if(errorStr!="")
		{
			alert(errorStr);
			document.getElementById('password1').focus();
			return false;
		}
   
    if (CheckEmpty(document.getElementById('confirmpassword'))) {

		errorStr = "Please enter confirm password";
		  
	} 
	if(errorStr!="")
		{
			alert(errorStr);
			document.getElementById('confirmpassword').focus();
			return false;
		}

   if(document.getElementById('password1').value!="" && document.getElementById('confirmpassword').value!=""){
	 if(document.getElementById('password1').value!=document.getElementById('confirmpassword').value){
         alert("Entered password and confirm password dont match");
		 document.getElementById('confirmpassword').focus();
		 return false;
		 
	 }
   }

	if(Trim(document.getElementById('phone').value)==""){
		alert("Enter phone number");
		document.getElementById('phone').focus();
		return false;
	 }

	 if(Trim(document.getElementById('city').value)==""){
		alert("Enter city");
		document.getElementById('city').focus();
		return false;
	 }

	 if(Trim(document.getElementById('country').value)==""){
		alert("Enter country");
		document.getElementById('country').focus();
		return false;
	 }
	 
	/*alert(document.getElementById('profile').value);
	 if(Trim(document.getElementById('profile').value)==""){
		alert("Select profile");
		document.getElementById('profile').focus();
		return false;
	 }*/
	
         // TOS check
	if (!document.signup.terms.checked) {
		errorStr = "Please check the agree to our terms box.";
		alert(errorStr);
		return false;
	}    
   
	
   return true;
	
}

function checkedit(){
	var errorStr = "";
    
 
    if(Trim(document.getElementById('firstname').value)==""){
		alert("Enter first name");
		document.getElementById('firstname').focus();
		return false;
	}

	if(Trim(document.getElementById('lastname').value)==""){
		alert("Enter last name");
		document.getElementById('lastname').focus();
		return false;
	}

	if(Trim(document.getElementById('phone').value)==""){
		alert("Enter phone number");
		document.getElementById('phone').focus();
		return false;
	 }

	 if(Trim(document.getElementById('city').value)==""){
		alert("Enter city");
		document.getElementById('city').focus();
		return false;
	 }

	 if(Trim(document.getElementById('country').value)==""){
		alert("Enter country");
		document.getElementById('country').focus();
		return false;
	 }

   return true;

}