function checkamicurrent(pageName) {
  var currvalue = new Array(8);
  
  currvalue[0] = '';
  currvalue[1] = '';
  currvalue[2] = '';
  currvalue[3] = '';
  currvalue[4] = '';
  currvalue[5] = '';
  currvalue[6] = '';
  currvalue[7] = '';
  currvalue[8] = '';
  
  if (pageName == 'index.html') {
    currvalue[0] = " ID='current' ";    
      }
  if (pageName == 'aboutus.html') {
    currvalue[1] = ' ID="current"';
      }
  if (pageName == 'family.html') {
    currvalue[2] = ' ID="current"';    
      }
  if (pageName == 'genesis.html') {
    currvalue[3] = ' ID="current"';    
      }
  if (pageName == 'give.html') {
    currvalue[4] = ' ID="current"';
      }
  if (pageName == 'newbegin.html') {
    currvalue[5] = ' ID="current"';
      }
  if (pageName == 'nextsteps.html') {
    currvalue[6] = ' ID="current"';    
      }
  if (pageName == 'something.html') {
    currvalue[7] = ' ID="current"';    
      }  
  if (pageName == 'members.html') {
    currvalue[8] = ' ID="current"';    
      }  
  return currvalue;  
}



function populateHeader(pageName) {
	document.getElementById('connectFacebk').innerHTML =
      "<img src='images/connect.png' alt='Connect with Us'><br />" +
	  "<a href='http://www.facebook.com/pages/Memorial-Christian-Church/176405982371810?ref=ts'><img src='images/facebook_16.jpg' alt='Facebook logo' style='positioning: relative;'>&nbsp;Facebook</a><! | Twitter -->" ;
	
	document.getElementById('churchname').innerHTML =
       "<p><a href='members.html'>" +
        "<img src='images/chalice.png' height='20px' alt='DoC Chalice' />" +
        "&nbsp; Memorial Christian Church &nbsp;(Disciples of Christ)" +
	  "</a></p>"+
	  "<p class='leadtxt' style='color: #E46C0A; font-size: 0.87em;'>" +
	  "Striving to become the church you didn't think existed, but " +
	  "hoped for.  Come and be the church you've always wanted." +
	  "<br />&nbsp;</p>";	
}

function populateMenu(pageName) {
  var amicurrent = checkamicurrent(pageName); 
	
  document.getElementById('platttabs').innerHTML = 
    "<ul>" +     
    "<li" + amicurrent[0] + "><a href='index.html'><span>HOME</span></a></li>" +
    "<li" + amicurrent[1] + "><a href='aboutus.html'>" +
    "<span>I'M&nbsp;NEW</span></a></li>" +
    "<li" + amicurrent[2] + "><a href='family.html'><span>FAMILY</span></a></li>" +
    "<li" + amicurrent[4] + "><a href='give.html'><span>GIVE</span></a></li>" +
    "<li" + amicurrent[3] + "><a href='genesis.html'><span>GOD'S&nbsp;CREATION</span></a></li>" +
    "<li" + amicurrent[5] + "><a href='newbegin.html'><span>NEW&nbsp;BEGINNINGS</span></a></li>" +
    "<li" + amicurrent[6] + "><a href='nextsteps.html'><span>NEXT&nbsp;STEPS</span></a></li>" +
    "<li" + amicurrent[7] + "><a href='something.html'>" +
    "<span>SOMETHING&nbsp;TO&nbsp;DO&nbsp;FOR&nbsp;GOD</span></a></li><br />" +    
    "</ul>";	
}

function populateFooter(pageName) {
  document.getElementById('footerlinks').innerHTML = 
    "<div id='sundaystuff'>" +
    "<span><b>Sunday Gatherings</b></span><br />" +
    "<b>Adult Class at 9:15</b><br />" +
    "<b>Nursery &ndash; 2nd Grade at 9:15</b><br />" +
    "<b>Worship at 10:30</b><br />" +
    "<a href='http://maps.google.com/maps?near=5141+Platt+Road+Ann+Arbor+MI;'>" +
    "<i>Find us on the map</i>" +
    "</a>" +
    "</div>" +
    "<div id='sep1'>" +
    "</div>" +
    "<div id='officestuff'>" +
    "<span><b>Our Office</b></span><br />" +
    "5141 Platt Rd.,<br /> Ann Arbor, MI 48108<br />" +
    "Phone: (734) 971-4245<br />" +
    "<a href='./in_touch.html'>" +
    "<i>Get in touch</i></a>" +
    "</div>" +
    "<div id='sep2'>" +
    "</div>" +
    "<div id='specialstuff'>" +
    "<span><b>Special Services</b></span><br />" +
    "&ldquo;Ecumenical Taize Worship&rdquo;<br />" +
    "2nd Wednesday of the month<br />" +
    "<a href='docs/EcumenicalTaizeWorshipflyer.docx'>" +
    "<i>More info about the series</i></a>" +
    "</div>\n" +
    "<div id='sep3'>" +
    "</div>" +
    "<div id='currentstuff'>" +
    "<span>Current Series</span><br />" +
    "Small Group Study &mdash;<br />" +
    "&ldquo;Love Wins&rdquo;<br />" +
    "Feb 12 &mdash; June 17, 2012<br />" +
    "<a href='docs/upcoming_events.pdf'>" +
    "<i>See upcoming events</i></a>" +
    "</div>\n" +
    "<div id='footer-webm'>" +
    "<span>www.annarbordisciples.org</span><br />maintained by <a href='http://jdovermarsa.com'>JDOA</a>" +
    "</div>";
}

function populateCommonDivs(pageName) {
  populateHeader(pageName);
  populateMenu(pageName);  
  populateFooter(pageName);
}

