/*function validateamt()
{

var intone="Rs. 4,500";
var inttwo="Rs. 9,000";
var intthree="Rs. 13,500";

var none="Rs. 1020";
var ntwo="Rs. 2040";
var nthree="Rs. 2880";


if(document.frmSubscribe.rbTerm[0].checked==true)
{
	document.frmSubscribe.txtAmount.value=nthree;
}
if(document.frmSubscribe.rbTerm[1].checked==true)
{
	document.frmSubscribe.txtAmount.value=ntwo;
}
if(document.frmSubscribe.rbTerm[2].checked==true)
{
	document.frmSubscribe.txtAmount.value=none;
}
if(document.frmSubscribe.rbTerm[3].checked==true)
{
	document.frmSubscribe.txtAmount.value=intthree;
}
if(document.frmSubscribe.rbTerm[4].checked==true)
{
	document.frmSubscribe.txtAmount.value=inttwo;
}
if(document.frmSubscribe.rbTerm[5].checked==true)
{
	document.frmSubscribe.txtAmount.value=intone;
}


}*///end of function validateamt

function validateform(frmSubscribe)
{

		var invalid12=new Array(" ","!","@","#","$","%","^","&","*","=","'",'"',"`","?","|",".","{","}",";",":","~","<",">","+",",","-");
		var strFName = "";
		var strLName = "";
		var strAddress = "";
		var strCity = "";
		var strCountry = "";
		var strPin = "";
		var strEmail = "";
		var strDayPhone1 = "";
		var strDayPhone2 = "";
		var strDayPhone3 = "";
		var strEvePhone1 = "";
		var strEvePhone2 = "";
		var strEvePhone3 = "";
		var strMobile = "";
		var strTerm = "";

		var lenFName = "";
		var lenLName = "";
		var lenAddress = "";
		var lenCity = "";
		var lenCountry = "";
		var lenPin = "";
		var lenEmail = "";
		var lenDayPhone1 = "";
		var lenDayPhone2 = "";
		var lenDayPhone3 = "";
		var lenEvePhone1 = "";
		var lenEvePhone2 = "";
		var lenEvePhone3 = "";
		var lenMobile = "";
		var lenTerm = "";
				
		
		var allValid = true;
		var allNum = "";
		
		var strCheckNum = "0123456789()+- ";

		var strCheckNumber = "0123456789";
		
		var strCheckAlpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
		
		var strCheckAlphaNum = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
		
		strFName = document.frmSubscribe.txtFName.value;
		lenFName =strFName.length;
		if(lenFName == 0)
		{
			alert("Please enter the First Name.");
			document.frmSubscribe.txtFName.focus();
			return false;
		}
		if(strFName.substring(0,1) == " ")
		{
			alert("First Character cannot be a space.");
			document.frmSubscribe.txtFName.focus();
			return false;
		}
		for (i = 0;  i < strFName.length;  i++)
		{
			ch = strFName.charAt(i);
			for (j = 0;  j < strCheckAlpha.length;  j++)
				if (ch == strCheckAlpha.charAt(j))
				break;
				if (j == strCheckAlpha.length)
				{
					allValid = false;
					break;
				}
		}
		if (!allValid)
		{
			alert("Please enter only  characters in the First Name.");
			document.frmSubscribe.txtFName.focus();
			return false;
		}

		strLName = document.frmSubscribe.txtLName.value;
		lenLName =strLName.length;
		if(lenLName == 0)
		{
			alert("Please enter the Last Name.");
			document.frmSubscribe.txtLName.focus();
			return false;
		}
		if(strLName.substring(0,1) == " ")
		{
			alert("First Character cannot be a space.");
			document.frmSubscribe.txtLName.focus();
			return false;
		}
		for (i = 0;  i < strLName.length;  i++)
		{
			ch = strLName.charAt(i);
			for (j = 0;  j < strCheckAlpha.length;  j++)
				if (ch == strCheckAlpha.charAt(j))
				break;
				if (j == strCheckAlpha.length)
				{
					allValid = false;
					break;
				}
		}
		if (!allValid)
		{
			alert("Please enter only  characters in the Last Name.");
			document.frmSubscribe.txtLName.focus();
			return false;
		}

		strAddress  = document.frmSubscribe.txtAddress.value;
		lenAddress =strAddress.length;
		if(lenAddress == 0)
		{
			alert("Please enter the Address.");
			document.frmSubscribe.txtAddress.focus();
			return false;
		}
		if(strAddress.substring(0,1) == " ")
		{
			alert("First Character cannot be a space.");
			document.frmSubscribe.txtAddress.focus();
			return false;
		}

		strCity = document.frmSubscribe.txtCity.value;
		lenCity =strCity.length;
		if(lenCity == 0)
		{
			alert("Please enter the City.");
			document.frmSubscribe.txtCity.focus();
			return false;
		}
		if(strCity.substring(0,1) == " ")
		{
			alert("First Character cannot be a space.");
			document.frmSubscribe.txtCity.focus();
			return false;
		}
		for (i = 0;  i < strCity.length;  i++)
		{
			ch = strCity.charAt(i);
			for (j = 0;  j < strCheckAlpha.length;  j++)
				if (ch == strCheckAlpha.charAt(j))
				break;
				if (j == strCheckAlpha.length)
				{
					allValid = false;
					break;
				}
		}
		if (!allValid)
		{
			alert("Please enter only  characters in the City.");
			document.frmSubscribe.txtCity.focus();
			return false;
		}

		strPin = document.frmSubscribe.txtZip.value;
		lenPin = strPin.length;
		if(lenPin == 0)
		{
			alert("Please enter the Pin Code.");
			document.frmSubscribe.txtZip.focus();
			return false;
		}
		if(strPin.substring(0,1) == " ")
		{
			alert("First Character cannot be a space.");
			document.frmSubscribe.txtZip.focus();
			return false;
		}
		for (i = 0;  i < strPin.length;  i++)
		{
			ch = strPin.charAt(i);
			for (j = 0;  j < strCheckNumber.length;  j++)
				if (ch == strCheckNumber.charAt(j))
					break;
				if (j == strCheckNumber.length)
				{
					allValid = false;
					break;
				}
				
		}
		if (!allValid)
		{
			alert("Please enter only numbers in the Pin Code.");
			document.frmSubscribe.txtZip.focus();
			return false;
		}

		strCountry = document.frmSubscribe.txtCountry.value;
		lenCountry =strCountry.length;
		if(lenCountry == 0)
		{
			alert("Please enter the Country.");
			document.frmSubscribe.txtCountry.focus();
			return false;
		}
		if(strCountry.substring(0,1) == " ")
		{
			alert("First Character cannot be a space.");
			document.frmSubscribe.txtCountry.focus();
			return false;
		}
		for (i = 0;  i < strCountry.length;  i++)
		{
			ch = strCountry.charAt(i);
			for (j = 0;  j < strCheckAlpha.length;  j++)
				if (ch == strCheckAlpha.charAt(j))
				break;
				if (j == strCheckAlpha.length)
				{
					allValid = false;
					break;
				}
		}
		if (!allValid)
		{
			alert("Please enter only  characters in the Country.");
			document.frmSubscribe.txtCountry.focus();
			return false;
		}

		strDayPhone1 = document.frmSubscribe.txtDayPhone1.value;
		lenDayPhone1 = strDayPhone1.length;
		if(lenDayPhone1 == 0)
		{
			alert("Please enter the Correct Day Telephone.");
			document.frmSubscribe.txtDayPhone1.focus();
			return false;
		}
		if(strDayPhone1.substring(0,1) == " ")
		{
			alert("First Character cannot be a space.");
			document.frmSubscribe.txtDayPhone1.focus();
			return false;
		}
		
		for (i = 0;  i < strDayPhone1.length;  i++)
		{
			ch = strDayPhone1.charAt(i);
			for (j = 0;  j < strCheckNum.length;  j++)
				if (ch == strCheckNum.charAt(j))
					break;
				if (j == strCheckNum.length)
				{
					allValid = false;
					break;
				}
				
		}
		if (!allValid)
		{
			alert("Please enter only numbers in the Day Telephone.");
			document.frmSubscribe.txtDayPhone1.focus();
			return false;
		}

		strDayPhone2 = document.frmSubscribe.txtDayPhone2.value;
		lenDayPhone2 = strDayPhone2.length;
		if(lenDayPhone2 == 0)
		{
			alert("Please enter the Correct Day Telephone.");
			document.frmSubscribe.txtDayPhone2.focus();
			return false;
		}
		if(strDayPhone2.substring(0,1) == " ")
		{
			alert("First Character cannot be a space.");
			document.frmSubscribe.txtDayPhone2.focus();
			return false;
		}
		
		for (i = 0;  i < strDayPhone2.length;  i++)
		{
			ch = strDayPhone2.charAt(i);
			for (j = 0;  j < strCheckNum.length;  j++)
				if (ch == strCheckNum.charAt(j))
					break;
				if (j == strCheckNum.length)
				{
					allValid = false;
					break;
				}
				
		}
		if (!allValid)
		{
			alert("Please enter only numbers in the Day Telephone.");
			document.frmSubscribe.txtDayPhone2.focus();
			return false;
		}

		strDayPhone3 = document.frmSubscribe.txtDayPhone3.value;
		lenDayPhone3 = strDayPhone3.length;
		if(lenDayPhone3 == 0)
		{
			alert("Please enter the Correct Day Telephone.");
			document.frmSubscribe.txtDayPhone3.focus();
			return false;
		}
		if(strDayPhone3.substring(0,1) == " ")
		{
			alert("First Character cannot be a space.");
			document.frmSubscribe.txtDayPhone3.focus();
			return false;
		}
		
		for (i = 0;  i < strDayPhone3.length;  i++)
		{
			ch = strDayPhone3.charAt(i);
			for (j = 0;  j < strCheckNum.length;  j++)
				if (ch == strCheckNum.charAt(j))
					break;
				if (j == strCheckNum.length)
				{
					allValid = false;
					break;
				}
				
		}
		if (!allValid)
		{
			alert("Please enter only numbers in the Day Telephone.");
			document.frmSubscribe.txtDayPhone3.focus();
			return false;
		}

		/*strEvePhone1 = document.frmSubscribe.txtEvePhone1.value;
		lenEvePhone1 = strEvePhone1.length;
		if(lenEvePhone1 == 0)
		{
			alert("Please enter the Correct Evening Telephone.");
			document.frmSubscribe.txtEvePhone1.focus();
			return false;
		}
		if(strEvePhone1.substring(0,1) == " ")
		{
			alert("First Character cannot be a space.");
			document.frmSubscribe.txtEvePhone1.focus();
			return false;
		}
		
		for (i = 0;  i < strEvePhone1.length;  i++)
		{
			ch = strEvePhone1.charAt(i);
			for (j = 0;  j < strCheckNum.length;  j++)
				if (ch == strCheckNum.charAt(j))
					break;
				if (j == strCheckNum.length)
				{
					allValid = false;
					break;
				}
				
		}
		if (!allValid)
		{
			alert("Please enter only numbers in the Evening Telephone.");
			document.frmSubscribe.txtEvePhone1.focus();
			return false;
		}

		strEvePhone2 = document.frmSubscribe.txtEvePhone2.value;
		lenEvePhone2 = strEvePhone2.length;
		if(lenEvePhone2 == 0)
		{
			alert("Please enter the Correct Evening Telephone.");
			document.frmSubscribe.txtEvePhone2.focus();
			return false;
		}
		if(strEvePhone2.substring(0,1) == " ")
		{
			alert("First Character cannot be a space.");
			document.frmSubscribe.txtEvePhone2.focus();
			return false;
		}
		
		for (i = 0;  i < strEvePhone2.length;  i++)
		{
			ch = strEvePhone2.charAt(i);
			for (j = 0;  j < strCheckNum.length;  j++)
				if (ch == strCheckNum.charAt(j))
					break;
				if (j == strCheckNum.length)
				{
					allValid = false;
					break;
				}
				
		}
		if (!allValid)
		{
			alert("Please enter only numbers in the Evening Telephone.");
			document.frmSubscribe.txtEvePhone2.focus();
			return false;
		}

		strEvePhone3 = document.frmSubscribe.txtEvePhone3.value;
		lenEvePhone3 = strEvePhone3.length;
		if(lenEvePhone3 == 0)
		{
			alert("Please enter the Correct Evening Telephone.");
			document.frmSubscribe.txtEvePhone3.focus();
			return false;
		}
		if(strEvePhone3.substring(0,1) == " ")
		{
			alert("First Character cannot be a space.");
			document.frmSubscribe.txtEvePhone3.focus();
			return false;
		}
		
		for (i = 0;  i < strEvePhone3.length;  i++)
		{
			ch = strEvePhone3.charAt(i);
			for (j = 0;  j < strCheckNum.length;  j++)
				if (ch == strCheckNum.charAt(j))
					break;
				if (j == strCheckNum.length)
				{
					allValid = false;
					break;
				}
				
		}
		if (!allValid)
		{
			alert("Please enter only numbers in the Evening Telephone.");
			document.frmSubscribe.txtEvePhone3.focus();
			return false;
		}*/

		/*strMobile = document.frmSubscribe.txtMobile.value;
		lenMobile = strMobile.length;
		if(lenMobile == 0)
		{
			alert("Please enter the Mobile.");
			document.frmSubscribe.txtMobile.focus();
			return false;
		}
		if(strMobile.substring(0,1) == " ")
		{
			alert("First Character cannot be a space.");
			document.frmSubscribe.txtMobile.focus();
			return false;
		}
		
		for (i = 0;  i < strMobile.length;  i++)
		{
			ch = strMobile.charAt(i);
			for (j = 0;  j < strCheckNum.length;  j++)
				if (ch == strCheckNum.charAt(j))
					break;
				if (j == strCheckNum.length)
				{
					allValid = false;
					break;
				}
				
		}
		if (!allValid)
		{
			alert("Please enter only numbers in the Mobile.");
			document.frmSubscribe.txtMobile.focus();
			return false;
		}*/

		strEmail = document.frmSubscribe.txtEmail.value;
		lenEmail = strEmail.length;
		
		if(lenEmail == 0)
		{
			alert("Please enter the Email Address.");
			document.frmSubscribe.txtEmail.focus();
			return false;
		}
		if(strEmail.substring(0,1) == " ")
		{
			alert("First Character cannot be a space.");
			document.frmSubscribe.txtEmail.focus();
			return false;
		}
		if(((strEmail.indexOf("@",0)<=0) || (strEmail.indexOf(".",0)<=0)) && (lenEmail!=0))
		{
		alert(strEmail+"  is not a valid Email Address. Please enter a valid Email Address");
		document.frmSubscribe.txtEmail.focus();
		return false;
		}

		

		/*strTerm = document.frmSubscribe.cmbTerm.options[document.frmSubscribe.cmbTerm.options.selectedIndex].value;
		lenTerm = strTerm.length;
		if(strTerm=="")
		{
			alert("Please select the Subscription Term.");
			document.frmSubscribe.cmbTerm.focus();
			return false;
		}*/
		
		if((document.frmSubscribe.rbTerm[0].checked==false) && (document.frmSubscribe.rbTerm[1].checked==false) && (document.frmSubscribe.rbTerm[2].checked==false))
		{
			alert("Please select the Period Of Subscription.");
			return false;
		}


	document.frmSubscribe.method = "post";
	document.frmSubscribe.action = '/others/postsubscription.asp';
	document.frmSubscribe.submit();
	

}

function validateTerm1()
{
	if(document.frmSubscribe.rbTerm[0].checked == false)
	{
		alert("Please select the One Year Term of Subscription");
		document.frmSubscribe.rbGift1[0].checked == false;
		document.frmSubscribe.rbGift1[1].checked == false;
		document.frmSubscribe.rbGift1[2].checked == false;
		document.frmSubscribe.rbGift1[3].checked == false;
		return false;
	}
}

function validateTerm2()
{
	if(document.frmSubscribe.rbTerm[1].checked == false)
	{
		alert("Please select the Two Year Term of Subscription");
		document.frmSubscribe.rbGift2[0].checked == false;
		document.frmSubscribe.rbGift2[1].checked == false;
		document.frmSubscribe.rbGift2[2].checked == false;
		document.frmSubscribe.rbGift2[3].checked == false;
		document.frmSubscribe.rbGift2[4].checked == false;
		return false;
	}
}

function validateTerm3()
{
	if(document.frmSubscribe.rbTerm[2].checked == false)
	{
		alert("Please select the Three Year Term of Subscription");
		document.frmSubscribe.rbGift3[0].checked == false;
		document.frmSubscribe.rbGift3[1].checked == false;
		return false;
	}
}
