
function writeHeader()
{	
	var sHtml = "<tr><td colspan=5><img src=\"images/logo.jpg\" alt=\"Ripley Greene Chiropractic Wellness Center, Walpole, MA\" width=\"785\" height=\"135\" border=\"0\"></td></tr>";
	sHtml += "<tr>";
	sHtml += "<td rowspan=99><img src=\"images/spacer.gif\" alt=\"\" width=\"34\" height=\"1\" border=\"0\"></td>";
	sHtml += "<td><img src=\"images/menu_top.jpg\" alt=\"\" width=\"175\" height=\"32\" border=\"0\"></td>";
	sHtml += "<td rowspan=99><img src=\"images/spacer.gif\" alt=\"\" width=\"20\" height=\"1\" border=\"0\"></td>";
	sHtml += "<td><img src=\"images/spacer.gif\" alt=\"\" width=\"536\" height=\"1\" border=\"0\"></td>";
	sHtml += "<td rowspan=99><img src=\"images/spacer.gif\" alt=\"\" width=\"20\" height=\"1\" border=\"0\"></td>";
	sHtml += "</tr>";
	
	document.write(sHtml);
}

function writeFooter(bWhite)
{	document.write("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\">");
	document.write("<tr><td><img src=\"images/spacer.gif\" alt=\"\" width=\"1\" height=\"60\" border=\"0\"></td></tr>");
	document.write("<tr>");
	document.write("<td>");
	
	document.write("<a href=\"index.html\" class=\"footer\">Home</a><span class=\"footer\">&nbsp;|&nbsp;</span>");
	document.write("<a href=\"services.html\" class=\"footer\">Services</a><span class=\"footer\">&nbsp;|&nbsp;</span>");
	document.write("<a href=\"staff.html\" class=\"footer\">Meet Our Staff</a><span class=\"footer\">&nbsp;|&nbsp;</span>");
	document.write("<a href=\"directions.html\" class=\"footer\">Directions</a>");
	
	document.write("</td>");
	document.write("</tr>");
	document.write("<tr><td><img src=\"images/spacer.gif\" alt=\"\" width=\"1\" height=\"60\" border=\"0\"></td></tr>");
	document.write("</table>");
}

function writeNavigation()
{
	var sHtml = "<table height=\"100%\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
	sHtml += "<tr><td colspan=\"2\" valign=\"top\"><a href=\"index.html\" onmouseover=\"MM_swapImage('home','','images/menu_home_over.jpg',1);\" onmouseout=\"MM_swapImgRestore();\")><img id=\"home\" name=\"home\" src=\"images/menu_home.jpg\" alt=\"Home\" width=\"175\" height=\"70\" border=\"0\"></a></td></tr>";
	sHtml += "<tr><td colspan=\"2\" valign=\"top\"><a href=\"services.html\" onmouseover=\"MM_swapImage('services','','images/menu_services_over.jpg',1);\" onmouseout=\"MM_swapImgRestore();\")><img id=\"services\" name=\"services\" src=\"images/menu_services.jpg\" alt=\"Services\" width=\"175\" height=\"70\" border=\"0\"></a></td></tr>";
	sHtml += "<tr><td colspan=\"2\" valign=\"top\"><a href=\"staff.html\" onmouseover=\"MM_swapImage('staff','','images/menu_staff_over.jpg',1);\" onmouseout=\"MM_swapImgRestore();\")><img id=\"staff\" name=\"staff\" src=\"images/menu_staff.jpg\" alt=\"Our Staff\" width=\"175\" height=\"70\" border=\"0\"></a></td></tr>";
	sHtml += "<tr><td colspan=\"2\" valign=\"top\"><a href=\"directions.html\" onmouseover=\"MM_swapImage('directions','','images/menu_directions_over.jpg',1);\" onmouseout=\"MM_swapImgRestore();\")><img id=\"directions\" name=\"directions\" src=\"images/menu_directions.jpg\" alt=\"Directions\" width=\"175\" height=\"100\" border=\"0\"></a></td></tr>";
	sHtml += "<tr>";
	sHtml += "<td width=\"59\" bgcolor=\"#66619A\"><img src=\"images/spacer.gif\" alt=\"\" width=\"59\" height=\"20\" border=\"0\"></td>";
	sHtml += "<td width=\"116\" height=\"100%\"><img src=\"images/spacer.gif\" alt=\"\" width=\"1\" height=\"1\" border=\"0\"></td>";
	sHtml += "</tr>";
	sHtml += "<tr><td colspan=\"2\" height=\"100%\"><img src=\"images/spacer.gif\" alt=\"\" width=\"1\" height=\"20\" border=\"0\"></td></tr>";
	sHtml += "</table>";
	
	document.write(sHtml);
}

function writeTools()
{	document.write("<table align=\"right\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
	document.write("<tr><td colspan=\"6\"><img src=\"images/spacer.gif\" alt=\"\" width=\"1\" height=\"10\" border=\"0\"></td></tr>");
	document.write("<tr>");
	document.write("<td><a href=\"#\" class=\"tools\">Contact Us</a></td>");
	document.write("<td class=\"footer\">&nbsp;|&nbsp;</td>");
	document.write("<td><a href=\"#\" class=\"tools\">About Us</a></td>");
	//spacer from end of page
	document.write("<td><img src=\"images/spacer.gif\" alt=\"\" width=\"10\" height=\"1\" border=\"0\">");
	document.write("</tr>");
	document.write("</table>");
}

//====================================================
//change the menu state
//====================================================
function changeMenuState(oObject, sBGColor, sTextColor)
{	oObject.style.backgroundColor = sBGColor;
	oObject.style.color = sTextColor;
}

//====================================================
//change the background image of an object
//====================================================
function changeBGImage(oObject , sImageSrc)
{	oObject.style.backgroundImage = sImageSrc;
}

//====================================================
//change the background color of an object
//====================================================
function changeBGColor(oObject , sTextColor)
{	oObject.style.color = sTextColor;
}


function MM_findObj(n, d) 
{	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); return x;
}

function MM_swapImage() 
{	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 MM_swapImgRestore() 
{	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_preloadImages() 
{	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];}}
}
