function clientSideInclude(id, url) {
  var req = false;
  // For Safari, Firefox, and other non-MS browsers
  if (window.XMLHttpRequest) {
    try {
      req = new XMLHttpRequest();
    } catch (e) {
      req = false;
    }
  } else if (window.ActiveXObject) {
    // For Internet Explorer on Windows
    try {
      req = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        req = false;
      }
    }
  }
 var element = document.getElementById(id);
 if (!element) {
  alert("Bad id " + id + 
   " passed to clientSideInclude." +
   "You need a div or span element " +
   "with this id in your page.");
  return;
 }
  if (req) {
    // Synchronous request, wait till we have it all
    req.open('GET', url, false);
    req.send(null);
    element.innerHTML = req.responseText;
  } else {
    element.innerHTML =
   "Sorry, your browser does not support " +
      "XMLHTTPRequest objects. This page requires " +
      "Internet Explorer 5 or better for Windows, " +
      "or Firefox for any system, or Safari. Other " +
      "compatible browsers may also exist.";
  }
}


function loadHeaderAndFooter()
{
	var browser=navigator.appName;
	ieCheck = browser.indexOf("Internet Explorer");
	thisPage = document.location.href;
	paCheck = thisPage.indexOf("practice_areas");
	clientSideInclude('includeHeader', 'header.html');
	clientSideInclude('includeFooter', 'footer.html');
	document.grayLines.height=contentArea.offsetHeight;	
	document.grayLines.width=4;
	thisPage = document.location.href;
	
	if (thisPage.indexOf("firm_profile") > 0)
	{
		eval("document.firm.src='images/btn_firm_01b.gif'");
	}
	if (thisPage.indexOf("index") > 0)
	{
		eval("document.index.src='images/btn_index_01b.gif'");
	}
	if (thisPage == "http://www.michaelandalexander.com/")
	{
		eval("document.index.src='images/btn_index_01b.gif'");
	}
	if (thisPage.indexOf("attorneys") > 0)
	{
		eval("document.attorneys.src='images/btn_attorneys_01b.gif'");
	}
	if (thisPage.indexOf("practice_areas") > 0)
	{
		eval("document.practice.src='images/btn_practice_01b.gif'");
	}
	if (thisPage.indexOf("contact_us") > 0)
	{
		eval("document.contact.src='images/btn_contact_01b.gif'");
	}
	if (ieCheck > 0 && paCheck > 0)
	{
		content2.style.top="-1px";
	}
}

function imageSwap(img, inOrOut)
{
	thisPage = document.location.href;

	if (thisPage.indexOf(img) < 0)
	{
		eval("document." + img + ".src='images/btn_" + img + "_01" + inOrOut + ".gif'");
	}
	if (thisPage == "http://www.michaelandalexander.com/")
	{
		eval("document.index.src='images/btn_index_01b.gif'");
	}
	//alert("document." + img + ".src='btn_" + img + "_01" + inOrOut + ".gif'");
	//alert(thisPage);
}

function showContent(num)
{
	numItems = 7;
	for (i=1; i<=numItems; i++)
	{
		eval("content" + i + ".style.display='none'");
		eval("cnt" + i + ".style.fontWeight='normal'");
		eval("cnt" + i + ".style.color='#000000'");
	}
	eval("content" + num + ".style.display='block'");
	eval("cnt" + num + ".style.fontWeight='bold'");
	eval("cnt" + num + ".style.color='#593962'");
	document.grayLines.height=1;
	document.grayLines.height=contentArea.offsetHeight;	
	document.grayLines.width=4;
}

function showContentPA(num)
{
	numItems = 3;
	for (i=1; i<=numItems; i++)
	{
		eval("content" + i + ".style.display='none'");
		eval("cnt" + i + ".style.fontWeight='normal'");
		eval("cnt" + i + ".style.color='#000000'");
	}
	eval("content" + num + ".style.display='block'");
	eval("cnt" + num + ".style.fontWeight='bold'");
	eval("cnt" + num + ".style.color='#593962'");
	document.grayLines.height=1;
	document.grayLines.height=contentArea.offsetHeight;	
	document.grayLines.width=4;
}

function showRepTrials(openNum)
{
	eval("repTrials" + openNum + "Open.style.display='block'");
	eval("repTrials" + openNum + "Closed.style.display='none'");
	document.grayLines.height=1;
	document.grayLines.height=contentArea.offsetHeight;	
	document.grayLines.width=4;
}

function closeRepTrials(closeNum)
{
	eval("repTrials" + closeNum + "Open.style.display='none'");
	eval("repTrials" + closeNum + "Closed.style.display='block'");
	document.grayLines.height=1;
	document.grayLines.height=contentArea.offsetHeight;	
	document.grayLines.width=4;

}