var online=1;
var lastUpdate="Nov 2006";

var wotPlatForm="Unknown";
var wotBrowser="Unknown";
var bSetup="Unknown";
if (navigator.appVersion.indexOf("Mac") !== -1){wotPlatForm="Mac";}else{wotPlatForm="Win";}
if (navigator.userAgent.indexOf("Safari") !== -1){wotBrowser="Safari";}
if (navigator.userAgent.indexOf("Firefox") !== -1){wotBrowser="Firefox";}
if (navigator.userAgent.indexOf("Navigator") !== -1){wotBrowser="Netscape";}
if (navigator.userAgent.indexOf("Netscape") !== -1){wotBrowser="Netscape";}
if (navigator.appVersion.indexOf("MSIE") !== -1){wotBrowser="MSIE";}
if (navigator.userAgent.indexOf("Opera") !== -1){wotBrowser="Opera";}

if ((wotBrowser=="Firefox")&&(wotPlatForm=="Mac")){bSetup="Mac_Firefox";}
if ((wotBrowser=="Firefox")&&(wotPlatForm=="Win")){bSetup="Win_Firefox";}
if ((wotBrowser=="Safari")&&(wotPlatForm=="Mac")){bSetup="Mac_Safari";}
if ((wotBrowser=="Safari")&&(wotPlatForm=="Win")){bSetup="Win_Safari";}
if ((wotBrowser=="MSIE")&&(wotPlatForm=="Mac")){bSetup="Mac_MSIE";}
if ((wotBrowser=="MSIE")&&(wotPlatForm=="Win")){bSetup="Win_MSIE";}
if ((wotBrowser=="Netscape")&&(wotPlatForm=="Mac")){bSetup="Mac_Netscape";}
if ((wotBrowser=="Netscape")&&(wotPlatForm=="Win")){bSetup="Win_Netscape";}
if ((wotBrowser=="Opera")&&(wotPlatForm=="Mac")){bSetup="Mac_Opera";}
if ((wotBrowser=="Opera")&&(wotPlatForm=="Win")){bSetup="Win_Opera";}

var ie6 = (document.all && document.getElementbyID) ? true : false;
var ie4 = (document.all) ? true : false;
var ns4 = (document.layers) ? true : false;
var ns3 = (document.images) ? true : false;

function myUnescape(theWord){
var x=0;
var outStr ="";
var ch="";
for (x=0; x<theWord.length; x++){
  ch = theWord.substr(x,1);
  if (ch=='+') {ch=" "};
  outStr+=ch;
  }
  return outStr;
}

function putdate(){
 var thisDate=new Date();
 var thismonth=thisDate.getMonth()+1;
 if (thismonth=="1") {monthname="January"}
 if (thismonth=="2") {monthname="February"}
 if (thismonth=="3") {monthname="March"}
 if (thismonth=="4") {monthname="April"}
 if (thismonth=="5") {monthname="May"}
 if (thismonth=="6") {monthname="June"}
 if (thismonth=="7") {monthname="July"}
 if (thismonth=="8") {monthname="August"}
 if (thismonth=="9") {monthname="September"}
 if (thismonth=="10") {monthname="October"}
 if (thismonth=="11") {monthname="November"}
 if (thismonth=="12") {monthname="December"}
 var year=thisDate.getYear();
 if (navigator.appVersion.lastIndexOf('Mac') != -1) 
  if (navigator.appName == ('Microsoft Internet Explorer')) 
  var year = (thisDate.getYear());
  else var year = (thisDate.getYear()+1900);
 if ((navigator.appName=="Netscape") && (navigator.appVersion.indexOf("Win") != -1))
      var year = (thisDate.getYear()+1900);
 currentDate=monthname+' '+thisDate.getDate()+', '+year+'';
 document.write(currentDate);
}


function toggleMenu(objectID) {
var object=document.getElementById(objectID);
if (object.style.display!='none') {object.style.display='none';}
else {object.style.display='block';}
return;
}

function toggleEl(wotEl){
//resetMenus();
if (document.getElementById(wotEl).style.display!="none"){
document.getElementById(wotEl).style.display="none";}
else{document.getElementById(wotEl).style.display="block";}
return;
}

function setMenu(){
if (wotSec!="1"){document.getElementById('ss_1').style.display="none";}else{document.getElementById('ss_1').style.display="block";}
if (wotSec!="2"){document.getElementById('ss_2').style.display="none";}else{document.getElementById('ss_2').style.display="block";}
if (wotSec!="3"){document.getElementById('ss_3').style.display="none";}else{document.getElementById('ss_3').style.display="block";}
if (wotSec!="4"){document.getElementById('ss_4').style.display="none";}else{document.getElementById('ss_4').style.display="block";}
return;
}

function resetMenus(){
document.getElementById('ss_1').style.display="none";
document.getElementById('ss_2').style.display="none";
document.getElementById('ss_3').style.display="none";
document.getElementById('ss_4').style.display="none";
return;
}

function initMenus(){
var iM='<style>';
if (wotSec!="1"){iM+='#ss_1{display:none}'}else{iM+='#ss_1{display:block}'}
if (wotSec!="2"){iM+='#ss_2{display:none}'}else{iM+='#ss_2{display:block}'}
if (wotSec!="3"){iM+='#ss_3{display:none}'}else{iM+='#ss_3{display:block}'}
if (wotSec!="4"){iM+='#ss_4{display:none}'}else{iM+='#ss_4{display:block}'}
iM+='<'+'/style>';
document.write(iM);
//alert(iM);
}

btns1=new Array("welcome","about our school","school nursery","staff","governors","learning mentors","school policies","house system","ofsted","teacher training","school uniforms","school meals","school awards","contact us");
btnsURLs1=new Array("index","about","nursery","staff","governors","learningmentors","policies","housesystem","ofsted","teachertraining","uniforms","meals","awards","contact");

btns2=new Array("national curriculum","foundation","art","design &amp; technology","geography","health education","history","ict","literacy","maths","music","pshe","religous education","science","spanish","special needs","gallery");
btnsURLs2=new Array("curriculum","foundation","art","designtechnology","geography","health","history","ict","literacy","maths","music","pshe","re","science","spanish","specialneeds","gallery");

btns3=new Array("extracurricular","breakfast club","activity charges","school choir","school council","recorder club");
btnsURLs3=new Array("extracurricular","breakfastclub","activitycharges","choir","schoolcouncil","recorderclub");

btns4=new Array("clubmoor","parents council","parents group","past times","visiting the school");
btnsURLs4=new Array("clubmoor","parentscouncil","parentsgroup","pasttimes","visitingschool");

mainBtns=new Array("our school","the curriculum","extra curricular","parents");
mainBtnsURLs=new Array("ourschool","curriculum","extracurricular","parents");

var buttonNum;
if (wotSec=="1"){
 if (wotPage=="index") {var buttonNum="1"};
 if (wotPage=="about") {var buttonNum="2"};
 if (wotPage=="nursery") {var buttonNum="3"};
 //if (wotPage=="facilities") {var buttonNum="4"};
 if (wotPage=="staff") {var buttonNum="4"};
 if (wotPage=="governors") {var buttonNum="5"};
 if (wotPage=="learningmentors") {var buttonNum="6"};
 if (wotPage=="policies") {var buttonNum="7"};
 if (wotPage=="housesystem") {var buttonNum="8"};
 if (wotPage=="ofsted") {var buttonNum="9"};
 if (wotPage=="teachertraining") {var buttonNum="10"};
 if (wotPage=="uniforms") {var buttonNum="11"};
 if (wotPage=="meals") {var buttonNum="12"};
 if (wotPage=="awards") {var buttonNum="13"};
 if (wotPage=="contact") {var buttonNum="14"};
}
if (wotSec=="2"){
 if (wotPage=="curriculum") {buttonNum="1"};
 if (wotPage=="foundation") {buttonNum="2"};
 if (wotPage=="art") {buttonNum="3"};
 if (wotPage=="designtechnology") {buttonNum="4"};
 if (wotPage=="geography") {buttonNum="5"};
 if (wotPage=="health") {buttonNum="6"};
 if (wotPage=="history") {buttonNum="7"};
 if (wotPage=="ict") {buttonNum="8"};
 if (wotPage=="literacy") {buttonNum="9"};
 if (wotPage=="maths") {buttonNum="10"};
 if (wotPage=="music") {buttonNum="11"};
// if (wotPage=="pe") {buttonNum="12"};
 if (wotPage=="pshe") {buttonNum="12"};
 if (wotPage=="re") {buttonNum="23"};
 if (wotPage=="science") {buttonNum="14"};
 if (wotPage=="spanish") {buttonNum="15"};
 if (wotPage=="specialneeds") {buttonNum="16"};
 if (wotPage=="gallery") {buttonNum="17"};
}
if (wotSec=="3"){
 if (wotPage=="extracurricular") {buttonNum="1"};
 if (wotPage=="breakfastclub") {buttonNum="2"};
 if (wotPage=="activitycharges") {buttonNum="3"};
 if (wotPage=="choir") {buttonNum="4"};
 if (wotPage=="schoolcouncil") {buttonNum="5"};
 //if (wotPage=="dramaclub") {buttonNum="6"};
 if (wotPage=="recorderclub") {buttonNum="6"};
 //if (wotPage=="sports") {buttonNum="7"};
 //if (wotPage=="schooltrips") {buttonNum="9"};
}
if (wotSec=="4"){
 if (wotPage=="clubmoor") {buttonNum="1"};
 if (wotPage=="parentscouncil") {buttonNum="2"};
 if (wotPage=="parentsgroup") {buttonNum="3"};
 if (wotPage=="pasttimes") {buttonNum="4"};
 if (wotPage=="visitingschool") {buttonNum="5"};
}

function writeHeader(){
var wHead='';
wHead+='<div id="container">';
wHead+='<div id="hBox"></div>';
wHead+='<div id="cBox">';
wHead+='<div id="navPanel">';
wHead+='<div id="navPanel_t"></div>';
wHead+='<div id="navPanel_m">';
wHead+='<div id="btn_contents">';

var secNum=mainBtns.length;
for (var loop=0;loop<secNum;loop++){
  wHead+='<div id="section_'+eval(loop+1)+'">';

  if (wotSec!=(eval(loop+1))){
    wHead+='<div class="catHead"><a class="butHead_off" title="Click here to open or close this sub-menu" ';
    wHead+='href="javascript:toggleEl(\'ss_'+eval(loop+1)+'\')">'+myUnescape(mainBtns[eval(loop)])+' <'+'/a></div>';
  }
  else{
    wHead+='<div class="catHead_on"><a class="butHead_on" title="Click here to close this sub-menu" ';
    wHead+='href="javascript:toggleEl(\'ss_'+eval(loop+1)+'\')">'+myUnescape(mainBtns[eval(loop)])+' <'+'/a></div>';
  }
  wHead+='<div id="ss_'+eval(loop+1)+'">';

  wHead+='<ul class="butList">';
  var theBtns=eval("btns"+eval(loop+1));
  var theBtnsURLs=eval("btnsURLs"+eval(loop+1));

  for (var bLoop=0;bLoop<theBtns.length;bLoop++){
    if (buttonNum!=(bLoop+1)){
      wHead+='<li class="inactive"><a href="'+myUnescape(theBtnsURLs[bLoop])+'.htm" class="off" title="Click here to visit ';
      wHead+='the &quot;'+myUnescape(theBtnsURLs[bLoop])+'.htm&quot; page">'+myUnescape(theBtns[bLoop])+' </a> </li>';
    }
    else{
      if (wotSec==(eval(loop+1))){
        wHead+='<li class="active"><a href="'+myUnescape(theBtnsURLs[bLoop])+'.htm" class="current" ';
        wHead+='title="Click here to reload this page">'+myUnescape(theBtns[bLoop])+' </a> </li>';
      }
      else{
        wHead+='<li class="inactive"><a href="'+myUnescape(theBtnsURLs[bLoop])+'.htm" class="off" title="Click here to visit ';
        wHead+='the &quot;'+myUnescape(theBtnsURLs[bLoop])+'.htm&quot; page">'+myUnescape(theBtns[bLoop])+' </a> </li>';
      }
   }
  }
  wHead+='</ul>';
  wHead+='</div>';//ss_ var
  wHead+='</div>';//section_ var
}
wHead+='</div>';//btn_contents
wHead+='</div>';//navPanel_m
wHead+='<div id="navPanel_b"></div>';
wHead+='</div>';//navPanel
wHead+='<div id="pageH">'+pageTitle+'</div>';
wHead+='<div id="textwrap">';
if (pagePic!=""){
wHead+='<img src="'+picPath+pagePic+'" alt="'+pageTitle+'" title="'+pageTitle+'" width="210" height="168" hspace="0" vspace="0" border="0" class="fR mR0088">';
}

document.write(wHead);
}

function writeFooter(){
var wFoot='<div id="fLine"></div>';
wFoot+='</div>';
wFoot+='</div>';
wFoot+='<div id="fBox"></div>';

wFoot+='<div id="creditFooter">';
wFoot+='site by <a class="creditFooter" href="http://www.macdigital-uk.com/" ';
wFoot+='target="_blank" title="Click to visit macDigital">macdigital<'+'/a>';
wFoot+='</div>';


wFoot+='</div>';
document.write(wFoot);
}


