// JavaScript Document



<!-- The Date -->
    month = new Array(12);
      month[0]="January"
      month[1]="February"
      month[2]="March"
      month[3]="April"
      month[4]="May"
      month[5]="June"
      month[6]="July"
      month[7]="August"
      month[8]="September"
      month[9]="October"
      month[10]="November"
      month[11]="December"

    day = new Array(7);
      day[0]="Sunday"
      day[1]="Monday"
      day[2]="Tuesday"
      day[3]="Wednesday"
      day[4]="Thursday"
      day[5]="Friday"
      day[6]="Saturday"

today=new Date();
dy=today.getDay();
date=today.getDate();
mo=today.getMonth();
yr=today.getFullYear();



function noRightClick() {
if (event.button==2) {
alert('Right Click function has been disabled!')
}
}
document.onmousedown=noRightClick






function checkcontact ( contact )
{
    // ** START **
	
//Validates fname Textbox for an entry
if (contact.fname.value == "") {
        alert( "Please enter your First Name" );
        contact.fname.focus();
        return false ;
    }


//Validates lname Textbox for an entry
if (contact.lname.value == "") {
        alert( "Please enter your Last Name" );
        contact.lname.focus();
        return false ;
    }
/*
//Validates address Textbox for an entry
if (contact.address.value == "") {
        alert( "Please enter your Mailing Address" );
        contact.address.focus();
        return false ;
    }

//Validates city Textbox for an entry
if (contact.city.value == "") {
        alert( "Please enter your City" );
        contact.city.focus();
        return false ;
    }

//Validates state Textbox for an entry
if (contact.state.value == "--") {
        alert( "Please enter your State" );
        contact.state.focus();
        return false ;
    }

//Validates zip Textbox for an entry
if (contact.zip.value == "") {
        alert( "Please enter your State and Zip Code\nDon\'t forget Your State!" );
        contact.zip.focus();
        return false ;
    }
*/
//Validates an Email Address Textbox
	if (contact.email.value == "")
	{
	    alert("Please enter your email address.");
		contact.email.focus();
		return (false);
	}			
 			
	var teststr = (contact.email.value);
  	var iserr=false;
	if (!teststr=='')
	{ 
	  // there must be >= 1 character before @, so we
	  // start looking at character position 1 
	  // (i.e. second character)
	var i = 1;
	var sLength = teststr.length;
	  // look for @
	while ((i < sLength) && (teststr.charAt(i) != "@"))
	{ 
	i++;
	}
	if ((i >= sLength) || (teststr.charAt(i) != "@")) 
	{
	iserr=true;
	}
		else 
		{
		 i += 2;
		 // look for "."
		 while ((i < sLength) && (teststr.charAt(i) != "."))
			 { 
				i++;
			 }
		 // there must be at least one character after the "."
		 if ((i >= sLength - 1) || (teststr.charAt(i) != ".")) 
		 	{
			iserr = true;
			}
		}
   }
	   if (iserr)
		 {
		  alert('Please enter a Valid Email Address.');
		  contact.email.focus();
   	      return (false);				  
	     }
		 

//Validates phone number for an entry
if (contact.phone.value == "") {
        alert( "Please enter your Telephone Number" );
        contact.phone.focus();
        return false ;
    }
/*
//Validates phone area code for an blank
if (contact.first.value == "") {
        alert( "Please enter your Area Code" );
        contact.first.focus();
        return false ;
    }

//Validates phone prefix for an entry
if (contact.second.value == "###") {
        alert( "Please enter your Phone Prefix" );
        contact.second.focus();
        return false ;
    }

//Validates phone prefix for an blank
if (contact.second.value == "") {
        alert( "Please enter your Phone Prefix" );
        contact.second.focus();
        return false ;
    }

//Validates phone suffix for an entry
if (contact.third.value == "###") {
        alert( "Please enter your Phone Suffix" );
        contact.third.focus();
        return false ;
    }

//Validates phone suffix for an blank
if (contact.third.value == "") {
        alert( "Please enter your Phone Suffix" );
        contact.third.focus();
        return false ;
    }

*/




/*	
//Validates referral Menu for an entry
if (contact.refer.value == "Please Select"); {
        alert( "Please make your Referral Selection" );
        contact.refer.focus();
        return false ;
    }
//Validates enquiry Menu for an entry
if (contact.enquiry.value == "Please Select"); {
        alert( "Please make your Enquiry Selection" );
        contact.enquiry.focus();
        return false ;
    }


//Validates interested Textbox for an entry
if (contact.interested.value == "select one") {
        alert( "Please Make Your Selection" );
        contact.interested.focus();
        return false ;
    }

//Validates phone Textbox for an blank
if (contact.phone.value == "") {
        alert( "Please enter your Phone Number" );
        contact.phone.focus();
        return false ;
    }
*/

//Validates comment Textbox for an entry
    if (contact.comment.value == "") {
        alert( "Please enter your Message" );
        contact.comment.focus();
        return false ;
    }

    // ** END **
	return true ;
}



// Validate Applym form
function checkapplym ( applym )
{
    // ** START **

//Validates lname Textbox for an entry
if (applym.lname.value == "") {
        alert( "Please enter your Last Name" );
        applym.lname.focus();
        return false ;
    }
	
//Validates fname Textbox for an entry
if (applym.fname.value == "") {
        alert( "Please enter your First Name" );
        applym.fname.focus();
        return false ;
    }

//Validates mname Textbox for an entry
//if (applym.mname.value == "") {
//        alert( "Please enter your Middle/Maiden Name" );
//        applym.mname.focus();
//        return false ;
//    }

//Validates street address Textbox for an entry
if (applym.street.value == "") {
        alert( "Please enter your Street Address" );
        applym.street.focus();
        return false ;
    }

//Validates city Textbox for an entry
if (applym.city.value == "") {
        alert( "Please enter your City" );
        applym.city.focus();
        return false ;
    }

//Validates state Textbox for an entry
//if (apllym.state.value == "  ") {
//        alert( "Please enter your State" );
//        apllym.state.focus();
//        return false ;
//    }


//Validates state and zip Textboxes for an entry
if (applym.zip.value == "") {
        alert( "Please enter your State and Zip Code\nDon\'t forget Your State!" );
        applym.zip.focus();
        return false ;
    }
	
//Validates rph Textbox for an entry
if (applym.rph.value == "(area code first)") {
        alert( "Please enter your Residence Phone Number" );
        applym.rph.focus();
        return false ;
    }


//Validates an Email Address Textbox
	if (applym.email.value == "")
	{
	    alert("Please enter your email address.");
		applym.email.focus();
		return (false);
	}			
 			
	var teststr = (applym.email.value);
  	var iserr=false;
	if (!teststr=='')
	{ 
	  // there must be >= 1 character before @, so we
	  // start looking at character position 1 
	  // (i.e. second character)
	var i = 1;
	var sLength = teststr.length;
	  // look for @
	while ((i < sLength) && (teststr.charAt(i) != "@"))
	{ 
	i++;
	}
	if ((i >= sLength) || (teststr.charAt(i) != "@")) 
	{
	iserr=true;
	}
		else 
		{
		 i += 2;
		 // look for "."
		 while ((i < sLength) && (teststr.charAt(i) != "."))
			 { 
				i++;
			 }
		 // there must be at least one character after the "."
		 if ((i >= sLength - 1) || (teststr.charAt(i) != ".")) 
		 	{
			iserr = true;
			}
		}
   }
	   if (iserr)
		 {
		  alert('Please enter a Valid Email Address.');
		  applym.email.focus();
   	      return (false);				  
	     }
	

//Validates high school grad selection - yes/no
if (applym.highschool.value == "Please Select One"){
        alert( "Are you a High School Graduate? Yes/No" );
        applym.highschool.focus();
        return false ;
    }

//Validates college entry
if (applym.college.value == ""){
        alert( "Please Enter Name of College/University, OR, 'N/A'" );
        applym.college.focus();
        return false ;
    }

//Validates courses entry
if (applym.courses.value == ""){
        alert( "Please Enter Name of Courses Completed, OR, 'N/A'" );
        applym.courses.focus();
        return false ;
    }


//Validates medical setting selection - yes/no
if (applym.medical.value == "Please Select One"){
        alert( "Have you worked in a Medical Setting? Yes/No" );
        applym.medical.focus();
        return false ;
    }




//Validates interest selection - own business / work for clinic
if (applym.interest.value == "Please Select One"){
        alert( "Please Select your Business Interest" );
        applym.interest.focus();
        return false ;
    }


//Validates equipment selection - new / used/ none
if (applym.equipment.value == "Please Select One"){
        alert( "Please Select your Equipment Interest" );
        applym.equipment.focus();
        return false ;
    }






//Validates tc Textbox for an blank
if (applym.tc.checked == 0){
        alert( "Please accept the Terms & Conditions" );
        applym.tc.focus();
        return false ;
    }

//Validates signature Textbox for an entry
if (applym.signature.checked == 0){
        alert( "Please Check the Signature Box" );
        applym.signature.focus();
        return false ;
    }

//Validates phone Textbox for an blank
//if (contact.phone.value == "") {
//        alert( "Please enter your Phone Number" );
//        contact.phone.focus();
//        return false ;
//    }


//Validates comment Textbox for an entry
//if (applym.comment.value == "") {
//        alert( "Please enter your Comments" );
//        applym.comment.focus();
//        return false ;
//    }

    // ** END **
	return true ;
}

///////////////////////////////////////////////////////


// Validate Applych form
function checkapplych ( applych )
{
    // ** START **

//Validates lname Textbox for an entry
if (applych.lname.value == "") {
        alert( "Please enter your Last Name" );
        applych.lname.focus();
        return false ;
    }
	
//Validates fname Textbox for an entry
if (applych.fname.value == "") {
        alert( "Please enter your First Name" );
        applych.fname.focus();
        return false ;
    }

//Validates mname Textbox for an entry
//if (applych.mname.value == "") {
//        alert( "Please enter your Middle/Maiden Name" );
//        applych.mname.focus();
//        return false ;
//    }

//Validates street address Textbox for an entry
if (applych.street.value == "") {
        alert( "Please enter your Street Address" );
        applych.street.focus();
        return false ;
    }

//Validates city Textbox for an entry
if (applych.city.value == "") {
        alert( "Please enter your City" );
        applych.city.focus();
        return false ;
    }

//Validates state and zip Textboxes for an entry
if (applych.zip.value == "") {
        alert( "Please enter your State and Zip Code\nDon\'t forget Your State!" );
        applych.zip.focus();
        return false ;
    }

//Validates country Textbox for an entry
//if (apllych.country.value == "") {
//        alert( "Please enter your Country" );
//        apllych.country.focus();
//        return false ;
//    }

//Validates rph Textbox for an entry
if (applych.rph.value == "(area code first)") {
        alert( "Please enter your Residence Phone Number" );
        applych.rph.focus();
        return false ;
    }

//Validates rph Textbox for an entry
if (applych.rph.value == "") {
        alert( "Please enter your Residence Phone Number" );
        applych.rph.focus();
        return false ;
    }

//Validates an Email Address Textbox
	if (applych.email.value == "")
	{
	    alert("Please enter your email address.");
		applych.email.focus();
		return (false);
	}			
 			
	var teststr = (applych.email.value);
  	var iserr=false;
	if (!teststr=='')
	{ 
	  // there must be >= 1 character before @, so we
	  // start looking at character position 1 
	  // (i.e. second character)
	var i = 1;
	var sLength = teststr.length;
	  // look for @
	while ((i < sLength) && (teststr.charAt(i) != "@"))
	{ 
	i++;
	}
	if ((i >= sLength) || (teststr.charAt(i) != "@")) 
	{
	iserr=true;
	}
		else 
		{
		 i += 2;
		 // look for "."
		 while ((i < sLength) && (teststr.charAt(i) != "."))
			 { 
				i++;
			 }
		 // there must be at least one character after the "."
		 if ((i >= sLength - 1) || (teststr.charAt(i) != ".")) 
		 	{
			iserr = true;
			}
		}
   }
	   if (iserr)
		 {
		  alert('Please enter a Valid Email Address.');
		  applych.email.focus();
   	      return (false);				  
	     }
	

//Validates high school grad selection - yes/no
if (applych.highschool.value == "Please Select One"){
        alert( "Are you a High School Graduate? Yes/No" );
        applych.highschool.focus();
        return false ;
    }

//Validates college entry
if (applych.college.value == ""){
        alert( "Please Enter Name of College/University, OR, 'N/A'" );
        applych.college.focus();
        return false ;
    }

//Validates courses entry
if (applych.courses.value == ""){
        alert( "Please Enter Name of Courses Completed, OR, 'N/A'" );
        applych.courses.focus();
        return false ;
    }


//Validates medical setting selection - yes/no
if (applych.medical.value == "Please Select One"){
        alert( "Have you worked in a Medical Setting? Yes/No" );
        applych.medical.focus();
        return false ;
    }




//Validates interest selection - own business / work for clinic
if (applych.interest.value == "Please Select One"){
        alert( "Please Select your Business Interest" );
        applych.interest.focus();
        return false ;
    }


//Validates equipment selection - new / used/ none
if (applych.equipment.value == "Please Select One"){
        alert( "Please Select your Equipment Interest" );
        applych.equipment.focus();
        return false ;
    }






//Validates tc Textbox for an blank
if (applych.tc.checked == 0){
        alert( "Please accept the Terms & Conditions" );
        applych.tc.focus();
        return false ;
    }

//Validates signature Textbox for an entry
if (applych.signature.checked == 0){
        alert( "Please Check the Signature Box" );
        applych.signature.focus();
        return false ;
    }

//Validates phone Textbox for an blank
//if (contact.phone.value == "") {
//        alert( "Please enter your Phone Number" );
//        contact.phone.focus();
//        return false ;
//    }


//Validates comment Textbox for an entry
//if (applych.comment.value == "") {
//        alert( "Please enter your Comments" );
//        applych.comment.focus();
//        return false ;
//    }

    // ** END **
	return true ;
}



// Validate waitlist form
function checkwaitlist ( waitlist )
{
    // ** START **

//Validates fname Textbox for an entry
if (waitlist.fname.value == "") {
        alert( "Please enter your First Name" );
        waitlist.fname.focus();
        return false ;
    }


//Validates lname Textbox for an entry
if (waitlist.lname.value == "") {
        alert( "Please enter your Last Name" );
        waitlist.lname.focus();
        return false ;
    }

//Validates phone Textbox for an entry
if (waitlist.phone.value == "(area code first)") {
        alert( "Please enter your Phone Number" );
        waitlist.phone.focus();
        return false ;
    }
	
	

//Validates an Email Address Textbox
	if (waitlist.email.value == "")
	{
	    alert("Please enter your email address.");
		waitlist.email.focus();
		return (false);
	}			
 			
	var teststr = (waitlist.email.value);
  	var iserr=false;
	if (!teststr=='')
	{ 
	  // there must be >= 1 character before @, so we
	  // start looking at character position 1 
	  // (i.e. second character)
	var i = 1;
	var sLength = teststr.length;
	  // look for @
	while ((i < sLength) && (teststr.charAt(i) != "@"))
	{ 
	i++;
	}
	if ((i >= sLength) || (teststr.charAt(i) != "@")) 
	{
	iserr=true;
	}
		else 
		{
		 i += 2;
		 // look for "."
		 while ((i < sLength) && (teststr.charAt(i) != "."))
			 { 
				i++;
			 }
		 // there must be at least one character after the "."
		 if ((i >= sLength - 1) || (teststr.charAt(i) != ".")) 
		 	{
			iserr = true;
			}
		}
   }
	   if (iserr)
		 {
		  alert('Please enter a Valid Email Address.');
		  waitlist.email.focus();
   	      return (false);				  
	     }


if (waitlist.first2.value == "") {
        alert( "Please enter your First Choice" );
        waitlist.first2.focus();
        return false ;
    }
	

if (waitlist.second2.value == "") {
        alert( "Please enter your Second Choice" );
        waitlist.second2.focus();
        return false ;
    }
	

if (waitlist.third2.value == "") {
        alert( "Please enter your Third Choice" );
        waitlist.third2.focus();
        return false ;
    }
	



    // ** END **
	return true ;

}





/***********************************************
* Multi-Part Content script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

if (document.getElementById){
document.write('<style type="text/css">')
document.write('.multiparts, #formnavigation{display:none;}')
document.write('</style>')
}

var curpart=0

function getElementbyClass(classname){
partscollect=new Array()

var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
partscollect[inc++]=alltags[i]
}
}
/*
function cycleforward(){
partscollect[curpart].style.display="none"
curpart=(curpart<partscollect.length-1)? curpart+1 : 0
partscollect[curpart].style.display="block"
updatenav()
}

function cycleback(){
partscollect[curpart].style.display="none"
curpart=(curpart>0)? curpart-1 : partscollect.length-1
partscollect[curpart].style.display="block"
updatenav()
}


function updatenav(){
document.getElementById("backbutton").style.visibility=(curpart==0)? "hidden" : "visible"
document.getElementById("forwardbutton").style.visibility=(curpart==partscollect.length-1)? "hidden" : "visible"
}
*/
function onloadfunct(){
getElementbyClass("multiparts")
//partscollect[0].style.display="block"
//document.getElementById("formnavigation").style.display="block"
//updatenav()
}


if (window.addEventListener)
window.addEventListener("load", onloadfunct, false)
else if (window.attachEvent)
window.attachEvent("onload", onloadfunct)
else if (document.getElementById)
window.onload=onloadfunct



<!--
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_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_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];}
}
//-->



function openpopup(){
var popurl="privacy.htm"
winpops=window.open(popurl,"","left=100,top=50,scrollbars=no, width=520,height=415,")
}

// takes (area code first) out of the phone field on-Focus
function MM_setTextOfTextfield(objName,x,newText) { //v3.0
  var obj = MM_findObj(objName); if (obj) obj.value = newText;
}



		 
// phone validator for contact us page
function phoneFormatC(obj)
{
	newValue = obj.value.replace(/\D/g,'');
	if (newValue.length < 10 || newValue.length > 10)
	{
		newValue = '';
		alert('Please enter a valid phone number.');
		contact.phone.focus();
	}
	if (newValue != '' && newValue.length == 10)
	{
		newValue = "(" + newValue.substring(0,3) + ")" + newValue.substring(3,6) + "-" + 			   newValue.substring(6,10);
	}
	return newValue;
}
// end of phone validator

		 
// phone validator for applych page
function phoneFormatCH(obj)
{
	newValue = obj.value.replace(/\D/g,'');
	if (newValue.length < 10 || newValue.length > 10)
	{
		newValue = '';
		alert('Please enter a valid phone number.');
		applych.rph.focus();
	}
	if (newValue != '' && newValue.length == 10)
	{
		newValue = "(" + newValue.substring(0,3) + ")" + newValue.substring(3,6) + "-" + 			   newValue.substring(6,10);
	}
	return newValue;
}
// end of phone validator

		 
// phone validator for applych page
function phoneFormatM(obj)
{
	newValue = obj.value.replace(/\D/g,'');
	if (newValue.length < 10 || newValue.length > 10)
	{
		newValue = '';
		alert('Please enter a valid phone number.');
		applym.rph.focus();
	}
	if (newValue != '' && newValue.length == 10)
	{
		newValue = "(" + newValue.substring(0,3) + ")" + newValue.substring(3,6) + "-" + 			   newValue.substring(6,10);
	}
	return newValue;
}
// end of phone validator

		 
// phone validator for waitlist page
function phoneFormat(obj)
{
	newValue = obj.value.replace(/\D/g,'');
	if (newValue.length < 10 || newValue.length > 10)
	{
		newValue = '';
		alert('Please enter a valid phone number.');
		waitlist.phone.focus();
	}
	if (newValue != '' && newValue.length == 10)
	{
		newValue = "(" + newValue.substring(0,3) + ")" + newValue.substring(3,6) + "-" + 			   newValue.substring(6,10);
	}
	return newValue;
}
// end of phone validator




