var theCurrentDiv = "HomeDiv";

function setDiv(DivName) {

    var theHideDiv = document.getElementById(theCurrentDiv);
    theHideDiv.style.visibility ="hidden";
    var theShowDiv = document.getElementById(DivName);
    theShowDiv.style.visibility = "visible";
    theCurrentDiv = DivName;
    synchDivisions (DivName);
}

function synchDivisions (mainDivName) {
    var theMenuDiv = document.getElementById("MENU");
    var MenuHeight = MENU.offsetHeight * 1.05;
    var theMainDiv = document.getElementById(mainDivName);
    var MainHeight = theMainDiv.offsetHeight;

    if (MainHeight < 500) { 
      MainHeight = 500;
    }
    var MainTop = theMainDiv.clientTop;
    var theFooterDiv = document.getElementById("FooterDiv");

    var newTop = MainHeight+ 150 ;
    theMainDiv.style.height = MainHeight +"px";
    theMenuDiv.style.height = MainHeight+"px";
    newTop = newTop+"px";
    theFooterDiv.style.top = newTop;
}

function addMapLink (imgName, imgDescription) {
      document.write('<table width="100%"><tr><td>');
      document.write('<p align="center"><a href="maps/'+imgName+'.pdf" target="_blank"><img src="maps/'+imgName+'.jpg" alt="'+imgName+'" width="350px" border="0px"></a><br>');
      document.write('</td><td>');
      document.write('<p align="center"><a href="maps/'+imgName+'.pdf" target="_blank"><img src="maps/'+imgName+'Legend.jpg" alt="'+imgName+' Legend" width="150px" border="0px"></a><br>');
      document.write('</td></tr><tr><td>');
      document.write('<p align="center">'+imgDescription+'</p>');
      document.write('</td><td></td></tr></table><hr class="MapDivider">');
}

function loginLOIS() {
    window.open("http://www.locationone.com/lois/logon.do?username=IA-HarrisonCounty","LOIS","dependent=1,height=10,width=700,screenx=0,screeny=0,menubar=0,scrollbars=0,resizable=0,toolbar=0");
}

function showSchool(schoolName) {
    var theImage = document.getElementById("Schools");
    switch (schoolName) {
      case "AHST":
        theImage.src="../images/Schools/AHST.gif";
        break;
      case "BoyerValley":
        theImage.src="../images/Schools/BoyerValley.gif";
        break;
      case "Harlan":
        theImage.src="../images/Schools/Harlan.gif";
        break;
      case "LoganMagnolia":
        theImage.src="../images/Schools/LoganMagnolia.gif";
        break;
      case "MissouriValley":
        theImage.src="../images/Schools/MissouriValley.gif";
        break;
      case "TriCenter":
        theImage.src="../images/Schools/TriCenter.gif";
        break;
      case "WestHarrison":
        theImage.src="../images/Schools/WestHarrison.gif";
        break;
      case "WestMonona":
        theImage.src="../images/Schools/WestMonona.gif";
        break;
      case "Woodbine":
        theImage.src="../images/Schools/Woodbine.gif";
        break;
      default:
        theImage.src="../images/Schools/Schools.gif";
        break;
    }
}
