  // To open a popup window
function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}
 
// Newsletter Subscription Form
function Newsletter() {
  	mailid = document.newsMail.email
	if (mailid.value == '')
	{
		alert("Please enter E-mail Id");
		mailid.focus()
		return false
	}
	else if (mailid.value.indexOf("@")==-1 || mailid.value.indexOf(".")==-1){
		alert("Invalid E-mail ID")
		mailid.focus()	   
		return false
	}
}

// Feedback form validation
function Feedback() {

	firstName = document.fbForm.txtFirstname
	if (firstName.value == "" || !isNaN(firstName.value))
	{
		alert("Please enter your first name");
		firstName.focus()
		return false		
	}

	lastName = document.fbForm.txtlastname
	if (lastName.value == "" || !isNaN(lastName.value))
	{
		alert("Please enter your last name");
		lastName.focus()
		return false		
	}




	mailid = document.fbForm.txtemail
	if (mailid.value == '')
	{
		alert("Please enter E-mail Id");
		mailid.focus()
		return false
	}
	else if (mailid.value.indexOf("@")==-1 || mailid.value.indexOf(".")==-1){
		alert("Invalid E-mail ID")
		mailid.focus()	   
		return false
	}

	age = document.fbForm.cmbAgeRange
	if (age.options[age.selectedIndex].value == "")
	{
		alert("Please select your age group");
	age.focus()
	return false		
	}	

	sportsAct = document.fbForm.txtsports
	if (sportsAct.value != "" && !isNaN(sportsAct.value))
	{
		alert("Please enter Sports Activities");
		sportsAct.focus()
		return false		
	}

	comments = document.fbForm.txtComments
	if (comments.value == "" || !isNaN(comments.value))
	{
		alert("Please add your comments");
		comments.focus()
		return false		
	}	
	if (document.fbForm.uword.value=="" )
	{
	alert('Enter the code as it is shown');
	document.fbForm.uword.focus();
	return false;
	}
	return jcap();
	
	
}

// Appointments form validation
function Appointment()
{
if (document.frmAppointment.txtFirstName.value=="" || !isNaN(document.frmAppointment.txtFirstName.value))
	{
	alert('Enter FirstName');
	document.frmAppointment.txtFirstName.focus();
	return false;
	}
if (document.frmAppointment.txtSurname.value=="" || !isNaN(document.frmAppointment.txtSurname.value))
	{
	alert('Enter Surname');
	document.frmAppointment.txtSurname.focus();
	return false;
	}
if (document.frmAppointment.txtHomePhoneNumber.value=="" )
	{
	alert('Enter Home Phone No.');
	document.frmAppointment.txtHomePhoneNumber.focus();
	return false;
	}
	
	
if (document.frmAppointment.txtEmailAddress.value=="")
	{
	alert('Enter Email Address');
	document.frmAppointment.txtEmailAddress.focus();
	return false;
	}
	else if (document.frmAppointment.txtEmailAddress.value.indexOf("@")==-1 || document.frmAppointment.txtEmailAddress.value.indexOf(".")==-1){
		alert("Invalid E-mail ID")
		document.frmAppointment.txtEmailAddress.focus()	   
		return false
	}	
	
	if (document.frmAppointment.uword.value=="" )
	{
	alert('Enter the code as it is shown');
	document.frmAppointment.uword.focus();
	return false;
	}
	return jcap();
}
 

// Contact Us form validation
function Contactus() {
	
	firstName = document.cuForm.txtName
	if (firstName.value == "" || !isNaN(firstName.value))
	{
		alert("Please enter your first name");
		firstName.focus()
		return false		
	}

	mailid = document.cuForm.txtEmail
	if (mailid.value == '')
	{
		alert("Please enter E-mail Id");
		mailid.focus()
		return false
	}
	else if (mailid.value.indexOf("@")==-1 || mailid.value.indexOf(".")==-1){
		alert("Invalid E-mail ID")
		mailid.focus()	   
		return false
	}

	comments = document.cuForm.txtMessage
	if (comments.value == "" || !isNaN(comments.value))
	{
		alert("Please add your comments");
		comments.focus()
		return false		
	}	
	if (document.cuForm.uword.value=="" )
	{
	alert('Enter the code as it is shown');
	document.cuForm.uword.focus();
	return false;
	}
	return jcap();
	
	
}


// Quote form validation
function Quote()
{
if (document.frmQuote.txtFirstName.value=="" )
	{
	alert('Enter FirstName');
	document.frmQuote.txtFirstName.focus();
	return false;
	}
if (document.frmQuote.txtLastName.value=="")
	{
	alert('Enter LastName');
	document.frmQuote.txtLastName.focus();
	return false;
	}
	
if (document.frmQuote.txtEmailAddress.value=="")
	{
	alert('Enter Email Address');
	document.frmQuote.txtEmailAddress.focus();
	return false;
	}
	else if (document.frmQuote.txtEmailAddress.value.indexOf("@")==-1 || document.frmQuote.txtEmailAddress.value.indexOf(".")==-1){
		alert("Invalid E-mail ID")
		document.frmQuote.txtEmailAddress.focus()	   
		return false
	}
if (document.frmQuote.txtmobilePhoneNumber.value=="" )
	{
	alert('Enter your Mobile Number');
	document.frmQuote.txtmobilePhoneNumber.focus();
	return false;
	}
if (document.frmQuote.txtworkPhoneNumber.value=="" )
	{
	alert('Enter your Work Phone Number');
	document.frmQuote.txtworkPhoneNumber.focus();
	return false;
	}
	
	
	
	
	if (document.frmQuote.uword.value=="" )
	{
	alert('Enter the code as it is shown');
	document.frmQuote.uword.focus();
	return false;
	}
	return jcap();
}



// Assistance form validation
function Apply_Products() {
	
	
	
		
	txtName = document.frmapply.txtName
	if (txtName.value == "")
	{
		alert("Please enter your Name");
		txtName.focus()
		return false		
	}	
	
	mailid = document.frmapply.txtEmail
	if (mailid.value == '')
	{
		alert("Please enter E-mail Id");
		mailid.focus()
		return false
	}
	else if (mailid.value.indexOf("@")==-1 || mailid.value.indexOf(".")==-1){
		alert("Invalid E-mail ID")
		mailid.focus()	   
		return false
	}
	
	txtphone = document.frmapply.txtphone
	if (txtphone.value == "")
	{
		alert("Please enter your Phone Number");
		txtphone.focus()
		return false		
	}
	
	

	if (document.frmapply.uword.value=="" )
	{
	alert('Enter the code as it is shown');
	document.frmapply.uword.focus();
	return false;
	}
	return jcap();
	
	
}
