// to get the todays date
var todate = new Date()
var tyear = todate.getYear()
var tmonth = todate.getMonth() + 1
var tdate = todate.getDate()

/*****************************************************************************/
// SUBMITTING FROM THE PASSWORD FIELD
function chklogin()
{
	//alert("eve :"+event.keyCode)
	if(event.keyCode == 13)
	login()
}

/*****************************************************************************/


/*********** FUNCTION FOR VIA DOWNLOAD METHOD WHERE SHIPPING FORM SHOULD BE DISABLED STARTS********/
function grayship(shipcost)
{
	if(shipcost==0)
	{
		document.itemfrm.shiptoaddress.disabled=true;
		document.itemfrm.shiptoaddress.style.background="#D6CFC5";
		document.itemfrm.x_ship_to_first_name.disabled=true;
		document.itemfrm.x_ship_to_first_name.style.background="#D6CFC5";
		document.itemfrm.x_ship_to_last_name.disabled=true;
		document.itemfrm.x_ship_to_last_name.style.background="#D6CFC5";
		document.itemfrm.x_ship_to_address.disabled=true;
		document.itemfrm.x_ship_to_address.style.background="#D6CFC5";
		document.itemfrm.x_ship_to_phone.disabled=true;
		document.itemfrm.x_ship_to_phone.style.background="#D6CFC5";
		document.itemfrm.x_ship_to_country.disabled=true;
		document.itemfrm.x_ship_to_country.style.background="#D6CFC5";
		document.itemfrm.x_ship_to_zip.disabled=true;
		document.itemfrm.x_ship_to_zip.style.background="#D6CFC5";
		document.itemfrm.x_ship_to_city.disabled=true;
		document.itemfrm.x_ship_to_city.style.background="#D6CFC5";
		document.itemfrm.x_ship_to_state.disabled=true;
		document.itemfrm.x_ship_to_state.style.background="#D6CFC5";
		document.itemfrm.x_ship_to_email.disabled=true;
		document.itemfrm.x_ship_to_email.style.background="#D6CFC5";
		document.itemfrm.ship_conemail.disabled=true;
		document.itemfrm.ship_conemail.style.background="#D6CFC5";
	}
}


/*********** FUNCTION FOR VIA DOWNLOAD METHOD WHERE SHIPPING FORM SHOULD BE DISABLED ENDS********/















function login()
{
	//index.php - for admin
	var message="";
	if(document.loginfrm.userid.value.length==0)
	message=message+"Enter Name!\n";
	if(document.loginfrm.password.value.length==0)
	message=message+"Enter Password!\n";

	if(message.length>0)
	alert(message)
	else
	document.loginfrm.submit();
}

/*****************************************************************************/

/**************************EMAIL CHECKING***************************/

function checkmail(fldname)
{

	//for all email fields in any forms - BOTH FOR ADMIN/USERS

	email = fldname.value;
	var len = email.length;
	if(len<5)
	{
		alert("Invalid Email - id")
		fldname.value="";
	}
	else
	{

		var index1 = email.indexOf('@');
		var subind = email.substring(0,index1);
		var indlen = subind.length;
		var index2 = email.indexOf('.');
		var subind1=email.substring(indlen+1,index2);
		var indlen1 = subind1.length;
		var index3 = email.indexOf(' ');
		var subind3=email.substring(index2+1,len)
		var indlen2 = subind3.length;
		if((index1!= -1)&&(index2!= -1)&&(index3==-1))
		{
			if((indlen!=0)&&(indlen1!=0)&&(indlen2!=0))
			{
				//alert("valid Email -id");
				/*
				var subval1 = email.substring(index1+1,email.length);
				//alert(subval1)
				var pos1 = subval1.indexOf('@');
				var pos2 = subval1.indexOf('.');
				var subval2 = email.substring(pos2+1,email.length);
				alert(subval2)
				var pos3 = subval2.indexOf('.');
				var pos4 = subval1.indexOf(' ');
				if(pos1 != -1)
				alert("Invalid Email - id1");
				if(pos3 != -1)
				alert("Invalid Email - id2");
				if(pos4 != -1)
				alert("Invalid Email - id3");
				*/
			}
			else
			{
				alert("Invalid Email - id")
				fldname.value="";
				fldname.select();
				fldname.focus();
			}
		}
		else
		{
			alert("Invalid Email - id");
			fldname.value="";
			fldname.select();
			fldname.focus();
		}
	} // end of else if len<5
}

/*****************************************************************************/
// confirm password validation
function chkconpass()
{
	// for registerform.php

	var pass = document.regfrm.password.value
	var conpass = document.regfrm.txtconpass.value

	if( conpass == pass)
	{

		document.regfrm.email.focus
	}
	else
	{
		alert("Confirmed password is incorrect")
		document.regfrm.txtconpass.value = ""
		document.regfrm.txtconpass.focus
	}
}

/*****************************************************************************/

// TO CHECK NULL IN REGISTRATION
function registration()
{
	// for registration
	var str;
	str ="";
	var user = document.regfrm.userid.value
	var pass = document.regfrm.password.value
	var conpass = document.regfrm.txtconpass.value
	var email = document.regfrm.email.value
	var add1 = document.regfrm.addr1.value
	var city = document.regfrm.city.value
	var state = document.regfrm.state.value
	var country = document.regfrm.country.value
	var zip = document.regfrm.zipcode.value
	var phone = document.regfrm.phone.value

	if(user == "")
	{
		str = "Enter User Name \n"
	}
	if(pass == "")
	{
		str += "Enter Password  \n"
	}
	if(conpass == "")
	{
		str += "Confirm Password \n"
	}
	if(email == "")
	{
		str += "Enter Email \n"
	}
	if(add1 == "")
	{
		str += "Enter Address \n"
	}
	if(city == "")
	{
		str += "Enter City \n"
	}
	if(state == "")
	{
		str += "Enter State \n"
	}
	if(zip == "")
	{
		str += "Enter Zipcode \n"
	}
	if(country == "")
	{
		str += "Enter Country \n"
	}
	if(phone == "")
	{
		str += "Enter Phone Number \n"
	}

	if(str != "")
	{
		alert(str)
	}
	else
	{
		if(conpass != pass)
		{
			alert("Confirmed password is incorrect")
			document.regfrm.txtconpass.value = ""
			document.regfrm.txtconpass.select()
			document.regfrm.txtconpass.focus()
		}
		document.regfrm.submit()
	}
}
/*****************************************************************************/
function forgotpass()
{
	var message="";
	if(document.forgotpassfrm.username.value.length==0)
	message=message+"Enter Username!\n";
	if(document.forgotpassfrm.email.value.length==0)
	message=message+"Enter Email!\n";
	if(message.length>0)
	alert(message)
	else
	document.forgotpassfrm.submit();

}


/*****************************************************************************/

var name;
var pass;
var str;
str="";

function tochangepword()
{
	var str
	str = ""
	var email = document.form1.emailhidd.value;
	var pword = document.form1.passhidd.value;
	//alert(emailid)
	//alert(email + " pass " + pword)
	userid = document.form1.userid.value;
	pass = document.form1.password.value;
	npass = document.form1.newpassword.value;

	if(userid == "")
	{
		str = "You must enter the UserID \n"
	}
	if(pass == "")
	{
		str += "You must enter the Original Password \n"
	}
	if(npass == "")
	{
		str += "You must enter the New Password \n"
	}

	if(str == "")
	{
		if((userid == email)&&(pass == pword))
		{
			document.form1.submit()
		}
		if((userid == email)&&(pass != pword))
		{
			//alert("inside if")
			alert("Enter a Valid Password")
			document.form1.password.value = ""
			document.form1.password.focus
		}
		if((userid != email)&&(pass == pword))
		{
			//alert("inside if userod")
			alert("Enter a Valid Email ID")
			document.form1.userid.value = ""
			document.form1.userid.focus
		}

		if((userid != email)&&(pass != pword))
		{
			alert("Enter a Valid Email ID & Password")

			document.form1.userid.value = ""
			document.form1.password.value = ""
			document.form1.userid.focus
		}

	}
	else
	{
		alert(str)
		document.form1.userid.focus
	}
}

/*****************************************************************************/

function addcategory()
{
	//admin_addprojectcategory.php
	var message="";

	if(document.addcategoryfrm.catname.value.length==0)
	alert("Enter Category name!");
	else
	document.addcategoryfrm.submit();
}

/***************************************************************************/

function editcategory()
{
	if(document.updatecategoryfrm.updatecategory.value==-1)
	alert("Select Category!");
	else
	document.updatecategoryfrm.submit();
}
/***************************************************************************/
function deletecategory()
{
	if(document.deletecategoryfrm.deletecategory.value==-1)
	alert("Select Category!");
	else
	document.deletecategoryfrm.submit();
}
/***************************************************************************/

function addsubcategory()
{
	//addmaincategory.php
	var message="";

	if(document.addcategoryfrm.subcatname.value.length==0)
	alert("Enter Maincategory name!");
	else
	document.addcategoryfrm.submit();
}

/***************************************************************************/

function editsubcategory()
{
	if(document.updatecategoryfrm.updatecategory.value==-1)
	alert("Select Maincategory!");
	else
	document.updatecategoryfrm.submit();
}
/***************************************************************************/
function deletesubcategory()
{
	if(document.deletecategoryfrm.deletecategory.value==-1)
	alert("Select Maincategory!");
	else
	document.deletecategoryfrm.submit();
}

/***************************************************************************/
//	TO SELECT CATEGORY
function changecategory(catname,form,fname)
{
	var catname = catname.value
	form.action=fname+".php?catname="+catname
	form.submit()
}

/***************************************************************************/

//	TO CHECK LOGIN
function checklogin()
{
	var str
	str = ""
	var user = document.loginfrm.userid.value
	var pass = document.loginfrm.password.value

	if(user == "")
	str = "Enter the User ID \n"
	if(pass == "")
	str += "Enter the Password"
	if(str != "")
	alert(str)
	else
	document.loginfrm.submit()
}

/***************************************************************************/

//TO ADD MERCHANT ACCOUNT
function addmerchant()
{
	var str;
	str = "";
	//var catname = document.merfrm.catname.value
	//var subcatname = document.merfrm.subcatname.value
	var mname = document.merfrm.merchantname.value
	var url = document.merfrm.url.value
	var desc = document.merfrm.description.value
	/*
	if(catname == "")
	str += "Select the Category \n";
	if(subcatname == "")
	str += "Select the SubCategory \n";
	*/
	if(mname == "")
	str += "Enter the Merchant Name \n";
	if(url == "")
	str += "Enter the Merchant URL \n";
	if(desc == "")
	str += "Enter the Description \n";
	if(str != "")
	alert(str)
	else
	document.merfrm.submit()
}

/***************************************************************************/

//TO ADD COUPON INFO
function addcoupon()
{
	var str;
	str = "";
	var title = document.merfrm.title.value
	var cname = document.merfrm.subcatname.value
	var mname = document.merfrm.merchantname.value
	//	var amt  = document.merfrm.amount.value
	//	var styear = document.merfrm.st_year.value
	//	var stmon = document.merfrm.st_month.value
	//	var stdate = document.merfrm.st_date.value
	//	var expyear = document.merfrm.exp_year.value
	//	var expmon = document.merfrm.exp_month.value
	//	var expdate = document.merfrm.exp_date.value
	var desc = document.merfrm.description.value
	var status = document.merfrm.status.value

	if(cname == "")
	str += "Select the Sub Category Name \n";
	if(mname == "")
	str += "Select the Merchant Name \n";
	if(title == "")
	str += "Enter the Title \n";
	//	if(amt == "")
	//		str += "Enter the Amount \n";
	//	if(styear == "" || stmon == "" || stdate == "")
	//		str += "Select the Start Date \n";
	//	if(expyear == "" || expmon == "" || expdate == "")
	//		str += "Select the Expiry Date \n";
	if(desc == "")
	str += "Enter the Description \n";
	if(status == "")
	str += "Select the Status \n";
	if(str != "")
	alert(str)
	else
	document.merfrm.submit()
}

/***************************************************************************/

// TELL A FRIEND
function tellaction()
{
	var catname = "<?php echo $cat; ?>"
	alert(catname)
}


/***************************************************************************/

// TELL A FRIEND
function mailtofriend(form)
{
	//alert(form.name)
	//alert("fff :"+escape(document.location))

	if((form.toemail1.value == "") && (form.toemail2.value == "") && (form.toemail3.value == "") && (form.toemail4.value == "") && (form.toemail5.value == "") && (form.toemail6.value == "") && (form.toemail7.value == "") && (form.toemail8.value == "") && (form.toemail9.value == "") && (form.toemail10.value == ""))
	{
		alert("Enter the To-Email Address");
		form.toemail1.select();
		form.toemail1.focus();
	}
	else if(form.fromname.value == "")
	{
		alert("Enter Your Name");
		form.fromname.select();
		form.fromname.focus();
	}
	else if(form.fromemail.value == "")
	{
		alert("Enter the From-Email Address");
		form.fromemail.select();
		form.fromemail.focus();
	}
	else
	form.submit()

}

/***************************************************************************/

//TO SEARCH THE MERCHANT INFO
function tosearch()
{
	var kword = document.searchfrm.srh_keyword.value
	if(kword =="")
	{
		alert("Enter the Keyword")
		document.searchfrm.srh_keyword.focus()
	}
	else
	document.searchfrm.submit()
}

/***************************************************************************/

//TO JOIN OUR MAILING LIST
function mailinglist(form)
{
	/*
	var kk=form.merchantname.options.length;
	var aa="";
	for(j=0;j<kk;j++)
	{
	if(form.merchantname.options[j].selected)
	{
	if(form.merchantname.options[j].value!=0)
	aa+=form.merchantname.options[j].value + ",";
	}
	}

	form.mername.value=aa;
	*/

	if(form.name.value == "")
	{
		alert("Enter Your Name");
		form.name.select();
		form.name.focus();
	}
	else if(form.email.value == "")
	{
		alert("Enter the Email-ID");
		form.email.select();
		form.email.focus();
	}
	else if(form.address.value == "")
	{
		alert("Enter Your Address");
		form.address.select();
		form.address.focus();
	}
	/*	else if(form.merchantname.value == "")
	{
	alert("Select the Merchant Name");
	form.merchantname.focus();
	}*/
	else
	form.submit()
}

/***************************************************************************/

//TO SEND MAILS TO THE SUBSCRIBED USERS
function sendmails(form)
{
	var mname = form.merchantname.value
	var msg = form.message.value
	if(form.merchantname.value == "")
	{
		alert("Select the MerchantName")
		form.merchantname.focus();
	}
	else if(form.message.value == "")
	{
		alert("Enter the Message")
		form.message.select();
		form.message.focus();
	}
	else
	document.mailfrm.submit()
}

/***************************************************************************/
// UNSUBSCRIBED CHECKING
function tounsubscribe(form)
{
	if(form.email.value == "")
	{
		alert("Enter the Email-ID")
		form.email.select()
		form.email.focus()
	}
	else
	form.submit()
}


/***************************************************************************/
//TO JOIN OUR MAILING LIST
function addmersubcat(form)
{
	/*
	var kk=form.subcatname.options.length;
	var aa="";
	for(j=0;j<kk;j++)
	{
	if(form.subcatname.options[j].selected)
	{
	if(form.subcatname.options[j].value!=0)
	aa+=form.subcatname.options[j].value + ",";
	}
	}

	form.subcathid.value=aa;
	*/

	if(form.merchantname.value == "")
	{
		alert("Select the Merchant Name");
		//form.merchantname.select();
		form.merchantname.focus();
	}
	else if(form.catname.value == "")
	{
		alert("Select the Category");
		//form.catname.select();
		form.catname.focus();
	}
	else if(form.subcatname.value == "")
	{
		alert("Select the Subcatgory");
		//form.subcatname.select();
		form.subcatname.focus();
	}
	else
	form.submit()
}

/***************************************************************************/
//	TO SELECT CATEGORY
function changemername(mname,form,fname)
{
	var mername = mname.value
	form.action=fname+".php?merchantname="+mername
	form.submit()
}


//	TO SELECT CATEGORY
function changemerchantname(mname,form,fname)
{
	var mername = mname.value
	//alert("ddd"+mername)
	form.action=fname+".php?merchantname="+mername
	form.submit()
}

/*****************************************************************************/
// add products
function addproduct(form,mes)
{
	//alert("mes :"+mes)

	if (form.productname.value=="") {
		alert("Enter Product Name");
		form.productname.select();
		form.productname.focus();

	} else if (form.description.value=="") {
		alert("Enter Description");
		form.description.select();
		form.description.focus();

	} else if (form.price.value=="") {
		alert("Enter Price");
		form.price.select();
		form.price.focus();

	} else
	form.submit();

}

/*****************************************************************************/
// add additional options
function addoptions(form,mes)
{

	if (form.productid.value=="") {
		alert("Select Product Name");

	} else if (form.producttitle.value=="") {
		alert("Enter Description");
		form.producttitle.select();
		form.producttitle.focus();

	} else if (form.price.value=="") {
		alert("Enter Price");
		form.price.select();
		form.price.focus();

	} else
	form.submit();

}


/*****************************************************************************/


/*****************************************************************************/

// TO NUMBER CHECKING IN ADV SEARCH PAGE,REGISTRATION (GENERAL)
function chknumber(txtname)
{
	var num = txtname.value
	if(isNaN(num))
	{
		alert("You can enter only the number")
		txtname.value = ""
		txtname.focus
	}
}
/*****************************************************************************/
// ADDING TO CART
function addtocart(oid,ccount)
{
	if(oid == "a")
	{
		if(ccount == 0)
		{   alert("The E-book must first be ordered before this option can be selected.");
		return false;			}
	}

}

/*****************************************************************************/
// SIGNING UP NEWS
function signupnews()
{
	if(document.newsfrm.email.value == "")
	alert("Enter the Email ID");
	else
	document.newsfrm.submit()
}

/***************************************************************************/

// to checkout form
var pval;
pval=""
function checkout(form,shippcost,cdcost)
{
	sdfsf=true;
	if (form.x_first_name.value == "") {
		sdfsf=false;
	}
	if (form.x_last_name.value == "") {
		sdfsf=false;
	}
	if (form.x_address.value == "") {
		sdfsf=false;
	}
	if (form.x_city.value == "") {
		sdfsf=false;
	}
	if (form.x_state.value == "") {
		sdfsf=false;
	}
	if (form.x_zip.value == "") {
		sdfsf=false;
	}
	if (form.x_country.value == "") {
		sdfsf=false;
	}
	if (form.x_phone.value == "") {
		sdfsf=false;
	} 
	if (form.x_email.value == "") {
		sdfsf=false;
	}

	if (pval == "") {
		sdfsf=false;
	}
	if (form.x_card_num.value == "") {
		sdfsf=false;
	}
	if(form.x_exp_date.value.search(/^\d{2}\/\d{2}$/)==-1) {
		sdfsf=false;
	}

	if(cdcost!=0)
	{
		// validation starts for Shipping info
		if (form.x_ship_to_first_name.value == "") {
			sdfsf=false;
		}
		if (form.x_ship_to_last_name.value == "") {
			sdfsf=false;
		}
		if (form.x_ship_to_address.value == "") {
			sdfsf=false;
		}
		if (form.x_ship_to_city.value == "") {
			sdfsf=false;
		}
		if (form.x_ship_to_state.value == "") {
			sdfsf=false;
		}
		if (form.x_ship_to_zip.value == "") {
			sdfsf=false;
		}
		if (form.x_ship_to_country.value == "") {
			sdfsf=false;
		}
		if (form.x_ship_to_phone.value == "") {
			sdfsf=false;
		}
		if (form.x_ship_to_email.value == "") {
			sdfsf=false;
		}
	}

	if(sdfsf==false) {
		alert('One or more of the fields has not\nbeen completed correctly.\n\nPlease fix the fields\nhighlighted in RED above.');
		return false;
	}

	if(form.x_email.value != form.bill_conemail.value)
	{
		alert("The confirm Email in BILLING is incorrect. Enter it again!")
		form.bill_conemail.focus()
		return false; //This prevents the form from being submitted
	}
	if(form.x_ship_to_email.value != form.ship_conemail.value)
	{
		alert("The confirm Email in SHIPPING is incorrect. Enter it again!")
		form.ship_conemail.focus()
		return false; //This prevents the form from being submitted
	}
	/*
	//alert(form.discountcode.value)
	if(form.discountcode.value != "")
	form.h_discountcode.value = form.discountcode.value;
	//alert("hidden :"+form.h_discountcode.value)
	*/
	form.cc_number.value = form.x_card_num.value
	form.cc_expdate.value = form.x_exp_date.value
	//alert(form.cc_number.value+" -- "+form.cc_expdate.value)
	form.submit();
	//	}
	//}
}

/***************************************************************************/
// to check the ccard type
function cardtype_chk(obj)
{
	pval = obj.value;
}

/***************************************************************************/

// filling the shipping info same as billing info
function loadaddress(x)
{

	if (document.itemfrm.shiptoaddress.checked)
	{

		document.itemfrm.x_ship_to_first_name.value =   document.itemfrm.x_first_name.value;
		document.itemfrm.x_ship_to_last_name.value =   document.itemfrm.x_last_name.value
		document.itemfrm.x_ship_to_address.value =  document.itemfrm.x_address.value;
		document.itemfrm.x_ship_to_city.value =  document.itemfrm.x_city.value;
		document.itemfrm.x_ship_to_state.value = document.itemfrm.x_state.value;
		document.itemfrm.x_ship_to_zip.value = document.itemfrm.x_zip.value;
		if(x == null)
		{
			document.itemfrm.x_ship_to_country.value = document.itemfrm.x_country.value;
		}
		else
		{
			document.itemfrm.x_ship_to_country.value = x;
		}
		//document.itemfrm.ship_country.selectedIndex = document.itemfrm.x_country.selectedIndex;
		document.itemfrm.x_ship_to_phone.value = document.itemfrm.x_phone.value;
		document.itemfrm.x_ship_to_email.value = document.itemfrm.x_email.value;
		document.itemfrm.ship_conemail.value = document.itemfrm.bill_conemail.value;
	}

	else

	{

		document.itemfrm.x_ship_to_first_name.value =   ""
		document.itemfrm.x_ship_to_last_name.value =   ""
		document.itemfrm.x_ship_to_address.value =  ""
		document.itemfrm.x_ship_to_city.value =  ""
		document.itemfrm.x_ship_to_zip.value = ""
		//document.itemfrm.bill_country.selectedIndex = document.itemfrm.ship_country.selectedIndex;
		document.itemfrm.x_ship_to_country.value = ""
		document.itemfrm.x_ship_to_state.value = ""
		document.itemfrm.x_ship_to_phone.value = ""
		document.itemfrm.x_ship_to_email.value = ""
		document.itemfrm.ship_conemail.value = ""
	}
}

/***************************************************************************/
// searching
function search()
{
	var kword = document.topfrm.srh_keyword.value
	if(kword == "")
	{
		alert("Enter the Keyword!")
		document.topfrm.srh_keyword.select()
		document.topfrm.srh_keyword.focus()
	}
	else
	document.topfrm.submit()
}


/***************************************************************************/
// offline order submission
function offlineorder(form1)
{


	var form = eval(form1.name)
	if (form.name1.value == "") {
		alert("You must enter a First Name.");
		form.name1.focus()
		return false; //This prevents the form from being submitted
	}
	if (form.lastname.value == "") {
		alert("You must enter a Last Name.");
		form.lastname.focus()
		return false; //This prevents the form from being submitted
	}
	if (form.street.value == "") {
		alert("You must enter a address.");
		form.street.focus()
		return false; //This prevents the form from being submitted
	}
	if (form.city.value == "") {
		alert("You must enter a city.");
		form.city.focus()
		return false; //This prevents the form from being submitted
	}
	if (form.state.value == "") {
		alert("You must enter a state.");
		form.state.focus()
		return false; //This prevents the form from being submitted
	}
	if (form.zipcode.value == "") {
		alert("You must enter a zipcode.");
		form.zipcode.focus()
		return false; //This prevents the form from being submitted
	}
	if (form.email.value == "") {
		alert("You must enter a Email ID");
		form.email.focus()
		return false; //This prevents the form from being submitted
	}
	if (form.confirmemail.value == "") {
		alert("You must enter a Confirm Email ID");
		form.confirmemail.focus()
		return false; //This prevents the form from being submitted
	}
	if (form.phone.value == "") {
		alert("You must enter a Phone No.");
		form.phone.focus()
		return false; //This prevents the form from being submitted
	}
	else
	{
		if(form.email.value != form.confirmemail.value)
		{
			alert("The confirm Email is incorrect. Enter it again!")
			form.confirmemail.focus()
			return false; //This prevents the form from being submitted
		}
	}
	//return true;
}

/***************************************************************************/
function confirmdiscount()
{
	if(document.form1.discountcode.value == "")
	{
		alert("Enter your Promotional Code!");
		document.form1.discountcode.focus()
		return false
	}
	else
	return true
}


/***************************************************************************/

// TO NUMBER CHECKING AND ONLY 4 DIGITS TO BE ALLOWED
function chkcardnumber(txtname)
{
	var num = txtname.value
	if(isNaN(num))
	{
		alert("You can enter only the number")
		txtname.value = ""
		txtname.focus()
	}
	else
	{
		if(num.length > 4)
		{
			var substr1 = num.substring(0,4)
			txtname.value = substr1
			txtname.focus()
		}
	}
}
/*****************************************************************************/

/***************************************************************************/

