//Function for checking the Register details IN Bongopongo

function chkmember(frm)
{
	var cond=true;
	if (frm.varemail.value.length==0){
		alert("Please Enter Email Address.");
		if(cond==true){
		frm.varemail.focus();
		}
		cond=false;
		return false;
	}
	else if(!checkMail(frm.varemail.value)){
		alert("Email must contain an email address.");
		if(cond==true){
			frm.varemail.value="";
			frm.varemail.focus();
		}
		cond=false;
		return false;
	}
	if (frm.varpass.value.length==0){
		alert("Please Enter Password.");
		if(cond==true){
		frm.varpass.focus();
		}
		cond=false;
		return false;
	}
	if (frm.varcpass.value.length==0){
		alert("Please Conform Password.");
		if(cond==true){
		frm.varcpass.focus();
		}
		cond=false;
		return false;
	}
	if(frm.varpass.value !== frm.varcpass.value)
	{
		alert("Password and Confirmed Password both should be same.");
		if(cond==true){
		frm.varcpass.value="";
		frm.varcpass.focus();
		}
		cond=false;
		return false;
	}
	if (frm.birthdate.value.length==""){
		alert("Please Enter Birthdate.");
		if(cond==true){
		frm.birthdate.focus();
		}
		cond=false;
		return false;
	}
	/*if (frm.varcountry.value==""){
		alert("Please Select Country.");
		if(cond==true){
		frm.varcountry.focus();
		}
		cond=false;
		return false;
	}*/
	if (frm.varzipcode.value.length==0 || isNaN(frm.varzipcode.value)){
		alert("Please enter proper zip code.");
		if(cond==true){
		frm.varzipcode.focus();
		}
		cond=false;
		return false;
	}
	if (frm.quesone.value.length==""){
		alert("Please Select Question.");
		if(cond==true){
		frm.quesone.focus();
		}
		cond=false;
		return false;
	}
	if (frm.answer.value.length==""){
		alert("Please give answer.");
		if(cond==true){
		frm.answer.focus();
		}
		cond=false;
		return false;
	}

}

function checkMail(email){
var x = email;
var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (filter.test(x)){
	return true;
	}
	else {
	  return false;
	}
}
	
////////////////


//Function for checking the login details IN Bongopongo

function checklogin(form)
{


	var cond=true;

	if(document.form.txtuname.value.length==0)
	{

		alert("Enter Email Address ");
		if(cond==true){
			document.form.txtuname.focus();
		}
		cond=false;
		return false;
	}
	if(!checkMail(document.form.txtuname.value)){

		alert("Email must contain an email address.\n");

		if(cond==true){

			document.form.txtuname.value="";
			document.form.txtuname.focus();

		}

		cond=false;
		return false;

	}
	if(document.form.txtpass.value.length==0)
	{

		alert("Enter Proper password");
		if(cond==true){

			document.form.txtpass.focus();

		}
		cond=false;
		return false;
	}

	if(cond=true)
	{
			
		document.form.login.value="valid";
		return true;	

	}
}

/////////////////////////////////////
//Function for checking the Forget Password IN Bongopongo
function checkfpass(form)
{
	var cond=true;
	if(form.txtemail.value.length==0)
	{
		alert(" Enter Email Address ");
		if(cond==true){
		form.txtemail.focus();
		}
		cond=false;
		return false;
	}
	if(!checkMail(form.txtemail.value)){
		alert("Email must contain an email address.\n");
		if(cond==true){
			form.txtemail.value="";
			form.txtemail.focus();
		}
		cond=false;
		return false;
	}
	if(cond=true)
	{
		form.hidforgot.value="forgot";
		return true;	
	}
	
}


//Function for checking Payment IN Bongopongo


function chkpayment(frm)
{
	var cond=true;
	
	if (frm.txtcno.value.length==0 || isNaN(frm.txtcno.value)){
		alert("Please Enter Proper Credit Card No.");
		if(cond==true){
		frm.txtcno.value = "";
		frm.txtcno.focus();
		}
		cond=false;
		return false;
	}
	if (frm.txtcvalid.value.length==0 || isNaN(frm.txtcvalid.value)){
		alert("Please Enter Proper CVV Code.");
		if(cond==true){
		frm.txtcvalid.value = "";
		frm.txtcvalid.focus();
		}
		cond=false;
		return false;
	}
	
	if (frm.txtcname.value.length=="")
	{
		alert("Please Enter Card Holder Name.");
		if(cond==true){
		frm.txtcname.focus();
		}
		cond=false;
		return false;
	
	
	}
	if (frm.txtadd1.value.length=="")
	{
		alert("Please Enter Billing Address.");
		if(cond==true){
		frm.txtadd1.focus();
		}
		cond=false;
		return false;
	
	
	}
	if (frm.txtcity.value.length=="")
	{
		alert("Please Enter City.");
		if(cond==true){
		frm.txtcity.focus();
		}
		cond=false;
		return false;
	
	
	}
	if (frm.txtstate.value.length=="")
	{
		alert("Please Enter State.");
		if(cond==true){
		frm.txtstate.focus();
		}
		cond=false;
		return false;
	
	
	}
	if (frm.varcountry.value=="")
	{
		alert("Please Select Country.");
		if(cond==true){
		frm.varcountry.focus();
		}
		cond=false;
		return false;
	
	
	}
	if (frm.txtzip.value.length=="")
	{
		alert("Please Enter ZipCode.");
		if(cond==true){
		frm.txtzip.focus();
		}
		cond=false;
		return false;
	
	
	}
	
	

}


