
$(document).ready( function(){ $('#portfolio').innerfade({ speed: 1500, timeout: 4000, type: 'sequence', containerheight: '142px' }); } );
 // 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() {


	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
	}

	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=="")
	{
	alert('Enter FirstName');
	document.frmAppointment.txtFirstName.focus();
	return false;
	}
if (document.frmAppointment.txtSurname.value=="")
	{
	alert('Enter Surname');
	document.frmAppointment.txtSurname.focus();
	return false;
	}
	
	
	appointment = document.frmAppointment.cmbappointment
	if (appointment.options[appointment.selectedIndex].value == "")
	{
		alert("Please select your Appointment");
	appointment.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();
	
	
}

//Random Images
           function getCookie(c_name)
                {
                if (document.cookie.length>0)
                  {
                  c_start=document.cookie.indexOf(c_name + "=");
                  if (c_start != -1)
                    {
                    c_start=c_start + c_name.length+1
                    c_end=document.cookie.indexOf(";",c_start)
                    if (c_end==-1) c_end=document.cookie.length
                   return unescape(document.cookie.substring(c_start,c_end))
                    }
                  }
                return null
                }
                function randImagesCookie()
                {
                       if(getCookie('name')==null || getCookie('name')=="NaN")
                        {
                                document.cookie="name"+"="+1;
                        }
                        var cimgnum=getCookie('name');
                        if(cimgnum >= 2) {
                                var simgnum=1;
                        } else {
                                var simgnum=parseInt(cimgnum)+1;
                        }
						for(i=1; i<=1; i++)
						{
						  var imagename = "index"+simgnum+"_"+i
	                        document.cookie="name"+"="+simgnum;
							var tmp = eval("document.getElementById('index"+i+"')")
	                        var thePicture=tmp;
							var picPath="images/"+imagename+".jpg";
							thePicture.src=picPath;
							
   						}
                }
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}




 // Contact Us form validation
function elbowform() {
	
	firstName = document.ebForm.txtDateMonth
	if (firstName.value == "" || !isNaN(firstName.value))
	{
		alert("Please enter your first name");
		firstName.focus()
		return false		
	}

	mailid = document.ebForm.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.ebForm.txtMessage
	if (comments.value == "" || !isNaN(comments.value))
	{
		alert("Please add your comments");
		comments.focus()
		return false		
	}	
	if (document.ebForm.uword.value=="" )
	{
	alert('Enter the code as it is shown');
	document.cuForm.uword.focus();
	return false;
	}
	return jcap();
	
	
}


function Prescription() {
	
	
	
	firstName = document.frmPrescription.txtFirstName
	if (firstName.value == "")
	{
		alert("Please enter your First Name");
		firstName.focus()
		return false		
	}

	LastName = document.frmPrescription.txtlastName
	if (LastName.value == "")
	{
		alert("Please enter your Last Name");
		LastName.focus()
		return false		
	}
	
	mailid = document.frmPrescription.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
	}

	dob = document.frmPrescription.txtdob
	if (dob.value == "")
	{
		alert("Please enter your Date of Birth");
		dob.focus()
		return false		
	}

	phone = document.frmPrescription.txtphone
	if (phone.value == "")
	{
		alert("Please enter your Phone Number");
		phone.focus()
		return false		
	}
	
	
	Physician = document.frmPrescription.cmbPhysician
	if (Physician.options[Physician.selectedIndex].value == "")
	{
		alert("Please select your Physician Name");
	Physician.focus()
	return false		
	}	
	
	
	medicationname = document.frmPrescription.medicationname
	if (medicationname.value == "")
	{
		alert("Please enter your Medication Name");
		medicationname.focus()
		return false		
	}
	
	medicationdosage = document.frmPrescription.medicationdosage
	if (medicationdosage.value == "")
	{
		alert("Please enter your Medication Dosage");
		medicationdosage.focus()
		return false		
	}
	
		
	
	pharmacyname = document.frmPrescription.pharmacyname
	if (pharmacyname.value == "")
	{
		alert("Please enter your Physician Name");
		pharmacyname.focus()
		return false		
	}
	
	
	pharmacyphonenumber = document.frmPrescription.pharmacyphonenumber
	if (pharmacyphonenumber.value == "")
	{
		alert("Please enter your Physician Phone Number");
		pharmacyphonenumber.focus()
		return false		
	}
	
	pharmacyfaxnumber = document.frmPrescription.pharmacyfaxnumber
	if (pharmacyfaxnumber.value == "")
	{
		alert("Please enter your Physician Fax Number");
		pharmacyfaxnumber.focus()
		return false		
	}
	
	comments = document.frmPrescription.txtMessage
	if (comments.value == "")
	{
		alert("Please add your Comments");
		comments.focus()
		return false		
	}	
	
	
	if (document.frmPrescription.uword.value=="" )
	{
	alert('Enter the code as it is shown');
	document.frmPrescription.uword.focus();
	return false;
	}
	return jcap();
	
	
}
	
	
	
	// Testimonials form validation
function Testimonials() {

	yourName = document.TestimonialsForm.txtyourname
	if (yourName.value == "")
	{
		alert("Please enter Your Name");
		yourName.focus()
		return false		
	}

	mailid = document.TestimonialsForm.txtyouremail
	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
	}

	testimonial = document.TestimonialsForm.txttestimonial
	if (testimonial.value == "" || !isNaN(testimonial.value))
	{
		alert("Please add Your Testimonial");
		testimonial.focus()
		return false		
	}	
	
	if (document.TestimonialsForm.uword.value=="" )
	{
	alert('Enter the code as it is shown');
	document.TestimonialsForm.uword.focus();
	return false;
	}
	return jcap();
	
	
}
function validateLogin()
 {
    var o = document.getElementById('txtusername');    
          if (o.value==0)
             {
                         alert("Enter User Name")
                         document.getElementById('txtusername').focus()	   
                         return false
             }
  var o = document.getElementById('txtpassword');    
          if (o.value==0)
             {
                         alert("Enter Password")
                         document.getElementById('txtpassword').focus()	   
                         return false
             }
 
 }
 
 
 // Font Size Increasing//



var min=8;
var max=15;
function increaseFontSize()
{
	 
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) 
   {
      if(p[i].style.fontSize) 
	  {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else
	  {
         var s = 12;
      }
      if(s!=max)
	  {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
	  
	 
   }
     var li = document.getElementsByTagName('li');
	  
	 for(i=0;i<li.length;i++) 
	 {
		  if(li[i].style.fontSize) 
		  {
			 var s = parseInt(li[i].style.fontSize.replace("px",""));
		  } 
		  else 
		  {
			 var s = 12;
		  }
		  if(s!=max) 
		  {
			 s += 1;
		  }
		  li[i].style.fontSize = s+"px"
	 }
	 
	 
	 var a = document.getElementsByTagName('a');
	  
	 for(i=0;i<a.length;i++) 
	 {
		  if(a[i].style.fontSize) 
		  {
			 var s = parseInt(a[i].style.fontSize.replace("px",""));
		  } 
		  else 
		  {
			 var s = 12;
		  }
		  if(s!=max) 
		  {
			 s += 1;
		  }
		  a[i].style.fontSize = s+"px"
	 }
	 
	 
	 var span = document.getElementsByTagName('span');
	  
	 for(i=0;i<span.length;i++) 
	 {
		  if(span[i].style.fontSize) 
		  {
			 var s = parseInt(span[i].style.fontSize.replace("px",""));
		  } 
		  else 
		  {
			 var s = 12;
		  }
		  if(s!=max) 
		  {
			 s += 1;
		  }
		  span[i].style.fontSize = s+"px"
	 }
	 
	 
	 var td = document.getElementsByTagName('td');
	  
	 for(i=0;i<td.length;i++) 
	 {
		  if(td[i].style.fontSize) 
		  {
			 var s = parseInt(td[i].style.fontSize.replace("px",""));
		  } 
		  else 
		  {
			 var s = 12;
		  }
		  if(s!=max) 
		  {
			 s += 1;
		  }
		  td[i].style.fontSize = s+"px"
	 }
}


function decreaseFontSize() 
{
	
   var p = document.getElementsByTagName('p');
   
   for(i=0;i<p.length;i++) 
   
   	  {
		   
      if(p[i].style.fontSize) 
	  
	  {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else 
	  {
         var s = 12;
      }
      if(s!=min) 
	{
         s -= 1;
    }
      p[i].style.fontSize = s+"px"
}   



	var li = document.getElementsByTagName('li');
   
   for(i=0;i<li.length;i++) 
   
   	  {
		   
      if(li[i].style.fontSize) 
	  
	  {
         var s = parseInt(li[i].style.fontSize.replace("px",""));
      } else 
	  {
         var s = 12;
      }
      if(s!=min) 
	{
         s -= 1;
    }
      li[i].style.fontSize = s+"px"
} 


var a = document.getElementsByTagName('a');
   
   for(i=0;i<a.length;i++) 
   
   	  {
		   
      if(a[i].style.fontSize) 
	  
	  {
         var s = parseInt(a[i].style.fontSize.replace("px",""));
      } else 
	  {
         var s = 12;
      }
      if(s!=min) 
	{
         s -= 1;
    }
      a[i].style.fontSize = s+"px"
} 


var span = document.getElementsByTagName('span');
   
   for(i=0;i<span.length;i++) 
   
   	  {
		   
      if(span[i].style.fontSize) 
	  
	  {
         var s = parseInt(span[i].style.fontSize.replace("px",""));
      } else 
	  {
         var s = 12;
      }
      if(s!=min) 
	{
         s -= 1;
    }
      span[i].style.fontSize = s+"px"
} 
   
   
   
   var td = document.getElementsByTagName('td');
   
   for(i=0;i<td.length;i++) 
   
   	  {
		   
      if(td[i].style.fontSize) 
	  
	  {
         var s = parseInt(td[i].style.fontSize.replace("px",""));
      } else 
	  {
         var s = 12;
      }
      if(s!=min) 
	{
         s -= 1;
    }
      td[i].style.fontSize = s+"px"
} 
   

   
}
