
/*AutoPrint*/

var gAutoPrint = true; // Tells whether to automatically call the print function

function printSpecial()
{
if (document.getElementById != null)
{
var html = '<HTML>\n<HEAD>\n';

if (document.getElementsByTagName != null)
{
var headTags = document.getElementsByTagName("head");
if (headTags.length > 0)
html += headTags[0].innerHTML;
}
html += '\n</HEAD>\n<BODY style=\"background:#ffffff;\">\n';
html += '\n<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"70%\"><tr><td class=\"textMain\">\n';
var printReadyElem = document.getElementById("printReady");
if (printReadyElem != null)
{
html += printReadyElem.innerHTML;
}
else
{
alert("Could not find the printReady function");
return;
}
html += '\n</td></tr></table>\n';
html += '\n</BODY>\n</HTML>';

var printWin = window.open("","printSpecial");
printWin.document.open();
printWin.document.write(html);
printWin.document.close();
if (gAutoPrint)
printWin.print();
}
else
{
alert("The print ready feature is only available if you are using an browser. Please update your browser.");
}
}

function showForm(subSchedule,subSeminar,subTestimonial){

	document.getElementById('subSchedule').style.display=subSchedule;
	document.getElementById('subSeminar').style.display=subSeminar;
	document.getElementById('subTestimonial').style.display=subTestimonial;
}

function showForm2(subTestimonial){

	document.getElementById('subTestimonial').style.display=subTestimonial;
}


// Schedule your Complimentary Phone Consultation form validation
function schedule() {
	
	firstName = document.scheduleForm.txtName
	if (firstName.value == "" || !isNaN(firstName.value))
	{
		alert("Please enter your First Name");
		firstName.focus()
		return false		
	}

	txtLName = document.scheduleForm.txtLName
	if (txtLName.value == "" || !isNaN(txtLName.value))
	{
		alert("Please enter your Last Name");
		txtLName.focus()
		return false		
	}
	
	mailid = document.scheduleForm.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
	}
	
	phone = document.scheduleForm.txtPhone
	if (phone.value=="" )
	{
	alert('Enter Phone No.');
	phone.focus();
	return false;
	}

	comments = document.scheduleForm.txtMessage
	if (comments.value == "" || !isNaN(comments.value))
	{
		alert("Please enter Message");
		comments.focus()
		return false		
	}
	
	if (document.scheduleForm.uword3.value=="" )
	{
	alert('Enter the code as it is shown');
	document.scheduleForm.uword3.focus();
	return false;
	}
	return jcap3();
	
	
}

// 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();
}

// Contact Us form validation
function Contactus() {
	
	if (document.cuForm.txtFirstName.value=="" || !isNaN(document.cuForm.txtFirstName.value))
	{
	alert('Enter FirstName');
	document.cuForm.txtFirstName.focus();
	return false;
	}
if (document.cuForm.txtSurname.value=="" || !isNaN(document.cuForm.txtSurname.value))
	{
	alert('Enter Surname');
	document.cuForm.txtSurname.focus();
	return false;
	}
	
if (document.cuForm.txtMobileNumber.value=="" )
	{
	alert('Enter Primary Telephone Number.');
	document.cuForm.txtMobileNumber.focus();
	return false;
	}
/*if ((document.cuForm.contactType[0].checked==false) && (document.cuForm.contactType[1].checked==false) && (document.cuForm.contactType[2].checked==false) )
	{
	alert('Please select Primary Telephone No.');
	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();
	
	
}

 
 
 // Appointments form validation
function Appointment()
{
if (document.frmAppointment.txtFirstName.value=="" || !isNaN(document.frmAppointment.txtFirstName.value))
	{
	alert('Enter First Name');
	document.frmAppointment.txtFirstName.focus();
	return false;
	}
if (document.frmAppointment.txtLastName.value=="" || !isNaN(document.frmAppointment.txtLastName.value))
	{
	alert('Enter Last Name');
	document.frmAppointment.txtLastName.focus();
	return false;
	}
if (document.frmAppointment.txtTelephone.value=="" )
	{
	alert('Enter Telephone No.');
	document.frmAppointment.txtTelephone.focus();
	return false;
	}
	
	/*if ((document.frmAppointment.contactType[0].checked==false) && (document.frmAppointment.contactType[1].checked==false) && (document.frmAppointment.contactType[2].checked==false) )
	{
	alert('Please select Primary Telephone No.');
	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();
}

// Testimonials form validation
function Testimonials() {

	if (document.TestimonialsForm.txtFirstName.value=="" || !isNaN(document.TestimonialsForm.txtFirstName.value))
	{
	alert('Enter First Name');
	document.TestimonialsForm.txtFirstName.focus();
	return false;
	}
if (document.TestimonialsForm.txtLastName.value=="" || !isNaN(document.TestimonialsForm.txtLastName.value))
	{
	alert('Enter Last Name');
	document.TestimonialsForm.txtLastName.focus();
	return false;
	}

	mailid = document.TestimonialsForm.txtEmailAddress
	if (mailid.value == '')
	{
		alert("Please enter Your 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
	}
	
	doctor = document.TestimonialsForm.txtdoctor
	if (doctor.value == "")
	{
		alert("Select Orthopaedic Doctor You Saw");
		doctor.focus()
		return false		
	}	
	
	txtProcedure2 = document.TestimonialsForm.txtProcedure
	if (txtProcedure2.value == "" || !isNaN(txtProcedure2.value))
	{
		alert("Procedure Your Received");
		txtProcedure2.focus()
		return false		
	}	
	
	txtProcedure3 = document.TestimonialsForm.txtComments
	if (txtProcedure3.value == "" || !isNaN(txtProcedure3.value))
	{
		alert("Please add Comments");
		txtProcedure3.focus()
		return false		
	}	
	
	if (document.TestimonialsForm.uword.value=="" )
	{
	alert('Enter the code as it is shown');
	document.TestimonialsForm.uword.focus();
	return false;
	}
	return jcap();
	
	
}
 
 
 
 // Prescription form validation
function Prescription()
{
if (document.frmPrescription.txtFirstName.value=="" || !isNaN(document.frmPrescription.txtFirstName.value))
	{
	alert('Enter FirstName');
	document.frmPrescription.txtFirstName.focus();
	return false;
	}
if (document.frmPrescription.txtSurname.value=="" || !isNaN(document.frmPrescription.txtSurname.value))
	{
	alert('Enter Surname');
	document.frmPrescription.txtSurname.focus();
	return false;
	}

doctor = document.frmPrescription.cmbdoctor
	if (doctor.options[doctor.selectedIndex].value == "")
	{
		alert("Please select your Doctor");
	doctor.focus()
	return false		
	}	

if (document.frmPrescription.txtMedication.value=="")
	{
	alert('Enter your Medication Name');
	document.frmPrescription.txtMedication.focus();
	return false;
	}
	
if (document.frmPrescription.txtDosage.value=="")
	{
	alert('Enter your Medication Dosage');
	document.frmPrescription.txtDosage.focus();
	return false;
	}
	
if (document.frmPrescription.txtFrequency.value=="")
	{
	alert('Enter your Medication Frequency');
	document.frmPrescription.txtFrequency.focus();
	return false;
	}
	
if (document.frmPrescription.txtRefillDate.value=="")
	{
	alert('Enter your Medication Refill Date');
	document.frmPrescription.txtRefillDate.focus();
	return false;
	}
	
if (document.frmPrescription.txtRefillAmt.value=="")
	{
	alert('Enter your Medication Refill Amount');
	document.frmPrescription.txtRefillAmt.focus();
	return false;
	}
	
if (document.frmPrescription.txtHomePhoneNumber.value=="" )
	{
	alert('Enter Contact Number.');
	document.frmPrescription.txtHomePhoneNumber.focus();
	return false;
	}
	

if (document.frmPrescription.txtEmailAddress.value=="")
	{
	alert('Enter Email Address');
	document.frmPrescription.txtEmailAddress.focus();
	return false;
	}
	else if (document.frmPrescription.txtEmailAddress.value.indexOf("@")==-1 || document.frmPrescription.txtEmailAddress.value.indexOf(".")==-1){
		alert("Invalid E-mail ID")
		document.frmPrescription.txtEmailAddress.focus()	   
		return false
	}	

if (document.frmPrescription.txtPharmacyName.value=="" )
	{
	alert('Enter your Pharmacy Name');
	document.frmPrescription.txtPharmacyName.focus();
	return false;
	}
	
if (document.frmPrescription.txtPharmacyTel.value=="" )
	{
	alert('Enter your Pharmacy Telephone Number.');
	document.frmPrescription.txtPharmacyTel.focus();
	return false;
	}	

if (document.frmPrescription.uword.value=="" )
	{
	alert('Enter the code as it is shown');
	document.frmPrescription.uword.focus();
	return false;
	}
	return jcap();
}

 
 
 
// Flash Text Banner Script

function recieveTextFromFlash(Txt) {
	PlayFlashMovie(Txt);
	}
	
function getFlashMovieObject(movieName)
{
  if (window.document[movieName]) 
  {
    return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else 
  {
    return document.getElementById(movieName);
  }
}

function PlayFlashMovie(Txt)
{

	var flashMovie=getFlashMovieObject("simplemovie");
	flashMovie.SetVariable("/:mes", Txt);
	
}






