// JavaScript Document



var popUpWin=0;



function popUpWindow(URLStr)

{

   var left = 100;

   var top = 100;

	var right = 100;

   var bottom = 100;

   width=800;

   height=680;

   if(popUpWin)

   {

     if(!popUpWin.closed) popUpWin.close();

   }

   popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+', bottom='+bottom+',right='+right+',screenX='+left+',screenY='+top+'');

}

function showPic( imgName, imgCaption, imgWidth, imgHeight, textColor, bgColor ) {

	if(imgWidth<=100)imgWidth=800

	if(imgHeight<=100)imgHeight=680

	winHeight=imgHeight;

	//winHeight=imgHeight+20;

	w = window.open('','Demo','toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no, copyhistory=no,width='+imgWidth+',height='+winHeight);

	w.document.write( "<html><head><title>"+imgCaption+"</title><META HTTP-EQUIV='imagetoolbar' CONTENT='no'>" );

	w.document.write( "<STYLE TYPE='text/css'>" );

	w.document.write( "A {font-family: verdana; font-size: 10px; color: "+textColor+"; text-decoration : none;}" );

	w.document.write( "A:Visited {font-family: verdana;font-size: 10px; color: "+textColor+"; }" );

	w.document.write( "A:Active { font-family: verdana; font-size: 10px; color: "+textColor+"; }" );

	w.document.write( "A:Hover { font-family: verdana; font-size: 10px; color: "+textColor+"; }" );

	w.document.write( "IMG {border-color : "+textColor+";}" );

	w.document.write( "BODY { font-family: verdana; font-size : 10px; font-weight: normal; color : "+textColor+"; background-color : "+bgColor+"; }" );

	w.document.write( "</STYLE>" );

	w.document.write( "<script language='JavaScript'>\n");

	w.document.write( "IE5=NN4=NN6=false\n");

	w.document.write( "if(document.all)IE5=true;\n");

	w.document.write( "else if(document.getElementById)NN6=true\n");

	w.document.write( "else if(document.layers)NN4=true\n");

	w.document.write( "function autoSize() {\n");

	w.document.write( "	if(IE5) self.resizeTo(document.images[0].width+10,document.images[0].height+31)\n");

	w.document.write( "	else if(NN6) self.sizeToContent()\n");

	w.document.write( "	else top.window.resizeTo(document.images[0].width,document.images[0].height)\n");

	w.document.write( "	self.focus()\n");

	w.document.write( "}\n</scr");

	w.document.write( "ipt>\n");

	w.document.write( "</head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad=" );

	w.document.write( "'javascript:autoSize();'>" );

	w.document.write( "<table cellpadding=0 cellspacing=0 border=0><tr><td><img src='"+imgName+"' border=0 alt='"+imgCaption+"'></td></tr>" );

	w.document.write( "</table></body></html>" );

	w.document.close();

}

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];}

}

//-->

//the main function, call to the effect object



	function init(){



	



	



		var stretchers = document.getElementsByClassName('stretcher'); //div that stretches



		var toggles = document.getElementsByClassName('display'); //h3s where I click on







		//accordion effect



		var myAccordion = new fx.Accordion(



			toggles, stretchers, {opacity: true, duration: 400}



		);







		//hash function



		



		function checkHash(){



			var found = false;



			toggles.each(function(h3, i){



				if (window.location.href.indexOf(h3.title) > 0) {



					myAccordion.showThisHideOpen(stretchers[i]);



					found = true;



				}



			});



			return found;



		}



		



		//if (!checkHash()) myAccordion.showThisHideOpen(stretchers[0]);



	}

function cleancontent()

{

		Element.cleanWhitespace('content');

		init();

}

function popupWindow(url) {

  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=520,height=670,screenX=150,screenY=150,top=150,left=150')

}





<!-- Copyright 2005, Sandeep Gangadharan -->

<!-- For more free scripts go to http://www.sivamdesign.com/scripts/ -->

<!--

if (document.getElementById) {

 document.writeln('<style type="text/css"><!--')

 document.writeln('.texter {display:none}')

 document.writeln('//--></style>') }



if (document.getElementById) 

{

	document.writeln('<style type="text/css"><!--')

	document.writeln('.texter {display:none}')

	document.writeln('//--></style>') 

}



var divObj;

var tblObj;

var displayMode;

var k;	

function openCloseID(theID) 

{



	divObj = document.getElementById(theID);

	rowObj = divObj.getElementsByTagName('tr');



	displayMode = document.getElementById(theID).style.display == '' ? 'none': '';

	

	k = displayMode == '' ? 0 : (rowObj.length - 1);



alert(displayMode);

alert(k);

 //	doFun();







	/*

	var divObj = document.getElementById(theID);



	var rowObj = divObj.getElementsByTagName('tr');

	

  	alert(rowObj.length);

	

	if (divObj.style.display == "block") 

	{ 

		k = rowObj.length - 1;

		setTimeout( " if(rowObj[k] != null ) { rowObj[k].style.display ='none';--k; }else{ clearTimeout();};", 1000);

	}

	else 

	{ 

		i=0;

		setTimeout( "if(rowObj[i]!= null) { rowObj[i].style.display ='';++i; }else{ clearTimeout();};", 1000);

		

	}



*/

	//var tblObj = divObj.getElementsByTagName('table');



	



//	alert(tblObj.rows[0]);







/*

	var next = document.getElementById('newsidlist').value;

	var next01 = Array();

	next01 = next.split("|");

	for(i=0;i<next.length;i++)

	{

		if(theID==('a'+next01[i]))

		{

		 	if (document.getElementById(theID).style.display == "block") 

		 	{ 

				document.getElementById(theID).style.display = "none" 

			}

			else 

			{ 

				document.getElementById(theID).style.display = "block" 

			}

		}

		else

		{

			document.getElementById('a'+next01[i]).style.display = "none";

		}

	}

*/

}





function doFun()

{



	if(displayMode == 'none')

	{

		if(rowObj[k] != null)

		{

			rowObj[k].style.display = displayMode;

			setTimeout('doFun()', 1000);

			k--;

		}

		else

		{

			clearTimeout();

		}

	}

	else (displayMode == '')

	{

		if(rowObj[k] != null)

		{

			rowObj[k].style.display = displayMode;

			setTimeout('doFun()', 1000);

			k++;

		}

		else

		{

			clearTimeout();

		}

	}

		

}



function openClose(theID) 

{

	if (document.getElementById(theID).style.display == "block") 

	{ 

		document.getElementById(theID).style.display = "none" 

	}

	else 

	{ 

		document.getElementById(theID).style.display = "block" 

	} 

}

// -->

/*******************************************************************************************/

function emailCheck (emailStr)

{

    var emailPat=/^(.+)@(.+)$/

    var specialChars="\\(\\)<>@,'%#&$;:\\\\\\\"\\.\\[\\]"

    var validChars="\[^\\s" + specialChars + "\]"

    var quotedUser="(\"[^\"]*\")"

    var ipDomainPat=/^\[(\d)\.(\d)\.(\d)\.(\d)\]$/

    var atom=validChars + '+'

    var word="(" + atom + "|" + quotedUser + ")"

    var userPat=new RegExp("^" + word + "(\\." + word + ")*$")

    var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")

    var matchArray=emailStr.match(emailPat)



    if (matchArray==null)

    {

    // alert("Email address seems incorrect (check @ and .'s)")

    return false

    }



    var user=matchArray[1]

    var domain=matchArray[2]

    if (user.match(userPat)==null)

    {

    //    alert("The username doesn't seem to be valid.")

        return false

    }



    var IPArray=domain.match(ipDomainPat)

    if (IPArray!=null)

    {

      for (var i=1;i<=4;i++)

      {

       if (IPArray[i]>255)

      {

        //         alert("Destination IP address is invalid!")

         return false

      }

     }

      return true

   }



    var domainArray=domain.match(domainPat)

    if (domainArray==null)

   {

      // alert("The domain name doesn't seem to be valid.")

      return false

   }



   var atomPat=new RegExp(atom,"g")

   var domArr=domain.match(atomPat)

    var len=domArr.length



    if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3)

    {

     // the address must end in a two letter or three letter word.

     //   alert("The address must end in a three-letter domain, or two letter country.")

     return false

    }



    if (len<2)

   {

     var errStr="This address is missing a hostname!"

     return false

   }



 return true;

} 





function dobcheck(theinput,form)

{

	var currentTime = new Date()

	var text01 = Array();

	text01[0] = currentTime.getDate();

	text01[1] = (currentTime.getMonth()+1);

	text01[2] = currentTime.getFullYear();

	text02 = theinput.split("-");

	

	if(theinput!='')

	{

		if(text02[2] == text01[2] && text02[1] == text01[1] && text02[0] == text01[0]) 

		{

		alert("The Date of Birth should not allow selection of Current date.");

		form.DateofBirth.value='';

		form.DateofBirth.focus();

		return false;

		}

		else

		{

		    if(text02[2] > text01[2]) 

			{

			alert("The Date of Birth should not allow selection of future Year.");

			form.DateofBirth.value='';

			form.DateofBirth.focus();

			return false;

			}

		else 

				{

					if(text02[2] == text01[2] && text02[1] > text01[1])

					{

					alert("The Date of Birth should not allow selection of future Month.");

					form.DateofBirth.value='';

					form.DateofBirth.focus();

					return false;

					}

					else

					{

					 if(text02[2] == text01[2] && text02[1] == text01[1] && text02[0] >= text01[0])

						{

						   alert("The Date of Birth should not allow selection of future date.");

						   form.DateofBirth.value='';

						   form.DateofBirth.focus();

						   return false; 

						}	

					}

				}		

		}

}

	return true;	

}

function patientvalidity(form)

{

	String.prototype.trim = function() 

	{

		return this.replace(/^\s+|\s+$/g,"");

	}



  if(form.Fname.value.trim() =="")

   {

      alert("Please Enter Frist Name ");

      form.Fname.value='';

      form.Fname.focus();

      return false;

   }

    if(!isNaN(form.Fname.value))

   {

   alert("Please Don't Enter Numeric Value Frist Name");

   form.Fname.value='';

   form.Fname.focus();

   return false;

   }

 if(form.LName.value.trim() == "")

   {

     alert("Please Enter Last Name ");

	  form.LName.value='';

      form.LName.focus();

      return false;

   }

   if(!isNaN(form.LName.value))

   {

   alert("Please Don't Enter Numeric Value Last Name");

   form.LName.value='';

   form.LName.focus();

   return false;

   }

   if(form.DateofBirth.value=="")

	{

	   alert("Please Select Date Of Birth");

		return false;

	}

  if(!dobcheck(form.DateofBirth.value,form))

	{

	return false;

	}

	if(form.med.value.trim() != "")

	{

	   if(!isNaN(form.med.value))

	   {

		   alert("Please Don't Enter Numeric Value Medication");

		   form.med.value='';

		   form.med.focus();

		   return false;

	   }

	}



  if(form.Tel.value.trim() =="")

   {

      alert("Please Enter Telephone Number ");

     	form.Tel.value='';

      form.Tel.focus();

      return false;

   }

   if(isNaN(form.Tel.value))

   {

   alert("Please Enter Numeric Telephone Number ");

   form.Tel.value='';

   form.Tel.focus();

   return false;

   }

 if(form.Mob.value.trim() =="")

   {

      alert("Please Enter Mobile Number ");

     form.Mob.value='';

      form.Mob.focus();

      return false;

   }

     if(isNaN(form.Mob.value))

   {

      alert("Please Enter Numeric Mobile Number ");

     form.Mob.value='';

      form.Mob.focus();

      return false;

   }

  if(form.Email.value.trim() =="")

   {

      alert("Please Enter EMail Address ");

     form.Email.value='';

      form.Email.focus();

      return false;

   }

   if(!emailCheck(form.Email.value))

   {

     alert("Please Check Email Address");

    form.Email.select();

    form.Email.focus();

    return false;

  	}



  return true;

}







/*********************************************************************************/

function validatejobapplyForm(form)

{

	if(form.applyingfor.value=="")

	{

	  alert("Please enter the name of job apply");

	  form.applyingfor.value = "";	

  	  form.applyingfor.focus();

	  return false;

	}

	if(form.contactName.value=="")

	{

	  alert("Please enter the contact name ");

	  form.contactName.value = "";	

	 

  	  form.contactName.focus();

	  return false;

	}

   if(!isNaN(form.contactName.value))

   {

	 alert('Do not Enter Numeric value for contact name');

	 form.contactName.value = "";

	 form.contactName.focus();

	 return false;

   }	

	if(form.contactNumber.value=="")

	{

	  alert("Please enter the contact number");

	  form.contactNumber.select();  

  	  form.contactNumber.focus();

	  return false;

	}	

   if(isNaN(form.contactNumber.value))

   {

	 alert('Enter Numeric value for contact number');

	 form.contactNumber.value = "";

	 form.contactNumber.focus();

	 return false;

   }

	if(form.email.value=="")

	{

	  alert("Please enter the contact email address");

	  form.email.value='';  

  	  form.email.focus();

	  return false;

	}

 if (!emailCheck(form.email.value))

   {
	
	alert("Please Check eMail address");
	form.email.value = '';
    form.email.focus();

    return false;

   }

if(form.resume.value==="")

	{

	alert("Please upload your resume");

	form.resume.focus();

	return false;

	}



return true;

}

/*******************************************************************/

function validateForm(form)

{

	if(form.fname.value=="")

	{

		alert("Please Enter The First Name ");

		form.fname.value = "";

		form.fname.focus();

		return false;

	}

	if(!isNaN(form.fname.value))

	{

		alert('Please Enter Valid First Name');

		form.fname.value = "";

		form.fname.focus();

		return false;

	}

	if(form.lname.value=="")

	{

		alert("Please Enter The Last Name ");  

		form.lname.value = "";

		form.lname.focus();

		return false;

	}

	if(!isNaN(form.lname.value))

	{

		alert('Please Enter Valid Last Name');

		form.lname.value = "";

		form.lname.focus();

		return false;

	}

	if(checkGender1()==true)

	{

		alert("Please Select A Gender");

		return false;

	}

	

    if(form.dob.value=="")

	{

	    alert("Please Enter Date Of Birth");

		form.dob.value = "";

		form.dob.focus();

		return false;

	}

	if(!adobcheck(form.dob.value,form))

	{

		return false;

	}	

	if(form.nationality.value !="")

	{

		if(!isNaN(form.nationality.value))

		{

			alert('Please Enter Valid nationality');

			form.nationality.value = "";

			form.nationality.focus();

			return false;

		}	

	}

	if(checkStatus1()==true)

	{

		alert("Please Select A Marital Status");

		return false;

	}	

	if(form.phone.value =="")

	{

		alert("Please Enter Telephone Number ");

		form.phone.value='';

		form.phone.focus();

		return false;

	}

	if(isNaN(form.phone.value))

	{

		alert("Please Enter Numeric Telephone Number ");

		form.phone.value='';

		form.phone.focus();

		return false;

	}

	if(form.mobile.value =="")

	{

		alert("Please Enter Mobile Number ");

		form.mobile.value='';

		form.mobile.focus();

		return false;

	}

	if(isNaN(form.mobile.value))

	{

		alert("Please Enter Numeric Mobile Number ");

		form.mobile.value='';

		form.mobile.focus();

		return false;

	}		

	if(form.email.value != '')

	{

		if(!emailCheck(form.email.value))

		{

			alert("Please Check Email Address");

			form.email.value ='';

			form.email.focus();

			return false;

		}	

	}

	if(form.address.value=="")

	{

		alert("Please Enter The Address ");  

		form.address.focus();

		return false;

	}

	if(form.doctor.value=="")

	{

		alert("Please Select The Doctor ");

		form.doctor.value = "";

		form.doctor.focus();

		return false;

	}

    if(form.date1.value=="")

	{

	    alert("Please Enter Preferred Date 1");

		form.date1.value = "";

		form.date1.focus();

		return false;

	}

	if(!date1check(form.date1.value,form))

	{

		return false;

	}

    if(form.date2.value=="")

	{

	    alert("Please Enter Preferred Date 2");

		form.date2.value = "";

		form.date2.focus();

		return false;

	}

	if(!date2check(form.date2.value,form))

	{

		return false;

	}			

    if(form.time1.value=="")

	{

	    alert("Please Enter Time 1");

		form.time1.value = "";

		form.time1.focus();

		return false;

	}

    if(form.time2.value=="")

	{

	    alert("Please Enter Time 2");

		form.time2.value = "";

		form.time2.focus();

		return false;

	}		

	return true;

}





function checkGender1() 

{

	var b;

	b = document.form1;

	for (var c=0,d=0,e; e=b[d]; d++)

	{

		if (e.type=='radio' && e.name.match(/^gender\[\]$/) && e.checked) {  c++; }

	}

	if (c==0)

	{ 

		return true; 

	}

	

	return false;

}



function checkGender()

{

	var i;

	var counter=0;



	for(var i=0; i < document.form1.gender.length; i++)

	{

		if(document.form1.gender[i].checked==true)

		{

			counter++;

		}

	}

	if(counter==0)

	{

		return true;

	}

	return false;

}



function checkStatus1() 

{

	var b;

	b = document.form1;

	for (var c=0,d=0,e; e=b[d]; d++)

	{

		if (e.type=='radio' && e.name.match(/^status\[\]$/) && e.checked) {  c++; }

	}

	if (c==0)

	{ 

		return true; 

	}

	

	return false;

}



function checkStatus()

{

	var i;

	var counter=0;



	for(var i=0; i < document.form1.status.length; i++)

	{

		if(document.form1.status[i].checked==true)

		{

			counter++;

		}

	}

	if(counter==0)

	{

		return true;

	}

	return false;

}

function date1check(theinput,form)

{

	var currentTime = new Date()

	var text01 = Array();

	text01[0] = currentTime.getDate();

	text01[1] = (currentTime.getMonth()+1);

	text01[2] = currentTime.getFullYear();

	if(theinput!='')

	{

		text02 = theinput.split("-");

		if(  text01[0] >= text02[0])

		{

			alert("Please Enter Feature Date 1.");

			form.date1.select();

			form.date1.value = "";

			form.date1.focus();

			return false;

		}

	}

	return true;

}



function date2check(theinput,form)

{

	var currentTime = new Date()

	var text01 = Array();

	text01[0] = currentTime.getDate();

	text01[1] = (currentTime.getMonth()+1);

	text01[2] = currentTime.getFullYear();

	if(theinput!='')

	{

		text02 = theinput.split("-");

		if(  text01[0] >= text02[0])

		{

			alert("Please Enter Feature Date 2.");

			form.date2.select();

			form.date2.value = "";

			form.date2.focus();

			return false;

		}

	}

	return true;

}

function adobcheck(theinput,form)

{

	var currentTime = new Date()

	var text01 = Array();

	text01[0] = currentTime.getDate();

	text01[1] = (currentTime.getMonth()+1);

	text01[2] = currentTime.getFullYear();

	if(theinput!='')

	{

	text02 = theinput.split("-");

	if(text02[0] >= text01[0])

	{

	alert("The Date of Birth should not allow selection of future date.");

	form.dob.select();

	form.dob.focus();

	return false;

	}

	}

}





var newwindow;



function poptastic(url)



{



	newwindow=window.open(url,'name','height=414,width=625');



	if (window.focus) {newwindow.focus()}



}

