<!--


function validate()
{
var check1,check2,flag;
var url;
url=window.location.href;
document.query.url.value=url;

var name = document.query.txtName.value;
var celib = document.query.txtcontact.value;
var startDate=parseInt(document.query.start_day.value);
var startMonth=parseInt(document.query.start_month.value);
var startYear=parseInt(document.query.start_year.value);

var security_code = document.query.security_code.value;
flag=true;


var mail=document.query.txtMail.value;

var invalidChar = " *|,\":<>/[]{}`\';()&$#%";

// Name validation
if (name=="")
{
	  alert("Please enter your name.");
	  flag=false;
	  document.query.txtName.focus();
	  return false;
}
else
{
	flage=true;
}
//end name validation


// phone number validation
  var digits = "0123456789";

  if (document.query.txtPhone.value== "")
  {
    alert("Please fill in a Phone Number.");
	flag=false;
	document.query.txtPhone.focus();
	return false;
  }
 
  for (var i = 0; i < document.query.txtPhone.value.length; i++)
  {
    temp = document.query.txtPhone.value.substring(i, i+1)

    if (digits.indexOf(temp) == -1 && document.query.txtPhone.value != "")
    {
      alert("The phone number must be a number.");
	  flag=false;
	  document.query.txtPhone.value="";
	  document.query.txtPhone.focus();
	  return false;
      break;
    }
  } 
 if(document.query.txtPhone.value.length<8)
  {
	alert("Please enter a valid phone number( minimum 8 digits).");
	flag=false;
	document.query.txtPhone.focus();
	return false;
  }

// celibrity city validation
if (celib=="")
{
	  alert("Please Enter Name of contact person .");
	  flag=false;
	  document.query.txtcontact.focus();
	  return false;
}
else
{
	flage=true;
}
//end celibrity city validation


//date validation
	todayDate=new Date();
	thisday=todayDate.getDay();
		
	thismonth=todayDate.getMonth()+1;
	thisdate=todayDate.getDate();
	thisyear=todayDate.getFullYear();
	
	if(startYear<thisyear )
	{
		
		alert("Please enter Valid Year");
		flag=false;
		document.query.start_year.focus();
		return false;
									
	}
	else
	{
		if(startYear==thisyear)
		{
					
			if(startMonth<thismonth )
			{
				alert("Month Error");
				flag=false;
				document.query.start_month.focus();
				return false;
									
			}
			
			else
			{
			
				if(startMonth==thismonth )
				{
					if(startDate<=thisdate)
					{
						
							alert("Start Date is not valid");
							flag=false;
							document.query.start_day.focus();
							return false;
					}
					
		
				}
				else
				{
					flag=true;
				}
	
				flag=true;
			}	
		
			flag=true;
	}

}
		
		
// date validation ends



// mail validation
if(mail!="")
	{
		check1=mail.indexOf("@");
		check2=mail.indexOf(".");
		if(check1==-1 || check2==-1)
			{
				flag=false;
			}
		if((check1-check2)==1 || (check1-check2)==-1)
			{
				flag=false;
			}
		
	}

if(mail=="")
{
	flag=false;
}
if (security_code=="")
{
	  alert("Please enter Security code.");
	  flag=false;
	  document.query.security_code.focus();
	  return false;
}
else
{
	flage=true;
}
if(flag==true)
	{
	
	document.query.submit();
	}
else
	{
	alert("Invalid Mail ID");
  	document.query.txtMail.select();
  	document.query.txtMail.focus();

	}
}




// end the hiding comment -->

