function validate_register()
{
	 var reEmail = /^.+\@.+\..+$/            
    if(document.formregister.email.value=='')
    {
        alert("Please Enter your Email Address.");
        document.formregister.email.focus();
        return false;
    }
    if(!reEmail.test(document.formregister.email.value))
    {
        alert("Please Enter a Valid Email Address.");
        document.formregister.email.focus();
        return false;
    } 
	
	 if(document.formregister.password.value == '')
    {
        alert("Please enter your password.");
        document.formregister.password.focus();
        return false;
    }
	 if(document.formregister.password.value != document.formregister.confirmpassword.value)
    {
        alert("Please reconfirm your password.");
        document.formregister.password.focus();
        return false;
    }
	 if(document.formregister.mobile.value=='')
    {
        alert("Please enter your Mobile number.");
        document.formregister.mobile.focus();
        return false;
    }
	
	 if(document.formregister.agreechk.checked == false)
    {
        alert("Please agree with the terms and conditions.");
        document.formregister.agreechk.focus();
        return false;
    }
    
}

function validate_login()
{
 var reEmail = /^.+\@.+\..+$/            
    if(document.formlogin.loginemail.value=='')
    {
        alert("Please Enter your Email Address.");
        document.formlogin.loginemail.focus();
        return false;
    }
    if(!reEmail.test(document.formlogin.loginemail.value))
    {
        alert("Please Enter a Valid Email Address.");
        document.formlogin.loginemail.focus();
        return false;
    } 
	
	if(document.formlogin.loginpassword.value == '')
    {
        alert("Please enter your password.");
        document.formlogin.loginpassword.focus();
        return false;
    }
}

function validate_bid(logged)
{	
	if(document.bidform.bidamount.value == '')
    {
        alert("Please enter your bid.");
        document.bidform.bidamount.focus();
        return false;
    }

	var bid=eval(document.bidform.bidamount.value);
	var cbid=eval(document.bidform.currentbid.value);
	var result =eval(bid - cbid);
	if( result < 1000)
    {
        alert("Increase bids by at least Rs 1,000");
        document.bidform.bidamount.focus();
        return false;
    }
	
	var cpname=document.bidform.currentpaintingname.value;
	if(logged)
	{
		if(confirm("You have bid Rs "+bid+" for the Painting titled "+cpname+" . Click on Ok to accept bid, or cancel to go back "))
		return true;
		else
		return false;
	}
}

function validate_forgotpassword()
{
	var reEmail = /^.+\@.+\..+$/            
    if(document.forgotpassswordform.email.value=='')
    {
        alert("Please Enter your Email Address.");
        document.forgotpassswordform.email.focus();
        return false;
    }
    if(!reEmail.test(document.forgotpassswordform.email.value))
    {
        alert("Please Enter a Valid Email Address.");
        document.forgotpassswordform.email.focus();
        return false;
    } 
	
}
  