<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

MDMG_menusection = new Array();

MDMG_MovabilityOfSubMenuPositions = "static";

MDMG_menusection[1] = "SMenu1";
MDMG_menusection[2] = "SMenu2";
MDMG_menusection[3] = "SMenu3";
MDMG_menusection[4] = "SMenu4";
MDMG_menusection[5] = "SMenu5";

MDMG_menusection[0] = "unused";
MDMG_menusectionprinted = new Array();
for(i = 0; i < MDMG_menusection.length; i++) { MDMG_menusectionprinted[i] = false; }
bNS4 = bNS6 = bIE = bOPERA = false;
if     (navigator.userAgent.indexOf("Opera") != -1) { bOPERA = true; }
else if(navigator.userAgent.indexOf("Gecko") != -1) { bNS6 = true;   }
else if(document.layers)                            { bNS4 = true;   }
else if(document.all)                               { bIE = true;    }

MDMGx = MDMGxx = MDMGy = MDMGyy = 0;
var MDMG_mousex;
var MDMG_mousey;
STO = null;
if(bNS4 || bNS6 || bOPERA) { document.captureEvents(Event.MOUSEMOVE); }
document.onmousemove = MDMG_getmouseposition;

// Functions used by all browsers
function MDMG_getmouseposition(e){
if(bIE || bOPERA) { 
	MDMG_mousex = event.clientX;
	MDMG_mousey = event.clientY;
	}
else if(bNS6 || bNS4) {
	MDMG_mousex = e.pageX;
	MDMG_mousey = e.pageY;
	}
} // MDMG_getmouseposition()

function MDMG_HideIfOutsideRectangle()
{
	if(MDMG_mouseinrectangle()) { STO = setTimeout('MDMG_HideIfOutsideRectangle()',4000); }
	else { clearTimeout(STO); MDMG_hideallmenusections(); }
} // MDMG_HideIfOutsideRectangle()

function MDMG_mouseinrectangle() 
{
if(MDMG_mousex >= MDMGx && MDMG_mousex <= MDMGxx && MDMG_mousey >= MDMGy && MDMG_mousey <= MDMGyy) { return true; }
else { return false; }
} // MDMG_mouseinrectangle()

// Functions to relay browser type to custom functions
function MDMG_showsection(m_section) {
clearTimeout(STO);
if(bIE) {
	MDMG_bIE_hideallmenusections();
	MDMG_bIE_showit(m_section);
	}
else if(bNS6) {
	MDMG_bNS6_hideallmenusections();
	MDMG_bNS6_showit(m_section);
	}
else if(bOPERA) {
	MDMG_bOPERA_hideallmenusections();
	MDMG_bOPERA_showit(m_section);
	}
else if(bNS4) {
	MDMG_bNS4_hideallmenusections();
	MDMG_bNS4_showit(m_section);
	}
} // MDMG_showsection()

function MDMG_hideallmenusections() {
clearTimeout(STO);
if(bIE) { MDMG_bIE_hideallmenusections(); }
else if(bNS6) { MDMG_bNS6_hideallmenusections(); }
else if(bOPERA) { MDMG_bOPERA_hideallmenusections(); }
else if(bNS4) { MDMG_bNS4_hideallmenusections(); }
} // MDMG_hideallmenusections()

// IE functions
function MDMG_bIE_hidesection(m_section) {
if(MDMG_mouseinrectangle()) { return; }
eval(MDMG_menusection[m_section] + '.style.visibility="hidden"');
MDMG_menusectionprinted[m_section] = false;
} // MDMG_bIE_hidesection()

function MDMG_bIE_hideallmenusections() {
for(i = 1; i < MDMG_menusection.length; i++) { 
	eval(MDMG_menusection[i] + '.style.visibility="hidden"');
	MDMG_menusectionprinted[i] = false;
	}
} // MDMG_bIE_hideallmenusections()

function MDMG_bIE_showit(m_section) {
	if(MDMG_menusectionprinted[m_section] == true) { return; }
	clearTimeout(STO);
	MDMG_bIE_hideallmenusections();
	MDMG_menusectionprinted[m_section] = true;
	var x = MDMG_mousex - 1;
	if(x < 0) { x = 0; }
	var y = MDMG_mousey - 1;
	if(y < 0) { y = 0; }
	if(MDMG_MovabilityOfSubMenuPositions != "static") {
		eval(MDMG_menusection[m_section] + '.style.left="' + x + '"');
		eval(MDMG_menusection[m_section] + '.style.top="' + y + '"');
		}
	eval(MDMG_menusection[m_section] + '.style.visibility="visible"');
	MDMGx = eval(MDMG_menusection[m_section] + '.style.pixelLeft');
	MDMGxx = eval(MDMG_menusection[m_section] + '.scrollWidth') + MDMGx;
	MDMGy = eval(MDMG_menusection[m_section] + '.style.pixelTop');
	MDMGyy = eval(MDMG_menusection[m_section] + '.scrollHeight') + MDMGy;
	STO = setTimeout('MDMG_HideIfOutsideRectangle()',4000);
} // MDMG_bIE_showit()

// Netscape 6 functions
function MDMG_bNS6_hidesection(m_section) {
if(MDMG_mouseinrectangle()) { return; }
document.getElementById(MDMG_menusection[m_section]).style.visibility="hidden";
MDMG_menusectionprinted[m_section] = false;
} // MDMG_bNS6_hidesection()

function MDMG_bNS6_hideallmenusections() {
for(i = 1; i < MDMG_menusection.length; i++) { 
	document.getElementById(MDMG_menusection[i]).style.visibility="hidden";
	MDMG_menusectionprinted[i] = false;
	}
} // MDMG_bNS6_hideallmenusections()

function MDMG_bNS6_showit(m_section) {
	if(MDMG_menusectionprinted[m_section] == true) { return; }
	clearTimeout(STO);
	MDMG_bNS6_hideallmenusections();
	MDMG_menusectionprinted[m_section] = true;
	var x = MDMG_mousex - 1;
	if(x < 0) { x = 0; }
	var y = MDMG_mousey - 1;
	if(y < 0) { y = 0; }
	if(MDMG_MovabilityOfSubMenuPositions != "static") {
		document.getElementById(MDMG_menusection[m_section]).style.left = x + 'px';
		document.getElementById(MDMG_menusection[m_section]).style.top = y + 'px';
		}
	document.getElementById(MDMG_menusection[m_section]).style.visibility="visible";
	var padding = 0;
	if(parseInt(document.getElementById(MDMG_menusection[m_section]).style.padding) > 0) { padding = parseInt(document.getElementById(MDMG_menusection[m_section]).style.padding) * 2; }
	MDMGx = parseInt(document.getElementById(MDMG_menusection[m_section]).style.left);
	MDMGxx = parseInt(document.getElementById(MDMG_menusection[m_section]).style.width) + MDMGx + padding;
	MDMGy = parseInt(document.getElementById(MDMG_menusection[m_section]).style.top);
	MDMGyy = parseInt(document.getElementById(MDMG_menusection[m_section]).style.height) + MDMGy + padding;
	STO = setTimeout('MDMG_HideIfOutsideRectangle()',4000);
} // MDMG_bNS6_showit()

// Opera 5 and Opera 6 functions
function MDMG_bOPERA_hidesection(m_section) {
if(MDMG_mouseinrectangle()) { return; }
document.getElementById(MDMG_menusection[m_section]).style.visibility="hidden";
MDMG_menusectionprinted[m_section] = false;
} // MDMG_bOPERA_hidesection()

function MDMG_bOPERA_hideallmenusections() {
for(i = 1; i < MDMG_menusection.length; i++) { 
	document.getElementById(MDMG_menusection[i]).style.visibility="hidden";
	MDMG_menusectionprinted[i] = false;
	}
} // MDMG_bOPERA_hideallmenusections()

function MDMG_bOPERA_showit(m_section) {
	if(MDMG_menusectionprinted[m_section] == true) { return; }
	clearTimeout(STO);
	MDMG_bOPERA_hideallmenusections();
	MDMG_menusectionprinted[m_section] = true;
	var x = MDMG_mousex - 1;
	if(x < 0) { x = 0; }
	var y = MDMG_mousey - 1;
	if(y < 0) { y = 0; }
	if(MDMG_MovabilityOfSubMenuPositions != "static") {
		document.getElementById(MDMG_menusection[m_section]).style.left = x + 'px';
		document.getElementById(MDMG_menusection[m_section]).style.top = y + 'px';
		}
	document.getElementById(MDMG_menusection[m_section]).style.visibility="visible";
	var padding = 0;
	if(parseInt(document.getElementById(MDMG_menusection[m_section]).style.padding) > 0) { padding = parseInt(document.getElementById(MDMG_menusection[m_section]).style.padding) * 2; }
	MDMGx = parseInt(document.getElementById(MDMG_menusection[m_section]).style.left);
	MDMGxx = parseInt(document.getElementById(MDMG_menusection[m_section]).style.width) + MDMGx + padding;
	MDMGy = parseInt(document.getElementById(MDMG_menusection[m_section]).style.top);
	MDMGyy = parseInt(document.getElementById(MDMG_menusection[m_section]).style.height) + MDMGy + padding;
	STO = setTimeout('MDMG_HideIfOutsideRectangle()',4000);
} // MDMG_bOPERA_showit()

// Netscape 4 functions
function MDMG_bNS4_hidesection(m_section) {
if(MDMG_mouseinrectangle()) { return; }
eval('document.' + MDMG_menusection[m_section] + '.visibility="hide"');
MDMG_menusectionprinted[m_section] = false;
} // MDMG_bNS4_hidesection()

function MDMG_bNS4_hideallmenusections() {
for(i = 1; i < MDMG_menusection.length; i++) { 
	eval('document.' + MDMG_menusection[i] + '.visibility="hide"');
	MDMG_menusectionprinted[i] = false;
	}
} // MDMG_bNS4_hideallmenusections()

function MDMG_bNS4_showit(m_section) {
	if(MDMG_menusectionprinted[m_section] == true) { return; }
	clearTimeout(STO);
	MDMG_bNS4_hideallmenusections();
	MDMG_menusectionprinted[m_section] = true;
	var x = MDMG_mousex - 1;
	if(x < 0) { x = 0; }
	var y = MDMG_mousey - 1;
	if(y < 0) { y = 0; }
	if(MDMG_MovabilityOfSubMenuPositions != "static") {
		eval('document.' + MDMG_menusection[m_section] + '.left="' + x + '"');
		eval('document.' + MDMG_menusection[m_section] + '.top="' + y + '"');
		}
	eval('document.' + MDMG_menusection[m_section] + '.visibility="show"');
	MDMGx = eval('parseInt(document.' + MDMG_menusection[m_section] + '.left)');
	MDMGxx = eval('parseInt(document.' + MDMG_menusection[m_section] + '.clip.width)') + MDMGx;
	MDMGy = eval('parseInt(document.' + MDMG_menusection[m_section] + '.top)');
	MDMGyy = eval('parseInt(document.' + MDMG_menusection[m_section] + '.clip.height)') + MDMGy;
	STO = setTimeout('MDMG_HideIfOutsideRectangle()',4000);
} // MDMG_bNS4_showit()

//-->


// Office Tour
function movie01Get() {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="325" height="350" align="right"><param name="movie" value="office_tour.swf"><param name="quality" value="high"><embed src="office_tour.swf" width="325" height="350" align="right" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object>');
}
// About Page Video
function movie02Get() {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="360" height="240"><param name="movie" value="Video/makeover.swf"><param name="quality" value="high"><embed src="Video/makeover.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="360" height="240"></embed></object>');
}
// Home Page Video
function movie03Get() {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="742" height="219"><param name="movie" value="http://www.allnewsmiles.com/bern_intro.swf"><param name="quality" value="high"><embed src="http://www.allnewsmiles.com/bern_intro.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="742" height="219"></embed></object>');
}
// Index Page Video
function movie04Get() {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="742" height="219"><param name="movie" value="bern_intro.swf"><param name="quality" value="high"><embed src="bern_intro.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="742" height="219"></embed></object>');
}
// Links Page Video
function movie05Get() {
	document.write('<object CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" WIDTH="742" HEIGHT="219"><param NAME="movie" VALUE="bern_intro.swf"><param NAME="quality" VALUE="high"><embed SRC="bern_intro.swf" QUALITY="high" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" TYPE="application/x-shockwave-flash" WIDTH="742" HEIGHT="219"></embed></object>');
}
// New Patient Form Page Video
function movie06Get() {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="742" height="219"><param name="movie" value="bern_intro.swf"><param name="quality" value="high"><embed src="bern_intro.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="742" height="219"></embed></object>');
}
// Sitemap Page Video
function movie07Get() {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="742" height="219"><param name="movie" value="bern_intro.swf"><param name="quality" value="high"><embed src="bern_intro.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="742" height="219"></embed></object>');
}
// Blog
function movie08Get() {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="742" height="219"><param name="movie" value="http://www.allnewsmiles.com/bern_intro.swf"><param name="quality" value="high"><embed src="http://www.allnewsmiles.com/bern_intro.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="742" height="219"></embed></object>');
}
//this is the form validator and other elements for the mini contact form
function clearText(thefield) {
  if (thefield.defaultValue==thefield.value) { thefield.value = "" }
}

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