// Drop Down
function mmLoadMenus() {
if (window.mm_menu_1116110044_0) return;
window.mm_menu_1116110044_0 = new Menu("root",142,22,"Arial, Helvetica, sans-serif",12,"#705F48","#FFFFFF","#F3F0E9","#BF7F36","left","middle",4,0,1000,-5,7,true,false,true,0,true,false);
mm_menu_1116110044_0.addMenuItem("Our&nbsp;Office","location='our_office.html'");
mm_menu_1116110044_0.addMenuItem("About&nbsp;Dr.&nbsp;Patel","location='about_patel.html'");
mm_menu_1116110044_0.addMenuItem("Financing","location='affordable_care.html'");
mm_menu_1116110044_0.hideOnMouseOut=true;
mm_menu_1116110044_0.bgColor='#555555';
mm_menu_1116110044_0.menuBorder=1;
mm_menu_1116110044_0.menuLiteBgColor='#FFFFFF';
mm_menu_1116110044_0.menuBorderBgColor='#777777';

window.mm_menu_1116141521_0 = new Menu("root",224,22,"Arial, Helvetica, sans-serif",12,"#705F48","#FFFFFF","#F3F0E9","#BF7F36","left","middle",4,0,1000,-5,7,true,false,true,0,true,false);
mm_menu_1116141521_0.addMenuItem("Smile&nbsp;Solutions","location='smile_solutions.html'");
mm_menu_1116141521_0.addMenuItem("Choosing&nbsp;a&nbsp;Cosmetic&nbsp;Dentist","location='choosing_cosmetic_dentist.html'");
mm_menu_1116141521_0.addMenuItem("Common&nbsp;Patient&nbsp;Questions","location='faq.html'");
mm_menu_1116141521_0.addMenuItem("Sedation&nbsp;Dentistry","location='dental_anxiety.html'");
mm_menu_1116141521_0.addMenuItem("Dental&nbsp;Resources","location='dental_resources.html'");
mm_menu_1116141521_0.addMenuItem("New&nbsp;Patient&nbsp;Forms","location='new_patient_forms.html'");
mm_menu_1116141521_0.hideOnMouseOut=true;
mm_menu_1116141521_0.bgColor='#555555';
mm_menu_1116141521_0.menuBorder=1;
mm_menu_1116141521_0.menuLiteBgColor='#FFFFFF';
mm_menu_1116141521_0.menuBorderBgColor='#777777';

mm_menu_1116141521_0.writeMenus();
} // mmLoadMenus()



// form functions begin
function clearText(thefield) {
  if (thefield.defaultValue==thefield.value) { thefield.value = "" }
}

function replaceText(thefield) {
  if (thefield.value=="") { thefield.value = thefield.defaultValue }
}
// quick contact
function CheckRequiredFieldsQc() {

		if (document.qcForm.name.value=='') {
			alert('Your name is required to use this form.');
			return false;
		}
		else if (document.qcForm.name.value=='* Name') {
			alert('Your name is required to use this form.');
			return false;
		}

		if (document.qcForm.phone.value=='') {
			alert('Your phone number is required to use this form.');
			return false;
		}
		else if (document.qcForm.phone.value=='* Phone') {
			alert('Your phone number is required to use this form.');
			return false;
		}

		if (document.qcForm.email.value=='') {
			alert('A valid email address is required to use this form.');
			return false;
		}
		else if (document.qcForm.email.value=='* Email') {
			alert('A valid email address is required to use this form.');
			return false;
		}

		return true;
}
// contact form
function CheckRequiredFields() {

		if (document.contact.name.value=='') {
			alert('Your name is required to use this form.');
			return false;
		}

		if (document.contact.name.value=='* Name') {
			alert('Your name is required to use this form.');
			return false;
		}

		if (document.contact.phone.value=='') {
			alert('Your phone number is required to use this form.');
			return false;
		}

		if (document.contact.phone.value=='* Phone') {
			alert('Your phone number is required to use this form.');
			return false;
		}

		if (document.contact.email.value=='') {
			alert('A valid email address is required to use 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;}
// form functions end

// Drop Down
/***********************************************
* Switch Content script II- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use. Last updated April 2nd, 2005.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var enablepersist="off" //Enable saving state of content structure using session cookies? (on/off)
var memoryduration="0" //persistence in # of days

var contractsymbol='images/minus.jpg' //Path to image to represent contract state.
var expandsymbol='images/plus.jpg' //Path to image to represent expand state.

/////No need to edit beyond here //////////////////////////

function getElementbyClass(rootobj, classname){
var temparray=new Array()
var inc=0
var rootlength=rootobj.length
for (i=0; i<rootlength; i++){
if (rootobj[i].className==classname)
temparray[inc++]=rootobj[i]
}
return temparray
}

function sweeptoggle(ec){
var inc=0
while (ccollect[inc]){
ccollect[inc].style.display=(ec=="contract")? "none" : ""
inc++
}
revivestatus()
}


function expandcontent(curobj, cid){
if (ccollect.length>0){
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="none")? "none" : ""
curobj.src=(document.getElementById(cid).style.display=="none")? expandsymbol : contractsymbol
}
}

function revivecontent(){
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="none"
}

function revivestatus(){
var inc=0
while (statecollect[inc]){
if (ccollect[inc].style.display=="none")
statecollect[inc].src=expandsymbol
else
statecollect[inc].src=contractsymbol
inc++
}
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}

function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="none")
selectedItem+=ccollect[inc].id+"|"
inc++
}
if (get_cookie(window.location.pathname)!=selectedItem){ //only update cookie if current states differ from cookie's
var expireDate = new Date()
expireDate.setDate(expireDate.getDate()+parseInt(memoryduration))
document.cookie = window.location.pathname+"="+selectedItem+";path=/;expires=" + expireDate.toGMTString()
}
}

function do_onload(){
uniqueidn=window.location.pathname+"firsttimeload"
var alltags=document.all? document.all : document.getElementsByTagName("*")
ccollect=getElementbyClass(alltags, "switchcontent")
statecollect=getElementbyClass(alltags, "showstate")
if (enablepersist=="on" && get_cookie(window.location.pathname)!="" && ccollect.length>0)
revivecontent()
if (ccollect.length>0 && statecollect.length>0)
revivestatus()
}

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

if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate