function checkBlank(formelement,text)
{
	if (formelement.value=='')
	{
  alert('Enter '+text);
  formelement.focus();
	return false;
  }
	else
	{
	return true;
	}
}

function checkNaN(formelement,text)
{
	if (isNaN(formelement.value))
	{
  alert('Enter Numeric '+text);
  formelement.focus();
	return false;
  }
	else
	{
	return true;
	}
}

function checkEmail(formelement,text)	
{
	if(formelement.value!='')
	{
		var b=formelement.value.indexOf('@');
		var c=formelement.value.indexOf('.');
		var d=c-b;
		var len=formelement.value.length;
	
		if((d==0)||(c==-1)||(b==-1)||(d==1)||((len-c)==1))
		{
			alert("Enter a valid "+text);
			formelement.focus();
			return false;
		}
		else
		{
			return true;
		}
	}
}


function myvalidate()
{	
		if(!checkBlank(document.form1.Name,'Name')) return false;
		if(!checkBlank(document.form1.tel,'Tel No.')) return false;
		if(!checkBlank(document.form1.city,'City')) return false;
		if(!checkBlank(document.form1.email,'Email address')) return false;
		if(!checkEmail(document.form1.email,'Email Address')) return false;

		//alert(document.login_frm.ref_url.value);
	}
function checkAccountForm()
{	
		if(!checkBlank(document.AccountForm.firstname,'First Name')) return false;
		if(!checkBlank(document.AccountForm.lastname,'Last Name')) return false;
		if(!checkBlank(document.AccountForm.address1,'Address 1')) return false;
		if(!checkBlank(document.AccountForm.city,'City')) return false;
		if(!checkBlank(document.AccountForm.zip,'Zip')) return false;
		if(!checkBlank(document.AccountForm.email,'Email address')) return false;
		if(!checkEmail(document.AccountForm.email,'Email Address')) return false;
		if(!checkBlank(document.AccountForm.phone,'Phone No.')) return false;
		if(!checkBlank(document.AccountForm.initialDeposit,'Initial Deposit')) return false;
	}
