function checkAmount(){
	var da=document.recurring_df.recurring_mth_amont.value;
	if((parseFloat(da)+"")!=da ){
	alert("The amount can only be number ");
	return;
	}
	if(parseFloat(da)<=0 ){
	is_form_validated=0;
	alert("The amount must larger than 0 ");
	return;
	}
}

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}
    	 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }
		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
 		 return true					
	}

function validate_email(){
	var emailID=document.getElementById("contact_email");
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID")
		emailID.focus()
		}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
	}
}

function check_card_type() {
	var cc_type = document.recurring_df.cardtype.value;
	if (cc_type == "") {
		alert("Please choose card type !");
		is_form_validated=0;
	}else{
	    is_form_validated=1;
	}	//return(true);
}

function checkLUHN() {
	var ccnum = document.recurring_df.cc_number.value;
	ccnum = "" + ccnum;
	var i, sum, weight;
	sum=0;
	for (i = 0; i < ccnum.length - 1; i++) {
		weight = ccnum.substr(ccnum.length - (i + 2), 1) * (2 - (i % 2));
		sum += ((weight < 10) ? weight : (weight - 9));
	}

	if (parseInt(ccnum.substr(ccnum.length-1)) == ((10 - sum % 10) % 10)) {
		is_form_validated=1;
	} else {
		is_form_validated=0;
		alert("You did not enter a valid card number. Please check that you have entered it correctly)");
		}
}

function check_email(){
var email_field = document.recurring_df.contact_email.value
if (email_field == ""){
alert ( " the email address is requied !!!")	
	
	
	
	
}

}
