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

//Clear text for quick contact form

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

function clearText(thefield) {

		if (thefield.defaultValue==thefield.value) { thefield.value = "" }

	}

	

function replaceText(thefield) {

		if (thefield.value=="") { thefield.value = thefield.defaultValue }

	}



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

//Form Validation - Main

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

function CheckMainRequiredFields() {



		if (document.main_contact.name.value=='') {

			alert('Your name is required to submit this form.');

			return false;

		}

		

		if (document.main_contact.phone.value=='') {

			alert('Your phone number is required to submit this form.');

			return false;

		}

		

		if (document.main_contact.email.value=='') {

			alert('A valid email address is required to submit this form.');

			return false;

		}

		

		return true;

}



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

//Form Validation - QC

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

function CheckQCRequiredFields() {



		if (document.quick_contact.name.value=='*Name') {

			alert('Your name is required to submit this form.');

			return false;

		}

		

		if (document.quick_contact.phone.value=='*Phone') {

			alert('Your phone number is required to submit this form.');

			return false;

		}

		

		if (document.quick_contact.email.value=='*Email') {

			alert('A valid email address is required to submit this form.');

			return false;

		}

		

		if (document.quick_contact.comments.value=='Comments') {

			alert('A question and / or comment is required to submit this form.');

			return false;

		}

		

		return true;

}



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

//Email Check

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

function emailCheck (emailStr) {

	var checkTLD=1;

	var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;

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

	var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";

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

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

	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;

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



	for (i=0; i<user.length; i++) {

		if (user.charCodeAt(i)>127) {

				alert("Ths username contains invalid characters.");

				return false;

  		}

	}

	

	for (i=0; i<domain.length; i++) {

		if (domain.charCodeAt(i)>127) {

				alert("Ths domain name contains invalid characters.");

				return false;

   		}

	}



	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 atomPat=new RegExp("^" + atom + "$");

	var domArr=domain.split(".");

	var len=domArr.length;



	for (i=0;i<len;i++) {

		if (domArr[i].search(atomPat)==-1) {

			alert("The domain name does not seem to be valid.");

			return false;

  		}

	}



	if (checkTLD && domArr[domArr.length-1].length!=2 && domArr[domArr.length-1].search(knownDomsPat)==-1) {

		alert("The address must end in a well-known domain or two letter " + "country.");

		return false;

	}



	if (len<2) {

		alert("This address is missing a hostname!");

		return false;

	}



	return true;

}



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

//Change font size

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

function ChangeFontSize(id, size)

{

	document.getElementById(id).style.fontSize = size + "px";

}



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

//Open browser window

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

function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);

}



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

//Drop Down Navigation

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

function mmLoadMenus() {

  if (window.mm_menu_1215161622_0) return;

  window.mm_menu_1215161622_0 = new Menu("root",190,19,"Verdana, Arial, Helvetica, sans-serif",12,"#000000","#000000","#FFFFFF","#E7F4F5","left","middle",3,0,70,-5,7,true,true,true,0,true,true);

  mm_menu_1215161622_0.addMenuItem("About&nbsp;Us","location='spa.htm'");

  mm_menu_1215161622_0.addMenuItem("Meet&nbsp;the&nbsp;Doctor","location='meet_doc.htm'");

  mm_menu_1215161622_0.addMenuItem("Meet&nbsp;the&nbsp;Team","location='staff.htm'");

  mm_menu_1215161622_0.addMenuItem("Financing","location='financing.htm'");

	mm_menu_1215161622_0.addMenuItem("Our&nbsp;Dental&nbsp;Blog","location='blog.htm'");

	mm_menu_1215161622_0.addMenuItem("Comprehensive&nbsp;Examination","location='comprehensive-examination.html'");

   mm_menu_1215161622_0.hideOnMouseOut=true;

   mm_menu_1215161622_0.bgColor='#666666';

   mm_menu_1215161622_0.menuBorder=1;

   mm_menu_1215161622_0.menuLiteBgColor='#FFFFFF';

   mm_menu_1215161622_0.menuBorderBgColor='#DCDCDC';



  window.mm_menu_1215161955_0 = new Menu("root",183,19,"Verdana, Arial, Helvetica, sans-serif",12,"#000000","#000000","#FFFFFF","#E7F4F5","left","middle",3,0,70,-5,7,true,true,true,0,true,true);

	mm_menu_1215161955_0.addMenuItem("General&nbsp;Dentistry","location='general_dentistry.htm'");

  mm_menu_1215161955_0.addMenuItem("Porcelain&nbsp;Crowns","location='serv_crowns.htm'");

  mm_menu_1215161955_0.addMenuItem("Porcelain&nbsp;Bridges","location='serv_bridges.htm'");

  mm_menu_1215161955_0.addMenuItem("Bonding","location='serv_bonding.htm'");

  mm_menu_1215161955_0.addMenuItem("Dental&nbsp;Implants","location='serv_implants.htm'");

  mm_menu_1215161955_0.addMenuItem("Sleep&nbsp;Apnea&nbsp;and&nbsp;Snoring","location='sleep-apnea-snoring.html'");

  mm_menu_1215161955_0.addMenuItem("Oral&nbsp;Hygiene","location='serv_hygiene.htm'");

  mm_menu_1215161955_0.addMenuItem("Tooth&nbsp;Colored&nbsp;Fillings","location='serv_fills.htm'");

  mm_menu_1215161955_0.addMenuItem("Porcelain&nbsp;Veneers","location='serv_veneers.htm'");

  mm_menu_1215161955_0.addMenuItem("TMJ&nbsp;Treatment","location='serv_tmj.htm'");

  mm_menu_1215161955_0.addMenuItem("Gum&nbsp;Tissue&nbsp;Contouring","location='serv_gum.htm'");

  mm_menu_1215161955_0.addMenuItem("Orthotic&nbsp;Delivery","location='orthotic-delivery.html'");

  mm_menu_1215161955_0.addMenuItem("Whitening","location='serv_whitening.htm'");

  mm_menu_1215161955_0.addMenuItem("Computer&nbsp;Imaging","location='serv_imaging.htm'");

  mm_menu_1215161955_0.addMenuItem("Pure&nbsp;Power&nbsp;Mouthguard","location='pure-power-mouthguard.html'");

   mm_menu_1215161955_0.hideOnMouseOut=true;

   mm_menu_1215161955_0.bgColor='#666666';

   mm_menu_1215161955_0.menuBorder=1;

   mm_menu_1215161955_0.menuLiteBgColor='#FFFFFF';

   mm_menu_1215161955_0.menuBorderBgColor='#DCDCDC';



  window.mm_menu_1216102920_0 = new Menu("root",280,19,"Verdana, Arial, Helvetica, sans-serif",12,"#000000","#000000","#FFFFFF","#E7F4F5","left","middle",3,0,70,-5,7,true,true,true,0,true,true);

  mm_menu_1216102920_0.addMenuItem("Porcelain&nbsp;Crowns","location='gall_crowns.htm'");

  mm_menu_1216102920_0.addMenuItem("Porcelain&nbsp;Bridges","location='gall_bridges.htm'");

  mm_menu_1216102920_0.addMenuItem("Gum&nbsp;Tissue&nbsp;Contouring","location='gall_gum.htm'");

  mm_menu_1216102920_0.addMenuItem("Porcelain&nbsp;Veneers","location='gall_veneers.htm'");

	mm_menu_1216102920_0.addMenuItem("Tooth&nbsp;Colored&nbsp;Fillings","location='gall_fills.htm'");

  mm_menu_1216102920_0.addMenuItem("Dental&nbsp;Implants","location='gall_implants.htm'");

  mm_menu_1216102920_0.addMenuItem("Teeth&nbsp;Whitening","location='gall_whitening.htm'");

	mm_menu_1216102920_0.addMenuItem("Full&nbsp;Mouth&nbsp;Rejuvenation/Smile&nbsp;Makeovers","location='gall_mouth.htm'");

   mm_menu_1216102920_0.hideOnMouseOut=true;

   mm_menu_1216102920_0.bgColor='#666666';

   mm_menu_1216102920_0.menuBorder=1;

   mm_menu_1216102920_0.menuLiteBgColor='#FFFFFF';

   mm_menu_1216102920_0.menuBorderBgColor='#DCDCDC';

   

   window.mm_menu_1216103921_0 = new Menu("root",200,19,"Verdana, Arial, Helvetica, sans-serif",12,"#000000","#000000","#FFFFFF","#E7F4F5","left","middle",3,0,70,-5,7,true,true,true,0,true,true);

  mm_menu_1216103921_0.addMenuItem("Cosmetic&nbsp;Dentistry&nbsp;Questions","location='dental-questions.html'");

  mm_menu_1216103921_0.addMenuItem("Dental&nbsp;Hygene&nbsp;Questions","location='dental-hygene-questions.html'");

  mm_menu_1216103921_0.addMenuItem("Sleep&nbsp;Apnea&nbsp;Questions","location='sleep-apnea-faq.html'");

  mm_menu_1216103921_0.addMenuItem("Dental&nbsp;Implants&nbsp;Questions","location='dental-implants-questions.html'");

   mm_menu_1216103921_0.hideOnMouseOut=true;

   mm_menu_1216103921_0.bgColor='#666666';

   mm_menu_1216103921_0.menuBorder=1;

   mm_menu_1216103921_0.menuLiteBgColor='#FFFFFF';

   mm_menu_1216103921_0.menuBorderBgColor='#DCDCDC';



mm_menu_1216102920_0.writeMenus();

} // mmLoadMenus()