// JavaScript Document

var emailval;
var passval;
var passval2;
var repassval;
var nick;
var name;
var paslength;
var paslength2;
var textval;
var nameval;
var addr;
var zipval;
var cellval;
var numval;
var num1;
var num2;
var num3;
var num4;
var boxval;
var ret;
var ret2;

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){
		    emailval="Invalid E-mail ID";
			document.getElementById("em").innerHTML=emailval;
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		    emailval="Invalid E-mail ID";
			document.getElementById("em").innerHTML=emailval;
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    emailval="Invalid E-mail ID";
			document.getElementById("em").innerHTML=emailval;
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    emailval="Invalid E-mail ID";
			document.getElementById("em").innerHTML=emailval;
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    emailval="Invalid E-mail ID";
			document.getElementById("em").innerHTML=emailval;
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    emailval="Invalid E-mail ID";
			document.getElementById("em").innerHTML=emailval;
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    emailval="Invalid E-mail ID";
			document.getElementById("em").innerHTML=emailval;
		    return false
		 }

 		 return true					
	}

function echeck2(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		    emailval=" Invalid E-mail ID";
			document.getElementById("altem").innerHTML=emailval;
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		    emailval=" Invalid E-mail ID";
			document.getElementById("altem").innerHTML=emailval;
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    emailval=" Invalid E-mail ID";
			document.getElementById("altem").innerHTML=emailval;
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    emailval=" Invalid E-mail ID";
			document.getElementById("altem").innerHTML=emailval;
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    emailval=" Invalid E-mail ID";
			document.getElementById("altem").innerHTML=emailval;
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    emailval=" Invalid E-mail ID";
			document.getElementById("altem").innerHTML=emailval;
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    emailval=" Invalid E-mail ID";
			document.getElementById("altem").innerHTML=emailval;
		    return false
		 }

 		 return true					
	}

function emailvalidate(){
	var emailID=document.frm.email
	
	if ((emailID.value==null)||(emailID.value=="")){
		emailval="Please Enter your Email ID";
		document.getElementById("em").innerHTML=emailval;
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }
 
 function altemailvalidation(){
	var emailID=document.frm.altemail
	
	if ((emailID.value==null)||(emailID.value=="")){
		emailval=" Please Enter your Email ID";
		document.getElementById("altem").innerHTML=emailval;
		emailID.focus()
		return false
	}
	if (echeck2(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }
 
 //Password field validation function
 
 function passvalidate(){
	 	if ((document.frm.pass.value==null)||(document.frm.pass.value=="")){
		passval="Please Enter Password";
		document.getElementById("pas").innerHTML=passval;
		document.frm.pass.focus()
		return false
	}
	else{
	 passval=document.frm.pass.value;
	 paslength=passval.length;
	 if((paslength<5) || (paslength>15)){
		 passval="Maximum Range 5-15";
		 document.getElementById("pas").innerHTML=passval;
		 document.frm.pass.focus();
		 return false;
	 }
	 return true;
	}
	return true;
 }
 
function oldpasvalidate(){
	 	if ((document.frm.oldpass.value==null)||(document.frm.oldpass.value=="")){
		passval="Please Enter Password";
		document.getElementById("oldpas").innerHTML=passval;
		document.frm.oldpass.focus()
		return false
	}
	else{
	 passval=document.frm.oldpass.value;
	 paslength=passval.length;
	 if((paslength<5) || (paslength>15)){
		 passval="Maximum Range 5-15";
		 document.getElementById("oldpas").innerHTML=passval;
		 document.frm.oldpass.focus();
		 return false;
	 }
	 return true;
	}
	return true;
 }

function newpassvalidate(){
	 passval2=document.frm.pass.value;
	 paslength2=passval2.length;
	 if ((document.frm.pass.value==null)||(document.frm.pass.value=="")){
		return true;
	}
	else{
	 if((paslength2<5) || (paslength2>15)){
		 passval2="Maximum Range 5-15";
		 document.getElementById("pas").innerHTML=passval2;
		 document.frm.pass.focus();
		 return false;
	 }
	 return true;
	}
	 return true;
	}

 function repassvalidate(){
	 if ((document.frm.pass.value==null)||(document.frm.pass.value=="")){
		return true;
	}
	else{
		if (document.frm.repass.value!=document.frm.pass.value){
			repassval="Password Not Match";
			document.getElementById("repas").innerHTML=repassval;
			document.frm.repass.focus();
			return false
		}
		return true;
		}
		return true;
	 }
	 
 function reepassvalidate(){
	 	if ((document.frm.repass.value==null)||(document.frm.repass.value=="")){
		repassval="Please Confirm Passward";
		document.getElementById("repas").innerHTML=repassval;
		document.frm.repass.focus()
		return false
	}
	else{
		if (document.frm.repass.value!=document.frm.pass.value){
			repassval="Password Not Match";
			document.getElementById("repas").innerHTML=repassval;
			document.frm.repass.focus();
			return false
		}
		return true;
		}
		return true;
	 }	 
	 
 function nickvalidation(){
	var chck=document.frm.sname.value;
	var alphaa = chck.charAt(0);
	var ch = alphaa.charCodeAt(0);
	if ((document.frm.sname.value==null)||(document.frm.sname.value=="")){
		textval="Please Enter Screen Name";
		document.getElementById("nick").innerHTML=textval;
		document.frm.sname.focus()
		return false
	}
	else{
	if((ch > 64 && ch<91) || (ch > 96 && ch<123))
	  {
	  }
	  else
	  {
	  textval="Wrong Screen Name";
	  document.getElementById("nick").innerHTML=textval;
	  document.frm.sname.focus();
	  return false;
	  }
	}
 return true;
}
	 
 function namevalidation(){
	var chck=document.frm.fname.value;
	if ((document.frm.fname.value==null)||(document.frm.fname.value=="")){
		nameval="Please Enter First Name";
		document.getElementById("fnam").innerHTML=nameval;
		document.frm.fname.focus()
		return false
	}
	else{
	for(var j=0; j<chck.length; j++)
		{
		var alphaa = chck.charAt(j);
		var ch = alphaa.charCodeAt(0);
		if((ch > 64 && ch<91) || (ch > 96 && ch<123))
	  	{
	  	}
	  	else
	  	{
	  	nameval="Wrong Name";
	  	document.getElementById("fnam").innerHTML=nameval;
	  	document.frm.fname.focus();
	  	return false;
	  	}
		}
	}
 return true;
}

 function cityvalidation(){
	var chck=document.frm.city.value;
	for(var j=0; j<chck.length; j++)
		{
		var alphaa = chck.charAt(j);
		var ch = alphaa.charCodeAt(0);
		if((ch > 64 && ch<91) || (ch > 96 && ch<123))
	  	{
	  	}
	  	else
	  	{
	  	nameval=" Wrong City Name";
	  	document.getElementById("cty").innerHTML=nameval;
	  	document.frm.city.focus();
	  	return false;
	  	}
		}
 return true;
}

 function zipvalidation(){
	var chck=document.frm.code.value;
	for(var j=0; j<chck.length; j++)
		{
		var alphaa = chck.charAt(j);
		var ch = alphaa.charCodeAt(0);
		if((ch > 47 && ch < 58) || (ch > 64 && ch<91) || (ch > 96 && ch<123) || (ch==32))
	  	{
	  	}
	  	else
	  	{
	  	zipval=" Wrong Zip Code";
	  	document.getElementById("zip").innerHTML=zipval;
	  	document.frm.code.focus();
	  	return false;
	  	}
		}
 return true;
}

 function numchecking(numval){
	for(var j=0; j<numval.length; j++)
		{
		var alphaa = numval.charAt(j);
		var ch = alphaa.charCodeAt(0);
		if((ch > 47 && ch < 58) || (ch==46))
	  	{
	  	}
	  	else
	  	{
	  	alert("Only Number Allowed");
	  	return false;
	  	}
		}
 return true;
}

 function phonevalidation(){
	var chck=document.frm.phone.value;
	for(var j=0; j<chck.length; j++)
		{
		var alphaa = chck.charAt(j);
		var ch = alphaa.charCodeAt(0);
		if(ch > 47 && ch < 58)
	  	{
	  	}
	  	else
	  	{
	  	cellval=" Wrong Format";
	  	document.getElementById("cell").innerHTML=cellval;
	  	document.frm.phone.focus();
	  	return false;
	  	}
		}
 return true;
}

 function piccheck(){
	 if((document.frm.Browsepic.value=="") || (document.frm.Browsepic.value==null) ){
	 alert("Please Select Display Image");
	 return false;
	 }
	 return true;
	 }

function datevalidation(){
	if ((document.frm.yy.value=="")||(document.frm.dd.value=="")||(document.frm.mm.value=="")){
		nameval="Select Date";	
		alert(nameval);
		document.frm.mm.focus();
		return false;
	}
	else{
	return true;
	}
	return true;
	}
	
function checkboxvalidation(){
	if(document.frm.agr.checked==false)
	{
		alert("Please Read and Accept Elementatlz Agreement");
		return false;
		}
		else{
			return true;
			}
			return true;
	}

function addressvalidation(){
	if ((document.frm.address.value==null)||(document.frm.address.value=="")){
		addr="Enter Your Address";
	  	document.getElementById("add").innerHTML=addr;
	  	document.frm.address.focus();
	  	return false;
	}
	return true;
	}


 function validation(){
	 document.getElementById("em").innerHTML="";
	 emailval="";
	 emailvalidate();
 }
	 
	 function validationemail(){
	
	document.getElementById("em").innerHTML="";
	 emailval="";
	 var ss=emailvalidate();
	
	if(ss){
		return true;
		 }
		 else{
			 return false;
		
		 }
 }
 
	 
  function validation2(){
	 document.getElementById("em").innerHTML="";
	 document.getElementById("pas").innerHTML="";
	 emailval="";
	 passval="";
	 repassval="";
	 paslength=0;
	 emailvalidate();
	 passvalidate();
 }
 
   function validation3(){
	 document.getElementById("em").innerHTML="";
	 document.getElementById("pas").innerHTML="";
 	 document.getElementById("repas").innerHTML="";
	 emailval="";
	 passval="";
	 repassval="";
	 nick="";
	 name="";
	 paslength=0;
	 emailvalidate();
	 passvalidate();
	 reepassvalidate();
 }
 
    function validation4(){
	 document.getElementById("em").innerHTML="";
	 document.getElementById("pas").innerHTML="";
 	 document.getElementById("repas").innerHTML="";
	 document.getElementById("nick").innerHTML="";
	 emailval="";
	 passval="";
	 repassval="";
	 nick="";
	 name="";
	 paslength=0;
	 textval="";
	 emailvalidate();
	 passvalidate();
	 reepassvalidate();
	 nickvalidation();
 }
 
     function validation5(){
	 document.getElementById("em").innerHTML="";
	 document.getElementById("pas").innerHTML="";
 	 document.getElementById("repas").innerHTML="";
	 document.getElementById("nick").innerHTML="";
	 document.getElementById("fnam").innerHTML="";	 
	 emailval="";
	 passval="";
	 repassval="";
	 nick="";
	 name="";
	 paslength=0;
	 textval="";
	 nameval="";
	 emailvalidate();
	 passvalidate();
	 reepassvalidate();
	 nickvalidation();
	 namevalidation();
 }
 
 function validation6(){	
	 document.getElementById("em").innerHTML="";
	 document.getElementById("pas").innerHTML="";
 	 document.getElementById("repas").innerHTML="";
	 document.getElementById("nick").innerHTML="";
	 document.getElementById("fnam").innerHTML="";
	 emailval="";
	 passval="";
	 repassval="";
	 nick="";
	 name="";
	 paslength=0;
	 textval="";
	 nameval="";
	 boxval="";
	 var em=emailvalidate();
	 var ps=passvalidate();
	 var rps=reepassvalidate();
	 var nik=nickvalidation();
	 var nm=namevalidation();
 	 var ret=datevalidation();
	 var ret2=checkboxvalidation();
	 var im=piccheck();
	 
	 if(em && ps && rps && nik && nm && im && ret && ret2){
		 return true;
		 }
		 else{
			 return false;
			 }
}
 
  function validation7(){
	 document.getElementById("em").innerHTML="";
	 document.getElementById("pas").innerHTML="";
 	 document.getElementById("repas").innerHTML="";
	 document.getElementById("nick").innerHTML="";
	 document.getElementById("fnam").innerHTML="";
 	 document.getElementById("add").innerHTML="";
	 emailval="";
	 passval="";
	 repassval="";
	 nick="";
	 name="";
	 paslength=0;
	 textval="";
	 nameval="";
	 addr="";
	 emailvalidate();
	 passvalidate();
	 repassvalidate();
	 nickvalidation();
	 namevalidation();
	 datevalidation();
	 addressvalidation();
	 return true;
 }

  function oldpasscheck(){
	 document.getElementById("em").innerHTML="";
	 document.getElementById("oldpas").innerHTML="";	 
	 emailval="";
	 passval="";
	 paslength=0;
	 emailvalidate();
	 oldpasvalidate();
	 return true;	 
	 }

 function newpass(){
	 document.getElementById("em").innerHTML="";
	 document.getElementById("oldpas").innerHTML="";	 
	 document.getElementById("pas").innerHTML="";	 
	 emailval="";
	 passval="";
	 paslength=0;
	 emailvalidate();
	 oldpasvalidate();
	 newpassvalidate();
	 return true;
	 }
	 
 function renewpass(){
	 document.getElementById("em").innerHTML="";
	 document.getElementById("oldpas").innerHTML="";	 
	 document.getElementById("pas").innerHTML="";	 
	 document.getElementById("repas").innerHTML="";
	 emailval="";
	 passval="";	 
	 repassval="";
	 paslength=0;
	 emailvalidate();
	 oldpasvalidate();
	 newpassvalidate();
	 repassvalidate();
	 return true;	 
	 }
	 
 function sreenvalidate(){
	 document.getElementById("em").innerHTML="";
	 document.getElementById("oldpas").innerHTML="";	 
	 document.getElementById("pas").innerHTML="";	 
	 document.getElementById("repas").innerHTML="";
	 document.getElementById("nick").innerHTML="";
	 textval="";
	 emailval="";
	 passval="";	 
	 repassval="";
	 paslength=0;
	 emailvalidate();
	 oldpasvalidate();
	 newpassvalidate();
	 repassvalidate();
	 nickvalidation();
	 return true;	 
	 }

 function namevalidate(){
	 document.getElementById("em").innerHTML="";
	 document.getElementById("oldpas").innerHTML="";	 
	 document.getElementById("pas").innerHTML="";	 
	 document.getElementById("repas").innerHTML="";
	 document.getElementById("nick").innerHTML="";
	 document.getElementById("fnam").innerHTML="";
	 textval="";
	 emailval="";
	 passval="";	 
	 repassval="";
	 paslength=0;
	 emailvalidate();
	 oldpasvalidate();
	 newpassvalidate();
	 repassvalidate();
	 nickvalidation();
	 namevalidation();
	 return true;	 
	 }

 function datevalidate(){
	 document.getElementById("em").innerHTML="";
	 document.getElementById("oldpas").innerHTML="";	 
	 document.getElementById("pas").innerHTML="";	 
	 document.getElementById("repas").innerHTML="";
	 document.getElementById("nick").innerHTML="";
	 document.getElementById("fnam").innerHTML="";
	 textval="";
	 emailval="";
	 passval="";	 
	 repassval="";
	 paslength=0;
	 emailvalidate();
	 oldpasvalidate();
	 newpassvalidate();
	 repassvalidate();
	 nickvalidation();
	 namevalidation();
	 datevalidation();
	 return true;	 
	 }
	 
 function cityvalidate(){
	 document.getElementById("em").innerHTML="";
	 document.getElementById("oldpas").innerHTML="";	 
	 document.getElementById("pas").innerHTML="";	 
	 document.getElementById("repas").innerHTML="";
	 document.getElementById("nick").innerHTML="";
	 document.getElementById("fnam").innerHTML="";
	 document.getElementById("cty").innerHTML="";
	 nameval="";
	 textval="";
	 emailval="";
	 passval="";	 
	 repassval="";
	 paslength=0;
	 emailvalidate();
	 oldpasvalidate();
	 newpassvalidate();
	 repassvalidate();
	 nickvalidation();
	 namevalidation();
	 datevalidation();
	 cityvalidation();
	 return true;	 
	 }
	 
 function zipvalidate(){
	 document.getElementById("em").innerHTML="";
	 document.getElementById("oldpas").innerHTML="";	 
	 document.getElementById("pas").innerHTML="";	 
	 document.getElementById("repas").innerHTML="";
	 document.getElementById("nick").innerHTML="";
	 document.getElementById("fnam").innerHTML="";
	 document.getElementById("cty").innerHTML="";
	 document.getElementById("zip").innerHTML="";
	 nameval="";
	 zipval="";
	 nameval="";
	 textval="";
	 emailval="";
	 passval="";	 
	 repassval="";
	 paslength=0;
	 emailvalidate();
	 oldpasvalidate();
	 newpassvalidate();
	 repassvalidate();
	 nickvalidation();
	 namevalidation();
	 datevalidation();
	 cityvalidation();
	 zipvalidation();
	 return true;	 
	 }
	 
 function phonevalidate(){
	 document.getElementById("em").innerHTML="";
	 document.getElementById("oldpas").innerHTML="";	 
	 document.getElementById("pas").innerHTML="";	 
	 document.getElementById("repas").innerHTML="";
	 document.getElementById("nick").innerHTML="";
	 document.getElementById("fnam").innerHTML="";
	 document.getElementById("cty").innerHTML="";
	 document.getElementById("zip").innerHTML="";
	 document.getElementById("cell").innerHTML="";
	 cellval="";
	 nameval="";
	 zipval="";
	 nameval="";
	 textval="";
	 emailval="";
	 passval="";	 
	 repassval="";
	 paslength=0;
	 emailvalidate();
	 oldpasvalidate();
	 newpassvalidate();
	 repassvalidate();
	 nickvalidation();
	 namevalidation();
	 datevalidation();
	 cityvalidation();
	 zipvalidation();
	 phonevalidation();
	 return true;	 
	 }
	 
function altemailvalidate(){
	 document.getElementById("em").innerHTML="";
	 document.getElementById("oldpas").innerHTML="";	 
	 document.getElementById("pas").innerHTML="";	 
	 document.getElementById("repas").innerHTML="";
	 document.getElementById("nick").innerHTML="";
	 document.getElementById("fnam").innerHTML="";
	 document.getElementById("cty").innerHTML="";
	 document.getElementById("zip").innerHTML="";
	 document.getElementById("cell").innerHTML="";
	 document.getElementById("altem").innerHTML="";
	 cellval="";
	 nameval="";
	 zipval="";
	 nameval="";
	 textval="";
	 emailval="";
	 passval="";	 
	 repassval="";
	 paslength=0;
	 var aa=emailvalidate();
	 var bb=oldpasvalidate();
	 var cc=newpassvalidate();
	 var dd=repassvalidate();
	 var ee=nickvalidation();
	 var ff=namevalidation();
	 var gg=datevalidation();
	 var hh=cityvalidation();
	 var ii=zipvalidation();
	 var jj=phonevalidation();
	 var alt=altemailvalidation();
	 if(alt && aa && bb && cc && dd && ee && ff && gg && hh && ii && jj){
		 bodychang();
		 return true;
		 }
		 else{
			 return false;
			 }
}

function altemailvalidate2(){
	 document.getElementById("em").innerHTML="";
	 document.getElementById("oldpas").innerHTML="";	 
	 document.getElementById("pas").innerHTML="";	 
	 document.getElementById("repas").innerHTML="";
	 document.getElementById("nick").innerHTML="";
	 document.getElementById("fnam").innerHTML="";
	 document.getElementById("cty").innerHTML="";
	 document.getElementById("zip").innerHTML="";
	 document.getElementById("cell").innerHTML="";
	 document.getElementById("altem").innerHTML="";
	 cellval="";
	 nameval="";
	 zipval="";
	 nameval="";
	 textval="";
	 emailval="";
	 passval="";	 
	 repassval="";
	 newpass();
	 var aa=emailvalidate();
	 var bb=oldpasvalidate();
	 var cc=newpassvalidate();
	 var dd=repassvalidate();
	 var ee=nickvalidation();
	 var ff=namevalidation();
	 var gg=datevalidation();
	 var hh=cityvalidation();
	 var ii=zipvalidation();
	 var jj=phonevalidation();
	 var alt=altemailvalidation();
	 if(alt && aa && bb && cc && dd && ee && ff && gg && hh && ii && jj){
		 return true;
		 }
		 else{
			 return false;
			 }
}

function numcheck(){
	num1=document.frm.tb1.value;
	var aa=numchecking(num1);
	if(aa){
	return true;
	}
	else{
		return false;
		}
	}

function numcheck2(){
	num1=document.frm.tb1.value;
	num2=document.frm.tb2.value;
	var aa=numchecking(num1);
	var bb=numchecking(num2);
	if(aa && bb){
	return true;
	}
	else{
		return false;
		}
	}
	
function numcheck3(){
	num1=document.frm.tb1.value;
	num2=document.frm.tb2.value;
	num3=document.frm.tb3.value;
	var aa=numchecking(num1);
	var bb=numchecking(num2);
	var cc=numchecking(num3);
	if(aa && bb && cc){
	return true;
	}
	else{
		return false;
		}
	}
	
function numcheck4(){
	num1=document.frm.tb1.value;
	num2=document.frm.tb2.value;
	num3=document.frm.tb3.value;
	num4=document.frm.tb4.value;
	var aa=numchecking(num1);
	var bb=numchecking(num2);
	var cc=numchecking(num3);
	var altr=numchecking(num4);
	 if(altr && aa && bb && cc){
		 bodychang();
		 return true;
		 }
		 else{
			 return false;
			 }
	}
	
function body2check(){
	
	bodychang();
	return true;
	}

	 function queryAction() {
	

var confirmmessage = "Are you sure you want to continue?";


if (confirm(confirmmessage)) {

return true;

} else {

return false;

}
	 }
	 

function subcatval(){
 var cat_val = document.getElementById("catt").value;
 window.location.href="edit_sub_cat.php?cval="+cat_val;
	}
	
function get_s_cat(){	
	var cat_val = document.getElementById("catt").value;
 	var s_cat_val = document.getElementById("sub").value;
	window.location.href="edit_sub_cat.php?cval="+cat_val+"&sval="+s_cat_val+"";		
	}

function catval(){
 var cat_val = document.getElementById("cat").value;
 window.location.href="edit_cat.php?cval="+cat_val;
	}
	
function voucher_amount(){
	var chck=document.frm.v_amount.value;
		if ((chck==null)||(chck=="")){
			alert("Enter Voucher Ammount");
		document.frm.v_amount.focus();
		return false;
	}
	else{
	for(var j=0; j<chck.length; j++)
		{
		var alphaa = chck.charAt(j);
		var ch = alphaa.charCodeAt(0);
		if(ch > 47 && ch < 58)
	  	{
	  	}
	  	else
	  	{
		alert("Number are Allowed");
	  	document.frm.v_amount.focus();
	  	return false;
	  	}
		}
		}
 return true;
	}
	
function voucher_qnty(){
	var chck=document.frm.v_quant.value;
		if ((chck==null)||(chck=="")){
			alert("Enter Voucher Quantity");
		document.frm.v_quant.focus();
		return false;
	}
	else{
	for(var j=0; j<chck.length; j++)
		{
		var alphaa = chck.charAt(j);
		var ch = alphaa.charCodeAt(0);
		if(ch > 47 && ch < 58)
	  	{
	  	}
	  	else
	  	{
		alert("Number are Allowed");
	  	document.frm.v_quant.focus();
	  	return false;
	  	}
		}
		}
 return true;
}

function vouchercheck(){
	var v_am=voucher_amount();
	var v_qn;
	if(v_am){
		v_qn=voucher_qnty();
		if(v_qn){
			return true;
			}
			else{
				return false;
				}
		}
		else{
		return false;
		}
	}

function banner1(){
	window.open("banner1.html",'Banner','width=500,height=60');
}

function banner2(){
	window.open("banner2.html",'Banner','width=140,height=620');
}

 function chk_form(){
	
	
	var amount=document.getElementById('amount').value;
	
	var disc=document.getElementById('disc').value;
	
	if(amount==""){
		
		alert("Please Provide amount to widrow");
		return false;
		
	}

	else{
		
	var b=0;
	try{
	
	b=amount/4;
	
	
	}catch(e){
		
		b=1;
	}
	
	if(!b){
		
	alert("Please Provide number value");	
		return false;
	}
	
	if(disc==""){
		
		alert("Please Provide Litle bit discription");
	return false;
	}else{
		document.frm.submit();
		
	return true;	
	}
	
	}
		
	}
	
	
	function validationrev(){
	passval2=document.frm.review.value;
	paslength2=passval2.length;
	
	if(paslength2==0)
	{
		nameval="Enter Review";	
		alert(nameval);
		document.frm.review.focus();
		return false;
	}
	else if (paslength2<20)
	{
		nameval="Enter count more than 20 words in Review";	
		alert(nameval);
		document.frm.review.focus();
		return false;
	}
	else
	{
		return true;
	}

}
	
function hello()
{
	//return false;
	dat1=document.demoform.dc.value;
	dat2=document.demoform.dc1.value;
	if(dat1=="" || dat1==null)
	{
		alert("Please First Select Date");
		return false;
	}
	else if(dat2=="" || dat2==null)
	{
		alert("Please First Select Date");
		return false;
	}
	else
	{
		return true;
	}
}

function cala()
{
	//return false;
	rate=document.frm.rat.value;
	day=document.frm.days.value;
	
	t_rate=rate*day;
	document.frm.amount.value=t_rate;
	
}





function chat_rate(){
	var chck=document.frm.rat.value;
		if ((chck==null)||(chck=="")){
			alert("Enter rate");
		document.frm.rat.focus()
		return false
	}
	else{
	for(var j=0; j<chck.length; j++)
		{
		var alphaa = chck.charAt(j);
		var ch = alphaa.charCodeAt(0);
		if(ch > 47 && ch < 58)
	  	{
	  	}
	  	else
	  	{
		alert("Number are Allowed");
	  	document.frm.rat.focus();
	  	return false;
	  	}
		}
		}
 return true;
}


function aff_validate()
{
	var a=true;
	if(document.frm.email.value=="")
	{
		a=false;
		}
if(document.frm.pass.value=="")
	{
		a=false;
		}
		if(document.frm.sname.value=="")
	{
		a=false;
		}
		
		if(document.frm.fname.value=="" && document.frm.lname.value=="")
	{
		a=false;
		}
	if(document.frm.dname.value=="")
	{
		a=false;
		}
		
		if(document.frm.account.value=="")
	{
		a=false;
		}
		
		if(document.frm.telephone.value=="")
	{
		a=false;
		}
		
		if(document.frm.address.value=="")
	{
		a=false;
		}
		
		if(document.frm.city.value=="")
	{
		a=false;
		}
		
		if(document.frm.zipcode.value=="")
	{
		a=false;
		}
		
		if(document.frm.country.value=="")
	{
		a=false;
		}
		
		if(document.frm.aemail.value=="")
	{
		a=false;
		}
	if(a==false)
	{
	alert("Please fill all the blank fields");
	return a;
	}
	else
	{
		return a;
		}
	}