// Tilehouse Street Pre-School website JavaScript utilites
//
//
//-----------------------------------------------------------------
// Function footer
//-----------------------------------------------------------------
//
// Description
//  Displays the page footer
//
// Parameters
//  none
//-----------------------------------------------------------------
//
function footer() {

    document.write("<div id='footer'>");
    document.write("  <img src='images/kids3.gif'><br />");
    document.write("  <div id='siteInfo'>");
    document.write("    <a href='home.html'>Home</a> | ");
//    document.write("    <a href='sitemap.html'>Site Map</a> | ");
    document.write("    <a href='privacy.html'>Privacy Policy</a> | ");
    document.write("    <a href='who_contact.html'>Contact Us</a> | ");
    document.write("    ©2006-2007 Tilehouse Street Pre-School &nbsp;&nbsp;&nbsp;&nbsp; ");
    document.write("  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(registered charity no. 1102492) ");
    document.write("  </div>");
    document.write("</div><br/>");
}


//-----------------------------------------------------------------
// Function header
//-----------------------------------------------------------------
//
// Description
//  Displays the page header
//
// Parameters
//  none
//-----------------------------------------------------------------
//
function header() {

    document.write("<div id='header'>");
    document.write("  <a href='./home.html'><img src='./images/PSlogo-100.gif' alt='Home' border='0'></a>");
    document.write("  <img src='./images/banner2.gif' border='0'>");
    document.write("</div>");
    document.write("<div id='navigation'>");
    document.write("  <ul>");
	document.write("    <li class='start'><A href='home.html' target=_self>Home</a></li>");
    document.write("    <li><A href='who.html' target=_self>Who?</a></li>");
    document.write("    <li><A href='where.html' target=_self>Where?</a></li>");
    document.write("    <li><A href='what_newsletter.html' target=_self>What?</a></li>");
    document.write("    <li><A href='when.html' target=_self>When?</a></li>");
    document.write("    <li><A href='how.html' target=_self>How?</a></li>");
    document.write("    <li class='end'><A href='why.html' target=_self>Why?</a></li>");
    document.write("  </ul>");
    document.write("</div>");
}

//-----------------------------------------------------------------
// Function navBlank
//-----------------------------------------------------------------
//
// Description
//  Displays a blank side navigation bar
//
// Parameters
//  none
//-----------------------------------------------------------------
//
function navBlank() {

  document.write("<div id='navBar' class='column'>");
  document.write("  <div id='sectionLinks'>");
  document.write("    <h3>&nbsp;</h3>");
  document.write("    <ul>");
  document.write("    </ul>");
  document.write("  </div>");
  document.write("  <br><br><br><br>");
  document.write("</div>");
}


//-----------------------------------------------------------------
// Function navHome
//-----------------------------------------------------------------
//
// Description
//  Displays the Home page side navigation bar
//
// Parameters
//  none
//-----------------------------------------------------------------
//
function navHome() {

  document.write("<div id='navBar' class='column'>");
  document.write("  <div id='sectionLinks'>");
  document.write("    <h3>Links</h3>");
  document.write("    <ul>");
  document.write("      <li><a href='what_newsletter.html'>Newsletter</a></li><li>");
  document.write("      <a href='when.html'>Term times</a></li><li>");
  document.write("      <a href='what_sessions.html'>Sessions</a></li><li>");
  document.write("      <a href='how_cost.html'>Costs</a></li><li>");
  document.write("      <a href='what_outdoor.html'>Outdoor area</a></li>");
  document.write("    </ul>");
  document.write("  </div>");
  document.write("  <br><br><br>");
  document.write("  <IMG alt=picture src='images/fish1.jpg'>");
  document.write("  <div class='caption-small'>&quot;Shiny fish&quot;</div>");
  document.write("</div>");
}


//-----------------------------------------------------------------
// Function navHow
//-----------------------------------------------------------------
//
// Description
//  Displays the How? side navigation bar
//
// Parameters
//  none
//-----------------------------------------------------------------
//
function navHow() {

  document.write("<div id='navBar' class='column'>");
  document.write("  <div id='sectionLinks'>");
  document.write("    <h3>How?</h3>");
  document.write("    <ul>");
  document.write("      <li><a href='how.html'>How to apply?</a></li><li>");
  document.write("      <a href='how_cost.html'>How much?</a></li><li>");
  //document.write("      <a href='how_success.html'>How we manage to be successful</a></li><li>");
  document.write("      <a href='how_help.html'>How can you help us?</a></li>");
  document.write("    </ul>");
  document.write("  </div>");
  document.write("  <br><br><br>");
  document.write("  <IMG alt=picture src='images/sam1.jpg'>");
  document.write("  <div class='caption-small'>&quot;Sam with no arms&quot;</div>");
  document.write("  <br><br><br>");
  everyClick();
  document.write("</div>");
}


//-----------------------------------------------------------------
// Function navWhat
//-----------------------------------------------------------------
//
// Description
//  Displays the What? side navigation bar
//
// Parameters
//  none
//-----------------------------------------------------------------
//
function navWhat() {

  document.write("<div id='navBar' class='column'>");
  document.write("  <div id='sectionLinks'>");
  document.write("    <h3>What?</h3>");
  document.write("    <ul>");
  document.write("      <li><a href='what_newsletter.html'>What's on?</a></li><li>");
  document.write("      <a href='what_outdoor.html'>Outdoor area</a></li>");
  document.write("      <a href='what_supporters.html'>Supporters</a></li>");
  document.write("      <a href='what_aims.html'>Aims &amp; Objectives</a></li><li>");
  document.write("      <a href='what_curriculum.html'>Curriculum</a></li><li>");
  document.write("      <a href='what_sessions.html'>Sessions</a></li><li>");
  document.write("    </ul>");
  document.write("  </div>");
  document.write("  <br><br><br>");
  document.write("  <IMG alt=picture src='images/Image30.gif'>");
  document.write("  <div class='caption-small'></div>");
  document.write("  <br><br><br>");
  everyClick();
  document.write("</div>");
}


//-----------------------------------------------------------------
// Function navWhen
//-----------------------------------------------------------------
//
// Description
//  Displays the When? side navigation bar
//
// Parameters
//  none
//-----------------------------------------------------------------
//
function navWhen() {

  document.write("<div id='navBar' class='column'>");
  document.write("  <div id='sectionLinks'>");
  document.write("    <h3>When?</h3>");
  document.write("    <ul>");
  document.write("      <li><a href='when.html'>Term dates</a></li>");
  document.write("    </ul>");
  document.write("  </div>");
  document.write("  <br><br><br>");
  document.write("  <IMG alt=picture src='images/pear1.jpg'>");
  document.write("  <div class='caption-small'>&quot;Pear shaped&quot;</div>");
  document.write("  <br><br><br>");
  everyClick();
  document.write("</div>");
}

//-----------------------------------------------------------------
// Function navWhere
//-----------------------------------------------------------------
//
// Description
//  Displays the Where? side navigation bar
//
// Parameters
//  none
//-----------------------------------------------------------------
//
function navWhere() {

  document.write("<div id='navBar' class='column'>");
  document.write("  <div id='sectionLinks'>");
  document.write("    <h3>Where?</h3>");
  document.write("    <ul>");
  document.write("      <li><a href='where.html'>Where are we?</a></li>");
  document.write("    </ul>");
  document.write("  </div>");
  document.write("  <br><br><br>");
  document.write("  <IMG alt=picture src='images/map1a.gif'>");
  document.write("  <div class='caption-small'>&quot;We are here!&quot;</div>");
  document.write("  <br><br><br>");
  everyClick();
  document.write("</div>");
}


//-----------------------------------------------------------------
// Function navWho
//-----------------------------------------------------------------
//
// Description
//  Displays the Who? side navigation bar
//
// Parameters
//  none
//-----------------------------------------------------------------
//
function navWho() {

  document.write("<div id='navBar' class='column'>");
  document.write("  <div id='sectionLinks'>");
  document.write("    <h3>Who?</h3>");
  document.write("    <ul>");
  document.write("      <li><a href='who.html'>Our staff</a></li><li>");
  document.write("      <a href='who_committee.html'>Our committee</a></li><li>");
  document.write("      <a href='who_keyworker.html'>Our keyperson system</a></li><li>");
  document.write("      <a href='who_parents.html'>Our parents</a></li><li>");
  document.write("      <a href='who_contact.html'>Who to contact</a></li>");
  document.write("    </ul>");
  document.write("  </div>");
  document.write("  <br><br><br>");
  document.write("  <IMG alt=picture src='images/teacher.jpg'>");
  document.write("  <div class='caption-small'>&quot;This is my teacher&quot;</div>");
  document.write("  <br><br><br>");
  everyClick();
  document.write("</div>");
}


//-----------------------------------------------------------------
// Function navWhy
//-----------------------------------------------------------------
//
// Description
//  Displays the Why? side navigation bar
//
// Parameters
//  none
//-----------------------------------------------------------------
//
function navWhy() {

  document.write("<div id='navBar' class='column'>");
  document.write("  <div id='sectionLinks'>");
  document.write("    <h3>Why?</h3>");
  document.write("    <ul>");
  document.write("      <li><a href='why.html'>Why choose us?</a></li><li>");
  document.write("      <a href='why_hqs.html'>HQS</a></li><li>");
  document.write("      <a href='why_comments.html'>Comments</a></li><li>");
  document.write("      <a href='why_church.html'>Church links</a></li>");
  //document.write("      <a href='why_community.html'>Community links</a></li><li>");
  document.write("      <a href='why_policies.html'>Policies</a></li><li>");
  document.write("    </ul>");
  document.write("  </div>");
  document.write("  <br><br><br>");
  document.write("  <IMG alt='picture' src='images/trains1.jpg'>");
  document.write("  <div class='caption-small'>&quot;Playing with trains&quot;</div>");
  document.write("  <br><br><br>");
  everyClick();
  document.write("</div>");
}



//-----------------------------------------------------------------
// Function matchColumns
//-----------------------------------------------------------------
//
// Description
//  Sets 'div' column depths to be the same
//
// Derived from a script by Alejandro Gervasio. 
// Modified to work in FireFox by Stefan Mischook for Killersites.com
//
// How it works: just apply the CSS class of 'column' to your pages' main columns.
//
// Parameters
//  none
//-----------------------------------------------------------------
//
/* 

*/
matchColumns=function(){ 

    var divs,contDivs,maxHeight,divHeight,d; 
	 
    // get all <div> elements in the document 
    divs=document.getElementsByTagName('div'); 
    contDivs=[]; 

    // initialize maximum height value 
    maxHeight=0; 

    // iterate over all <div> elements in the document 
    for (var i=0;i<divs.length;i++) { 

        // make collection with <div> elements with class attribute 'container' 
        if (/\bcolumn\b/.test(divs[i].className)) { 
            d=divs[i]; 
            contDivs[contDivs.length]=d; 
            // determine height for <div> element 
            if (d.offsetHeight) { 
               divHeight=d.offsetHeight; 					
            } 
            else if (d.style.pixelHeight) { 
                divHeight=d.style.pixelHeight;					 
            } 
            // calculate maximum height 
            maxHeight=Math.max(maxHeight,divHeight); 
        } 
    } 

    // assign maximum height value to all of container <div> elements 
    for (var i=0;i<contDivs.length;i++) { 
        contDivs[i].style.height=maxHeight + "px"; 
    } 
} 

// Runs the script when page loads 
window.onload=function(){ 

     if (document.getElementsByTagName) { 
          matchColumns();			 
     } 
} 


//-----------------------------------------------------------------
// Function everyClick
//-----------------------------------------------------------------
//
// Description
//  Displays the every click search box
//
// Parameters
//  none
//-----------------------------------------------------------------
//
function everyClick() {

  document.write('<form target="_blank" action="http://www.everyclick.com/uk/tilehouse-street-pre-school/597362/610311/search" method="post">');
  document.write('<table border="0" cellpadding="0" cellspacing="0"  style="border: 1px solid #00CCFF; background: #fff;">');
  document.write('<tr><td ><a target="_blank" title="Search the web and benefit Tilehouse Street Pre-School" href="http://www.everyclick.com/uk/tilehouse-street-pre-school/597362/610311"><img style="width: 87px; padding 5px;" src="http://www.everyclick.com/ext-search/white-search/logo.gif" width="87" border="0"/></a></td></tr>');
  document.write('<tr><td valign="middle"><input name="keyword" type="text" style="font-family: Arial, Helvetica, sans-serif; font-size: 11px;font-weight: normal;color: #000000; border: 1px solid #CAEDFF;background-color: #FFFFFF;" size="18" value="Search the web and benefit Tilehouse Street Pre-School"/></td></tr>');
  document.write('<tr><td align="center" valign="middle"><input name="refresh" type="submit" value="GO"/></td></tr><td height="30" colspan="3" align="center" valign="middle"><a target="_blank" title="Search the web and benefit Tilehouse Street Pre-School" href="http://www.everyclick.com/uk/tilehouse-street-pre-school/597362/610311"><img style="width: 101px;" src="http://www.everyclick.com/ext-search/white-search/powered2.gif" border="0"/></a></td></tr>');
  document.write('</table>');
  document.write('</form>');

}


