function over(name)
      {
        window.document.getElementById(name).style.backgroundColor="#c5b59e";
        window.document.getElementById(name).style.cursor="pointer";
      }

    function off(name)
      {
        window.document.getElementById(name).style.backgroundColor="";
        window.document.getElementById(name).style.cursor="default";
      }


    function overMain(name)
      {
        window.document.getElementById(name).style.color="#000000";
        window.document.getElementById(name).style.cursor="pointer";
      }

    function offMain(name)
      {
        window.document.getElementById(name).style.color="#ffffff";
        window.document.getElementById(name).style.cursor="default";
      }


    var tab = new Array("homeOn.png","aboutUsOn.png","usefulOn.png","classesOn.png","funAndGamesOn.png","latestOn.png");

    function setOn(n)
      {
        window.document.getElementById("header").innerHTML="<img src=\"pix/logo.png\" alt=\"where every child is special\" title=\"where every child is special\" class=\"logo\"><div class = \"abbeyfields\">Abbeyfields School<br><span style=\"font-size:10pt;font-weight:normal\">Abbots Way, Morpeth<br>Northumberland NE61 2LZ<br>Tel: 01670 513 582</span></div><div id = \"headTitle\">Academic Excellence In A Caring Environment<br><span style=\"font-size:11pt;line-height:4.0em\">Headteacher:<span style=\"font-weight:normal\"> Mrs Sandra Ford BA (Hons), PGCE, NPQH</span></span></div><div id=\"mainLinks\"><div id=\"tab1\" onmouseover=\"overMain('tab1')\" onmouseout=\"offMain('tab1')\" onclick=\"window.location='index.html'\">Home</div>  <div id=\"tab2\" onmouseover=\"overMain('tab2')\" onmouseout=\"offMain('tab2')\" onclick=\"window.location='aboutUs.html'\">About Us</div><div id=\"tab3\" onmouseover=\"overMain('tab3')\" onmouseout=\"offMain('tab3')\" onclick=\"window.location='usefulInfo.html'\">Useful Information</div><div id=\"tab4\" onmouseover=\"overMain('tab4')\" onmouseout=\"offMain('tab4')\" onclick=\"window.location='classes.html'\">Our Classes</div><div id=\"tab5\" onmouseover=\"overMain('tab5')\" onmouseout=\"offMain('tab5')\" onclick=\"window.location='games.html'\">Fun And Games</div><div id=\"tab6\" onmouseover=\"overMain('tab6')\" onmouseout=\"offMain('tab6')\" onclick=\"window.location='latest.html'\">Latest News</div></div>";

        window.document.getElementById("footer").innerHTML="&#169; 2010 Abbeyfields School | <a href=\"index.html\">Home</a> | <a href=\"aboutUs.html\">About Us</a> | <a href=\"usefulInfo.html\">Useful Information</a> | <a href=\"classes.html\">Our Classes</a> | <a href=\"games.html\">Fun and Games</a> | <a href=\"latest.html\">Latest News</a> | <a href=\"siteMap.html\">Site Map</a>";


        if (n > 0)
          {
            name="tab"+n;
            urlIn="url(pix/tabs/"+tab[n-1]+")";
            //  alert(urlIn);
            window.document.getElementById(name).onmouseover="";
            window.document.getElementById(name).onmouseout="";
            window.document.getElementById(name).onclick="";
            window.document.getElementById(name).style.color="#000000";
            window.document.getElementById(name).style.backgroundImage=urlIn;
          }
      }

  	function linkUp(n)
      {

        window.document.getElementById("link").style.backgroundImage="url(pix/tabs/links.png)";

        if (n == 2)
          {
            window.document.getElementById("link").innerHTML="<div id=\"about\" onmouseover=\"over('about')\"onmouseout=\"off('about')\" onclick=\"window.location='aboutUs.html'\"style=\"position:absolute;left:10px;width:50px;padding-left:10px;height:25px\">Maps</div><div id=\"nurseryP\" onmouseover=\"over('nurseryP')\" onmouseout=\"off('nurseryP')\" onclick=\"window.location='nurseryProspectus.html'\" style=\"position:absolute;left:80px;width:150px;padding-left:10px;height:25px\">Nursery Prospectus</div><div id=\"welcome\" onmouseover=\"over('welcome')\" onmouseout=\"off('welcome')\" onclick=\"window.location='welcomeProspectus.html'\" style=\"position:absolute;left:250px;width:180px;padding-left:10px;height:25px\">Welcome To Our School</div><div id=\"additionalInfo\" onmouseover=\"over('additionalInfo')\" onmouseout=\"off('additionalInfo')\" onclick=\"window.location='additionalInfoProspectus.html'\" style=\"position:absolute;left:450px;width:170px;padding-left:10px;height:25px\">Additional Information</div><div id=\"specialP\" onmouseover=\"over('specialP')\" onmouseout=\"off('specialP')\" onclick=\"window.location='specialProspectus.html'\" style=\"position:absolute;left:640px;width:110px;padding-left:10px;height:25px\">Special Group</div>";
          }

        if (n == 3)
          {
            window.document.getElementById("link").innerHTML="<div id=\"admissions\" onmouseover=\"over('admissions')\" onmouseout=\"off('admissions')\" onclick=\"window.location='admissions.html'\" style=\"position:absolute;left:10px;width:100px;padding-left:10px;height:25px\">Admissions</div><div id=\"dates\" onmouseover=\"over('dates')\" onmouseout=\"off('dates')\" onclick=\"window.location='diaryDates.html'\" style=\"position:absolute;left:130px;width:100px;padding-left:10px;height:25px\">Diary Dates</div><div id=\"governors\" onmouseover=\"over('governors')\" onmouseout=\"off('governors')\" onclick=\"window.location='governors.html'\" style=\"position:absolute;left:250px;width:90px;padding-left:10px;height:25px\">Governors</div><div id=\"holidays\" onmouseover=\"over('holidays')\" onmouseout=\"off('holidays')\" onclick=\"window.location='holidays.html'\" style=\"position:absolute;left:360px;width:80px;padding-left:10px;height:25px\">Holidays</div><div id=\"illness\" onmouseover=\"over('illness')\"onmouseout=\"off('illness')\" onclick=\"window.location='illness.html'\"style=\"position:absolute;left:460px;width:70px;padding-left:10px;height:25px\">Absence</div><div id=\"newsletters\" onmouseover=\"over('newsletters')\" onmouseout=\"off('newsletters')\" onclick=\"window.location='newsletters.html'\" style=\"position:absolute;left:550px;width:100px;padding-left:10px;height:25px\">Newsletters</div><div id=\"contacts\" onmouseover=\"over('contacts')\" onmouseout=\"off('contacts')\" onclick=\"window.location='phone.html'\" style=\"position:absolute;left:670px;width:100px;padding-left:10px;height:25px\">Contact List</div><div id=\"tftw\" onmouseover=\"over('tftw')\" onmouseout=\"off('tftw')\" onclick=\"window.location='tftw.html'\" style=\"position:absolute;left:790px;width:120px;padding-left:10px;height:25px\">Change TFTW</div>";
          }

        if (n == 4)
          {
            window.document.getElementById("link").innerHTML="<div id=\"nursery\" onmouseover=\"over('nursery')\" onmouseout=\"off('nursery')\" onclick=\"window.location='nursery.html'\" style=\"position:absolute;left:20px;width:80px;padding-left:20px;height:25px\">Nursery</div><div id=\"reception\" onmouseover=\"over('reception')\" onmouseout=\"off('reception')\" onclick=\"window.location='reception.html'\" style=\"position:absolute;left:130px;width:90px;padding-left:20px;height:25px\">Reception</div><div id=\"year12\" onmouseover=\"over('year12')\" onmouseout=\"off('year12')\" onclick=\"window.location='ks1.html'\" style=\"position:absolute;left:250px;width:90px;padding-left:20px;height:25px\">Year 1 &#38; 2</div><div id=\"year3\" onmouseover=\"over('year3')\" onmouseout=\"off('year3')\" onclick=\"window.location='year3.html'\" style=\"position:absolute;left:370px;width:70px;padding-left:20px;height:25px\">Year 3</div><div id=\"year4\" onmouseover=\"over('year4')\"onmouseout=\"off('year4')\" onclick=\"window.location='year4.html'\"style=\"position:absolute;left:470px;width:70px;padding-left:20px;height:25px\">Year 4</div><div id=\"special\" onmouseover=\"over('special')\" onmouseout=\"off('special')\" onclick=\"window.location='specialGroup.html'\" style=\"position:absolute;left:570px;width:120px;padding-left:20px;height:25px\">Special Group</div>";
          }

      }


      var s;
      var timeoutId;
      var i=1;

      function changePics(i)
        {
          if (i<30)
            {
              //document.getElementById("school").src=picture[i-1];
              document.getElementById("school").src="pix/frontCover/pic"+i+".jpg";
              document.getElementById("school").alt="pic"+i;
              document.getElementById("school").title="pic"+i;
              i++;
              if (i>29){i=1;}
              s="changePics("+i+")";
              timeoutId=setTimeout(s,5000);
            }
        }



