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_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

function MM_setTextOfLayer(objName,x,newText) { //v4.01
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}

function toggle(divID,imgID){
	var div1 = document.getElementById(divID);
	var img1 = document.getElementById(imgID);
	if (div1.style.display == 'none') {
		div1.style.display = 'block';
		img1.src = "media/images/minus.png";
	} else {
		div1.style.display = 'none';
		img1.src = "media/images/plus.png";		
	}
}


function OpenWindowInCenter1(urls) { 
	var iMyWidth; 
	var iMyHeight; 
	iMyWidth = (window.screen.width/2) - (800 + 10); //half the screen width minus half the new window width (plus 5 pixel borders). 
	iMyHeight = (window.screen.height/2) - (800 + 50); //half the screen height minus half the new window height (plus title and status bars). 
	window.open(urls,"newwin","status,height=800,width=800,resizable=yes,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=yes,toolbar=yes,menubar=yes,location=yes"); 
}

function OpenWindowInCenter2(urls) { 
	var iMyWidth; 
	var iMyHeight; 
	iMyWidth = (window.screen.width/2) - (800 + 10); //half the screen width minus half the new window width (plus 5 pixel borders). 
	iMyHeight = (window.screen.height/2) - (800 + 50); //half the screen height minus half the new window height (plus title and status bars). 
	window.open(urls,"newwin","status,height=800,width=800,resizable=yes,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=yes,toolbar=yes,menubar=yes,location=yes"); 
}

function OpenWindowInCenter3(urls) { 
	var iMyWidth; 
	var iMyHeight; 
	iMyWidth = (window.screen.width/2) - (800 + 10); //half the screen width minus half the new window width (plus 5 pixel borders). 
	iMyHeight = (window.screen.height/2) - (800 + 50); //half the screen height minus half the new window height (plus title and status bars). 
	window.open(urls,"newwin","status,height=800,width=800,resizable=yes,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=yes,toolbar=no,menubar=no,location=no"); 
}

function LoadHeader(){
	var header_html = "<table class='links' cellpadding='0' cellspacing='0'>";
	header_html += "<tr><td id='todaydate' align='right' width=975 height=90 style='color:white;background-image:url(media/images/banner.gif);vertical-align:bottom'></td></tr>";
	header_html += "<tr><td>";
	header_html += "<div id='todaydates' align='right'></div>";
	header_html += "</td></tr>";
	header_html += "</table>";
	var headerObj = MM_findObj('header');
	headerObj.innerHTML = header_html;
}

function LoadFooter(){
	var footer_html = "<table width='975' class='links' cellpadding='5' cellspacing='0'>";
	footer_html += "<tr><td colspan='8' style='background-color:#4A3900;color:white'>2655 Dallas Hwy SW, Suite 340 (next to Target) Marietta, GA 30064 Phone: 678-797-9800</td></tr>";
	footer_html += "<tr align='center'>";
	footer_html += "<td>© 2009 Cobb Internal Medicine P.C.</td>";
	footer_html += "</tr>";
	footer_html += "</table>";	
	var footerObj = MM_findObj('footer');
	footerObj.innerHTML = footer_html;
}

function LoadMenuBar(){
	var menu_bar_html = "<table width='100%' class='links' cellpadding='0' cellspacing='0' border='0' style='text-align:right;'>";
	menu_bar_html += "<tr><td style='background-color:#4A3900' align='center'><img src='media/images/steth.jpg' border='0'></td></tr>";
	menu_bar_html += "<tr><td style='background-color:#4A3900'>&nbsp;</td></tr>";
	menu_bar_html += "<tr><td class='menu'><a href='index.htm' class='menu' title='Home' onmouseover='MM_displayStatusMsg(\"Home\");return document.MM_returnValue' onmouseout='MM_displayStatusMsg(\"Cobb Internal Medicine\");return document.MM_returnValue'>Home</a></td></tr>";
	menu_bar_html += "<tr><td><hr style='color:#4A3900'></td></tr>";
	menu_bar_html += "<tr><td class='menu1'>&nbsp;&nbsp;<a href='aboutus.htm' class='menu1' title='About Us' onmouseover='MM_displayStatusMsg(\"About Us\");return document.MM_returnValue' onmouseout='MM_displayStatusMsg(\"Cobb Internal Medicine\");return document.MM_returnValue'>About Us</a></td></tr>";
	menu_bar_html += "<tr><td class='menu1'>&nbsp;&nbsp;<a href='location.htm' class='menu1' title='Location' onmouseover='MM_displayStatusMsg(\"location\");return document.MM_returnValue' onmouseout='MM_displayStatusMsg(\"Cobb Internal Medicine\");return document.MM_returnValue'>Location</a></td></tr>";
	menu_bar_html += "<tr><td class='menu1'>&nbsp;&nbsp;<a href='contactus.htm' class='menu1' title='Contact Us' onmouseover='MM_displayStatusMsg(\"Contact Us\");return document.MM_returnValue' onmouseout='MM_displayStatusMsg(\"Cobb Internal Medicine\");return document.MM_returnValue'>Contact Us</a></td></tr>";
	menu_bar_html += "<tr><td><hr style='color:#4A3900'></td></tr>";
	menu_bar_html += "<tr><td class='menu'>Services</td></tr>";
	menu_bar_html += "<tr><td class='menu1'>&nbsp;&nbsp;<a href='appointments.htm' class='menu1' title='Appointments' onmouseover='MM_displayStatusMsg(\"Appointments\");return document.MM_returnValue' onmouseout='MM_displayStatusMsg(\"Cobb Internal Medicine\");return document.MM_returnValue'>Appointments</a></td></tr>";
	menu_bar_html += "<tr><td class='menu1'>&nbsp;&nbsp;<a href='services_offered.htm' class='menu1' title='Services offered' onmouseover='MM_displayStatusMsg(\"Services offered\");return document.MM_returnValue' onmouseout='MM_displayStatusMsg(\"Cobb Internal Medicine\");return document.MM_returnValue'>Services offered</a></td></tr>";
	//menu_bar_html += "<tr><td class='menu1'>&nbsp;&nbsp;<a href='personal_care.htm' class='menu1' title='Personalized Care' onmouseover='MM_displayStatusMsg(\"Personalized Care\");return document.MM_returnValue' onmouseout='MM_displayStatusMsg(\"Cobb Internal Medicine\");return document.MM_returnValue'>Personalized Care</a></td></tr>";	
	menu_bar_html += "<tr><td><hr style='color:#4A3900'></td></tr>";	
	menu_bar_html += "<tr><td class='menu'>Portal</td></tr>";
	menu_bar_html += "<tr><td class='menu1'>&nbsp;&nbsp;<a href='https://mycw3.eclinicalweb.com/cobb/jsp/login.jsp' target='_blank' class='menu1' title='Patient Portal' onmouseover='MM_displayStatusMsg(\"Patient Portal\");return document.MM_returnValue' onmouseout='MM_displayStatusMsg(\"Cobb Internal Medicine\");return document.MM_returnValue'>Patient Portal</a></td></tr>";
	menu_bar_html += "<tr><td class='menu1'>&nbsp;&nbsp;<a href='patient_portal_faq.htm' class='menu1' title='Patient Portal FAQ' onmouseover='MM_displayStatusMsg(\"Patient Portal FAQ\");return document.MM_returnValue' onmouseout='MM_displayStatusMsg(\"Cobb Internal Medicine\");return document.MM_returnValue'>Patient Portal FAQ</a></td></tr>";
	menu_bar_html += "</table>";
	//alert(menu_bar_html);
  var menuBarObj = MM_findObj('menu_bar');
  menuBarObj.innerHTML = menu_bar_html;
}	

function LoadMap(){
	map_cell_html = '<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=2655+Dallas+Hwy+SW,+Suite+340+Marietta,+GA+30064&amp;sll=33.966827,-84.443522&amp;sspn=0.216402,0.348816&amp;ie=UTF8&amp;s=AARTsJpRbRT3q9jlaDTXMiUTe2iprlkxeA&amp;ll=33.954609,-84.625711&amp;spn=0.024918,0.036564&amp;z=14&amp;iwloc=addr&amp;output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=2655+Dallas+Hwy+SW,+Suite+340+Marietta,+GA+30064&amp;sll=33.966827,-84.443522&amp;sspn=0.216402,0.348816&amp;ie=UTF8&amp;ll=33.954609,-84.625711&amp;spn=0.024918,0.036564&amp;z=14&amp;iwloc=addr" style="color:#0000FF;text-align:left">View Larger Map</a></small>';
  var mapCellObj = MM_findObj('map');
  mapCellObj.innerHTML = map_cell_html;
}