// 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 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 Textbox for an entry
if (contact.phone.value == "(area code first)") {
        alert( "Please enter your Phone Number" );
        contact.phone.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 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 == "") {
        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 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 ;
    }


    // ** 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 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 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 ;
    }

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



    // ** 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,")
}


function openpopup1(){
var popurl="waiting-list.htm"
winpops=window.open(popurl,"","left=100,top=50,scrollbars=no, width=570,height=570,")
}


// 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 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



