function contactinfo()
{
	
		var contact_email=document.contact_form.contact_email.value
		var at="@"
		var dot="."
		var lat=contact_email.indexOf(at)
		var lstr=contact_email.length
		var ldot=contact_email.indexOf(dot)
	
if(document.contact_form.first_name.value=="")
{
 alert("Please enter your first name");
 document.contact_form.first_name.focus();
 return false;
}

if(!isNaN(document.contact_form.first_name.value))
{
 alert("Please enter your first name with alphabets")
 document.contact_form.first_name.focus()
 return false;
}

var iChars = "!@#`~_$%^&*()+=-[]\\\';,./{}|\":<>?0123456789";

  for (var i = 0; i < document.contact_form.first_name.value.length; i++) {
  	if (iChars.indexOf(document.contact_form.first_name.value.charAt(i)) != -1) {
  	alert ("Please enter your first name with alphabets");
  	return false;
  	}
  }


  if(document.contact_form.last_name.value=="")
{
 alert("Please enter your last name");
 document.contact_form.last_name.focus();
 return false;
}

if(!isNaN(document.contact_form.last_name.value))
{
 alert("Please enter your last name with alphabets")
 document.contact_form.last_name.focus()
 return false;
}

var iChars = "!@#`~_$%^&*()+=-[]\\\';,./{}|\":<>?0123456789";

  for (var i = 0; i < document.contact_form.last_name.value.length; i++) {
  	if (iChars.indexOf(document.contact_form.last_name.value.charAt(i)) != -1) {
  	alert ("Please enter your last name with alphabets");
  	return false;
  	}
  }

  
  if (contact_email==""){
		   alert("Please enter your Email Id")
		   document.contact_form.contact_email.focus()
		   return false
		}  
  if (contact_email.indexOf(at)==-1){
		   alert("Please enter a valid Email Id")
		   document.contact_form.contact_email.focus()
		   return false
		}

		if (contact_email.indexOf(at)==-1 || contact_email.indexOf(at)==0 || contact_email.indexOf(at)==lstr){
		   alert("Please enter a valid Email Id")
		   document.contact_form.contact_email.focus()
		   return false
		}

		if (contact_email.indexOf(dot)==-1 || contact_email.indexOf(dot)==0 || contact_email.indexOf(dot)==lstr){
		    alert("Please enter a valid Email Id")
			document.contact_form.contact_email.focus()
		    return false
		}

		 if (contact_email.indexOf(at,(lat+1))!=-1){
		    alert("Please enter a valid Email Id")
			document.contact_form.contact_email.focus()
		    return false
		 }

		 if (contact_email.substring(lat-1,lat)==dot || contact_email.substring(lat+1,lat+2)==dot){
		    alert("Please enter a valid Email Id")
			document.contact_form.contact_email.focus()
		    return false
		 }

		 if (contact_email.indexOf(dot,(lat+2))==-1){
		    alert("Please enter a valid Email Id")
			document.contact_form.contact_email.focus()
		    return false
		 }
		
		 if (contact_email.indexOf(" ")!=-1){
		    alert("Please enter a valid Email Id")
			document.contact_form.contact_email.focus()
		    return false
		 }

			if(document.contact_form.message.value=="")
			{
			 alert("Please enter your message");
			 document.contact_form.message.focus();
			 return false;
			}

}


function forgetpassword()
{
	
		var email_id=document.forget_password.user_emailid.value
		var at="@"
		var dot="."
		var lat=email_id.indexOf(at)
		var lstr=email_id.length
		var ldot=email_id.indexOf(dot)
	
  
  if (email_id==""){
		   alert("Please enter your Email Id")
		   document.forget_password.user_emailid.focus()
		   return false
		}  
  if (email_id.indexOf(at)==-1){
		   alert("Please enter a valid Email Id")
		   document.forget_password.user_emailid.focus()
		   return false
		}

		if (email_id.indexOf(at)==-1 || email_id.indexOf(at)==0 || email_id.indexOf(at)==lstr){
		   alert("Please enter a valid Email Id")
		   document.forget_password.user_emailid.focus()
		   return false
		}

		if (email_id.indexOf(dot)==-1 || email_id.indexOf(dot)==0 || email_id.indexOf(dot)==lstr){
		    alert("Please enter a valid Email Id")
			document.forget_password.user_emailid.focus()
		    return false
		}

		 if (email_id.indexOf(at,(lat+1))!=-1){
		    alert("Please enter a valid Email Id")
			document.forget_password.user_emailid.focus()
		    return false
		 }

		 if (email_id.substring(lat-1,lat)==dot || email_id.substring(lat+1,lat+2)==dot){
		    alert("Please enter a valid Email Id")
			document.forget_password.user_emailid.focus()
		    return false
		 }

		 if (email_id.indexOf(dot,(lat+2))==-1){
		    alert("Please enter a valid Email Id")
			document.forget_password.user_emailid.focus()
		    return false
		 }
		
		 if (email_id.indexOf(" ")!=-1){
		    alert("Please enter a valid Email Id")
			document.forget_password.user_emailid.focus()
		    return false
		 }
}


function change_password_details() {
	if(document.change_password.exist_password.value=="")
	{
	alert("Please enter existing password");
	document.change_password.exist_password.focus();
	return false;
	}
	if(document.change_password.user_password.value=="")
	{
	alert("Please enter new password");
	document.change_password.user_password.focus();
	return false;
	}
	else if((document.change_password.user_password.value.length)<6 || (document.change_password.user_password.value.length)>12)
	 {
		alert("New Password cannot be less than 6 characters and more than 12 characters");
		document.change_password.user_password.focus();
		return false;
		}
	if(document.change_password.re_password.value=="")
	{
	alert("Please Re-Type password");
	document.change_password.re_password.focus();
	return false;
	} 
	else 
	if((document.change_password.user_password.value)!=(document.change_password.re_password.value)) {
		alert("Re-Type correct password");
		document.change_password.re_password.focus();
		return false;
		}
	
	return true;
}


function classcontactinfo()
{
	
		var email=document.class_conform.email.value
		var at="@"
		var dot="."
		var lat=email.indexOf(at)
		var lstr=email.length
		var ldot=email.indexOf(dot)

if(document.class_conform.name.value=="")
{
 alert("Please enter your name");
 document.class_conform.name.focus();
 return false;
}

if(!isNaN(document.class_conform.name.value))
{
 alert("Please enter your name with alphabets")
 document.class_conform.name.focus()
 return false;
}

var iChars = "!@#`~_$%^&*()+=-[]\\\';,./{}|\":<>?0123456789";

  for (var i = 0; i < document.class_conform.name.value.length; i++) {
  	if (iChars.indexOf(document.class_conform.name.value.charAt(i)) != -1) {
  	alert ("Please enter your name with alphabets");
  	return false;
  	}
  }

  
  if (email==""){
		   alert("Please enter your Email Id")
		   document.class_conform.email.focus()
		   return false
		}  
  if (email.indexOf(at)==-1){
		   alert("Please enter a valid Email Id")
		   document.class_conform.email.focus()
		   return false
		}

		if (email.indexOf(at)==-1 || email.indexOf(at)==0 || email.indexOf(at)==lstr){
		   alert("Please enter a valid Email Id")
		   document.class_conform.email.focus()
		   return false
		}

		if (email.indexOf(dot)==-1 || email.indexOf(dot)==0 || email.indexOf(dot)==lstr){
		    alert("Please enter a valid Email Id")
			document.class_conform.email.focus()
		    return false
		}

		 if (email.indexOf(at,(lat+1))!=-1){
		    alert("Please enter a valid Email Id")
			document.class_conform.email.focus()
		    return false
		 }

		 if (email.substring(lat-1,lat)==dot || email.substring(lat+1,lat+2)==dot){
		    alert("Please enter a valid Email Id")
			document.class_conform.email.focus()
		    return false
		 }

		 if (email.indexOf(dot,(lat+2))==-1){
		    alert("Please enter a valid Email Id")
			document.class_conform.email.focus()
		    return false
		 }
		
		 if (email.indexOf(" ")!=-1){
		    alert("Please enter a valid Email Id")
			document.class_conform.email.focus()
		    return false
		 }

if(document.class_conform.question.value=="")
{
 alert("Please enter your question");
 document.class_conform.question.focus();
 return false;
}

}
//
//
//function testimonialinfo()
//{
//	
//	var email=document.testimonial_form.author_emailid.value
//	var at="@"
//	var dot="."
//	var lat=email.indexOf(at)
//	var lstr=email.length
//	var ldot=email.indexOf(dot)
//if(document.testimonial_form.first_name.value=="")
//{
// alert("Please enter your first name");
// document.testimonial_form.first_name.focus();
// return false;
//}
//
//if(!isNaN(document.testimonial_form.first_name.value))
//{
// alert("Please enter your first name with alphabets")
// document.testimonial_form.first_name.focus()
// return false;
//}
//
//var iChars = "!@#`~_$%^&*()+=-[]\\\';,./{}|\":<>?0123456789";
//
//  for (var i = 0; i < document.testimonial_form.first_name.value.length; i++) {
//  	if (iChars.indexOf(document.testimonial_form.first_name.value.charAt(i)) != -1) {
//  	alert ("Please enter your first name with alphabets");
//  	return false;
//  	}
//  }
//
//
//if(document.testimonial_form.last_name.value=="")
//{
// alert("Please enter your last name");
// document.testimonial_form.last_name.focus();
// return false;
//}
//
//if(!isNaN(document.testimonial_form.last_name.value))
//{
// alert("Please enter your last name with alphabets")
// document.testimonial_form.last_name.focus()
// return false;
//}
//
//var iChars = "!@#`~_$%^&*()+=-[]\\\';,./{}|\":<>?0123456789";
//
//  for (var i = 0; i < document.testimonial_form.last_name.value.length; i++) {
//  	if (iChars.indexOf(document.testimonial_form.last_name.value.charAt(i)) != -1) {
//  	alert ("Please enter your last name with alphabets");
//  	return false;
//  	}
//  }
//  if (email==""){
//	   alert("Please enter your Email Id")
//	   document.testimonial_form.email.focus()
//	   return false
//	}  
//if (email.indexOf(at)==-1){
//	   alert("Please enter a valid Email Id")
//	   document.testimonial_form.email.focus()
//	   return false
//	}
//
//	if (email.indexOf(at)==-1 || email.indexOf(at)==0 || email.indexOf(at)==lstr){
//	   alert("Please enter a valid Email Id")
//	   document.testimonial_form.email.focus()
//	   return false
//	}
//
//	if (email.indexOf(dot)==-1 || email.indexOf(dot)==0 || email.indexOf(dot)==lstr){
//	    alert("Please enter a valid Email Id")
//		document.testimonial_form.email.focus()
//	    return false
//	}
//
//	 if (email.indexOf(at,(lat+1))!=-1){
//	    alert("Please enter a valid Email Id")
//		document.testimonial_form.email.focus()
//	    return false
//	 }
//
//	 if (email.substring(lat-1,lat)==dot || email.substring(lat+1,lat+2)==dot){
//	    alert("Please enter a valid Email Id")
//		document.testimonial_form.email.focus()
//	    return false
//	 }
//
//	 if (email.indexOf(dot,(lat+2))==-1){
//	    alert("Please enter a valid Email Id")
//		document.testimonial_form.email.focus()
//	    return false
//	 }
//	
//	 if (email.indexOf(" ")!=-1){
//	    alert("Please enter a valid Email Id")
//		document.testimonial_form.email.focus()
//	    return false
//	 }
//
//}
//if(document.testimonial_form.author_phone.value=="")
//{
// alert("Please enter your phone numbert");
// document.testimonial_form.author_phone.focus();
// return false;
//}
//if(document.testimonial_form.content.value=="")
//{
// alert("Please enter your testimonial content");
// document.testimonial_form.content.focus();
// return false;
//}
//
//return true;
//}

function loginvalidate()
{
	if(document.login.user_emailid.value=="")
	{
		alert("Please enter username");
		document.login.user_emailid.focus();
		return false;
	}
	if(document.login.user_password.value=="")
	{
		alert("Please enter password");
		document.login.user_password.focus();
		return false;
	}
}

function validate()
{
    var author_emailid=document.testimonial_form.author_emailid.value
    var at="@"
    var dot="."
    var lat=author_emailid.indexOf(at)
    var lstr=author_emailid.length
    var ldot=author_emailid.indexOf(dot)

  if(document.testimonial_form.first_name.value=="")
  {
  alert("\n\n Please Enter First Name");
  document.testimonial_form.first_name.focus();
  return false;
  }
  if(document.testimonial_form.last_name.value=="")
  {
  alert("\n\n Please Enter Second Name");
  document.testimonial_form.last_name.focus();
  return false;
  }
  if(document.testimonial_form.author_emailid.value=="")
  {
  alert("\n\n Please Enter EmailID");
  document.testimonial_form.author_emailid.focus();
  return false;
  }

  if (author_emailid.indexOf(at)==-1){
		   alert("Please enter a valid Email Id")
		   document.testimonial_form.author_emailid.focus()
		   return false
		}

		if (author_emailid.indexOf(at)==-1 || author_emailid.indexOf(at)==0 || author_emailid.indexOf(at)==lstr){
		   alert("Please enter a valid Email Id")
		   document.testimonial_form.author_emailid.focus()
		   return false
		}

		if (author_emailid.indexOf(dot)==-1 || author_emailid.indexOf(dot)==0 || author_emailid.indexOf(dot)==lstr){
		    alert("Please enter a valid Email Id")
			document.testimonial_form.author_emailid.focus()
		    return false
		}

		 if (author_emailid.indexOf(at,(lat+1))!=-1){
		    alert("Please enter a valid Email Id")
			document.testimonial_form.author_emailid.focus()
		    return false
		 }

		 if (author_emailid.substring(lat-1,lat)==dot || author_emailid.substring(lat+1,lat+2)==dot){
		    alert("Please enter a valid Email Id")
			document.testimonial_form.author_emailid.focus()
		    return false
		 }

		 if (author_emailid.indexOf(dot,(lat+2))==-1){
		    alert("Please enter a valid Email Id")
			document.testimonial_form.author_emailid.focus()
		    return false
		 }

		 if (author_emailid.indexOf(" ")!=-1){
		    alert("Please enter a valid Email Id")
			document.testimonial_form.author_emailid.focus()
		    return false
		 }


  if(document.testimonial_form.author_phone.value=="")
  {
  alert("\n\n Please Enter Phone Number");
  document.testimonial_form.author_phone.focus();
  return false;
  }
  if(document.testimonial_form.testimonial_content.value=="")
  {
  alert("\n\n Please Enter Testimonial");
  document.testimonial_form.testimonial_content.focus();
  return false;
  }
  
  else
  return true;
}

function check()
{
	var avail=parseInt(document.itemform.availquantity.value);
	var qnty=parseInt(document.itemform.quantity.value);
	if(avail<qnty)
	{
		document.getElementById('prodavail').innerHTML='Only '+avail+' item(s) is available';
	}
	else
	{
		document.getElementById('prodavail').innerHTML='';
		var amt=parseInt(document.itemform.price.value);
		var tot= qnty * amt;
		tot=Math.round(tot*Math.pow(10,2))/Math.pow(10,2);
		if(isNaN(qnty))
		{
		//	document.getElementById('total').innerHTML='';
		}
		else
		{
		//	document.getElementById('total').innerHTML='$'+tot;
		}
		document.frmpaypal.amount.value=tot;
	}
}

function validatepaypal()
{
	var qnty=document.itemform.quantity.value;
	if(qnty=='' || qnty==0)
	{
		alert('Please enter the quantity');
		document.itemform.quantity.focus();
		return false;
	}
	var iChars = '- 0123456789';
	 for (var i = 0; i<document.itemform.quantity.value.length; i++) {
		if (iChars.indexOf(document.itemform.quantity.value.charAt(i)) == -1) {
		alert ("Please enter valid quantity.");
		document.itemform.quantity.focus();
		return false;
		}
	 }
	if(document.getElementById('prodavail').innerHTML!='')
	{
		alert('Please enter only available quantity');
		document.itemform.quantity.focus();
		return false;
	}
}

function classregcontactinfo()
{
	
		var email=document.registration_form.user_email.value
		var at="@"
		var dot="."
		var lat=email.indexOf(at)
		var lstr=email.length
		var ldot=email.indexOf(dot)
	
if(document.registration_form.user_fname.value=="")
{
 alert("Please enter your name");
 document.registration_form.user_fname.focus();
 return false;
}

if(!isNaN(document.registration_form.user_fname.value))
{
 alert("Please enter your name with alphabets")
 document.registration_form.user_fname.focus()
 return false;
}

var iChars = "!@#`~_$%^&*()+=-[]\\\';,./{}|\":<>?0123456789";

  for (var i = 0; i < document.registration_form.user_fname.value.length; i++) {
  	if (iChars.indexOf(document.registration_form.user_fname.value.charAt(i)) != -1) {
  	alert ("Please enter your name with alphabets");
  	return false;
  	}
  }

  
  if (email==""){
		   alert("Please enter your Email Id")
		   document.registration_form.user_email.focus()
		   return false
		}  
  if (email.indexOf(at)==-1){
		   alert("Please enter a valid Email Id")
		   document.registration_form.user_email.focus()
		   return false
		}

		if (email.indexOf(at)==-1 || email.indexOf(at)==0 || email.indexOf(at)==lstr){
		   alert("Please enter a valid Email Id")
		   document.registration_form.user_email.focus()
		   return false
		}

		if (email.indexOf(dot)==-1 || email.indexOf(dot)==0 || email.indexOf(dot)==lstr){
		    alert("Please enter a valid Email Id")
			document.registration_form.user_email.focus()
		    return false
		}

		 if (email.indexOf(at,(lat+1))!=-1){
		    alert("Please enter a valid Email Id")
			document.registration_form.user_email.focus()
		    return false
		 }

		 if (email.substring(lat-1,lat)==dot || email.substring(lat+1,lat+2)==dot){
		    alert("Please enter a valid Email Id")
			document.registration_form.user_email.focus()
		    return false
		 }

		 if (email.indexOf(dot,(lat+2))==-1){
		    alert("Please enter a valid Email Id")
			document.registration_form.user_email.focus()
		    return false
		 }
		
		 if (email.indexOf(" ")!=-1){
		    alert("Please enter a valid Email Id")
			document.registration_form.user_email.focus()
		    return false
		 }


if(document.registration_form.total_people.value=="")
{
 alert("Please enter how many people attending");
 document.registration_form.total_people.focus();
 return false;
}

if(!document.registration_form.terms_cond.checked)
{
 alert("Please agree the terms and condition");
 document.registration_form.terms_cond.focus();
 return false;
}

}
