function validate_required(field,alerttxt)
		{
			with (field)
			{
				if (value==null||value=="")
				{
					alert(alerttxt);
					return false;
				}
				else 
				{
					return true
				}
			}
		}
		
		function validate_form(thisform)
		{
			with (thisform)
			{
				if (validate_required(name,"Name must be filled out!")==false)
					{name.focus();return false;}
				if (validate_required(pwd,"Password must be filled out!")==false)
					{pwd.focus();return false;}
			}
		}


function validate_edit_pwd_form(thisform)
{

	with (thisform)
		{
			if (validate_required(Email,"Email should not be blank")==false)
			{Email.focus();return false;}
			if (document.user.Email.value!="")
				{
					check = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+[.][a-zA-Z]+[a-zA-Z.]*$/.test(document.user.Email.value);
					if (!check) 
					{
			
						alert("Please provide a valid email address.");
						Email.focus();return false;
					}			
				}			
			if (validate_required(name,"Old Password must be filled out!")==false)
			{name.focus();return false;}
			if (validate_required(pwd,"New Password must be filled out!")==false)
			{pwd.focus();return false;}
			if (validate_required(cpwd,"Confirm New Password must be filled out!")==false)
			{cpwd.focus();return false;}
			if(pwd.value!=cpwd.value)
			{			
			alert('New password and Confirm new password must be same!');
			return false;		
			}		
	}

}
function redirect(){
//window.open("welcome.php,_SELF");
window.location.href='welcome.php';
}