/*********************************************************************************
 * email.js - Email script functions provided by Virtual Platinum
 *
 * Description:
 *  
 ********************************************************************************/

function Login(){
if(!IsBlank(document.myform.txtname,'Please Enter Name'))
		return false;
if(!IsBlank(document.myform.txtcity,'Please Enter City'))
		return false;
if(!IsBlank(document.myform.State,'Please Select State'))
		return false;
if(!IsEmail(document.myform.txtemail,'Please Enter Email Address'))
		return false;
if(document.myform.txtconformemail.value!=document.myform.txtemail.value){
	alert("Both Email Address are not same");
	document.myform.focus();
	return false;
	}
return true;
}


function IsBlank(obj,msg)
{
		if(obj.value == "")
		{
			alert(msg);
			obj.focus();
			return false;
		}
		return true;
}



function IsEmail(obj, msgstr)
{
	if(obj.value == "")
	{
		alert("Please Enter Email Address");
		obj.focus();
		return false;
	}
	else
	{
	    if(obj.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
    	    return true;
	    else
		{
			alert("Invalid Email Address");
			obj.focus();
    	    return false;
		}
	}
}
