var bgclr='3399ff';
var bgclr='ffaa00';
var bgclr='ff2200';
var bgclr='3399ff';
var bgclr='cc0000';

var buttOn='#ff9900';
var buttOff='#3399ff';
var rightColumn='#aa0000';

var winBgndColor='ffffff';
var winBorderColor='000000';
var winTextColor='ffffff';
var winTextSoloColor='000000';

var featureBorderColor='000000';
var featureTextColor='ffffff';

var pageBgndColor='ffffff';

var pageWidth='760';
var menuCounter=0;

var isMac = (navigator.appVersion.indexOf("Mac") == -1) ? false : true;
var isX = (navigator.appVersion.indexOf("X11") == -1) ? false : true;
var isIE = ((navigator.appVersion.indexOf("MSIE") == -1) && (navigator.appVersion.indexOf("Microsoft") == -1)) ? false : true;
var isNS = (navigator.appVersion.indexOf("compatible") > -1) ? false : true;

var isOpera = (navigator.userAgent.indexOf('Opera') != -1) ? false : true;
var isWebTV = (navigator.appName.indexOf('WebTV') != -1) ? false : true;

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;

if (ns4) {
 origWidth = innerWidth;
 origHeight = innerHeight;
}

function reDo() {if (innerWidth != origWidth || innerHeight != origHeight) {location.reload();}}
if (ns4) {onresize = reDo;}

var topLine = '<tr><td class="topright">&nbsp;</td>';
topLine += '<td class="buttonBar" valign="middle">';
topLine += '<a href="calendar/index.htm" target="_blank">';
topLine += '<img src="images/sitestuff/icon_calendar.gif" alt="Calendar" title="Click to launch our events calendar" width="16" height="15" border="0" hspace="10" vspace="0"></a>';
topLine += '<a href="news/index.htm" target="_blank">';
topLine += '<img src="images/sitestuff/icon_newsarchive.gif" alt="News" title="Click to launch our news archive" width="16" border="0" height="13" hspace="10" vspace="0"></a>';
topLine += '<a href="mailto:Susan.Roberts@surestartspeke.org" onmouseover="dm(\'Click to email us\');return document.status" onmouseout="dm(\'\');return document.status">';
topLine += '<img src="images/sitestuff/icon_envelope.gif" alt="Email" title="Click to email us" width="20" height="14" border="0" hspace="10" vspace="0">';
topLine += '</a>&nbsp;';
topLine += '</td><td class="topright">&nbsp;</td><td class="locline" valign="middle">&nbsp;';
topLine += '&nbsp;<font color="#aaaaaa">You\'re Here:&nbsp;</font>&nbsp;';

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 putBreadCrumbs(level,wotSect,theTitle){
document.write('<a class="loc" href="intro.htm">Home</a>');
document.write('&nbsp;<img src="images/sitestuff/bulletb.gif" width="5" height="7">&nbsp;');
var mainSection='';
var mainSectionURL='';
if (wotSect==1){mainSection='Sure Start';mainSectionURL='surestart.htm';}
if (wotSect==2){mainSection='Early Learning Providers';mainSectionURL='elp.htm';}
if (wotSect==3){mainSection='Sure Start Speke Projects';mainSectionURL='projects.htm';}
if (wotSect==4){mainSection='Ante Natal Advice';mainSectionURL='antenatal.htm';}
if (wotSect==5){mainSection='Health Advice';mainSectionURL='health.htm';}
if (wotSect==6){mainSection='Sure Start Speke Puzzle Corner';mainSectionURL='games.htm';}

if (level>2){
  document.write('<a class="loc" href="'+mainSectionURL+'">'+mainSection+'</a>');
  document.write('&nbsp;<img src="images/sitestuff/bulletb.gif" width="5" height="7">');
  document.write('&nbsp;<b class="loc">'+theTitle+'</b>&nbsp;</td>');
}
else {
  document.write('<b class="loc">'+mainSection+'</b>&nbsp;');
}
document.write('<td class="topright">&nbsp;</td>');
document.write('<td class="dateLine"><script>putdate()</script></td>');
document.write('<td class="topright">&nbsp;</td></tr>');
}

var flash4installed = false;
var flash5installed = false;

function hasFlash(){
var i,s;
if (flash4installed||flash5installed) return(1);
if (!navigator.plugins) return(0);
if (navigator.plugins["Shockwave Flash"]){
  var flashDescription = navigator.plugins["Shockwave Flash"].description;
  var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".")-1));
  if (flashVersion>=5) return(1);
}
return(0);
}

function movieWriter(wotSect,bgclr){
var isIE=(navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin=(navigator.appVersion.indexOf("Windows") != -1) ? true : false;
jsVersion=1.1;
if(isIE && isWin) {
 document.write('<scr'+'ipt language=VBScript\> \n');
 document.write('on error resume next \n');
 document.write('flash4Installed=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
 document.write('flash5Installed=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');	
 document.write('flash6Installed=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');	
 document.write('</scr'+'ipt\>\n');
}
if (hasFlash()) {
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" \n');
  document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" \n');
  document.write('id=header width=755 height=70> \n');
  document.write('<param name=movie value="header.swf?sectid='+wotSect+'"> \n');
  document.write('<param name=quality value=high> \n');
  document.write('<param name=bgcolor value=#'+bgclr+'> \n');
  document.write('<embed src="header.swf?sectid='+wotSect+'" quality=high bgcolor=#'+bgclr+' width=755 height=70 type="application/x-shockwave-flash" \n');
  document.write('pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"> \n');
  document.write('<'+'/embed><'+'/object>');
}
  document.write('<'+'/td><'+'/tr>');
  document.write('<tr><td height="1" bgcolor="#000000">');
  document.write('<img src="images'+'/spacer.gif" width="755" height="1"><'+'/td><'+'/tr>');
  document.write('<tr><td height="3" bgcolor="#000000">');
  document.write('<img src="images'+'/spacer.gif" width="755" height="3"><'+'/td><'+'/tr><'+'/table><'+'/div>');
}


function spaceSetter(){
  document.write('<tr><td colspan="7" height="10" background="images'+'/sitestuff'+'/div03.gif">');
  document.write('<img src="images'+'/spacer.gif" width="755" height="10"><'+'/td><'+'/tr>');
  document.write('<tr><td width="3"><img src="images'+'/spacer.gif" width="3" height="1" alt=""><'+'/td>');
  document.write('<td width="134"><img src="images'+'/spacer.gif" width="134" height="1" alt=""><'+'/td>');
  document.write('<td width="3"><img src="images'+'/spacer.gif" width="3" height="1" alt=""><'+'/td>');
  document.write('<td width="475"><img src="images'+'/spacer.gif" width="475" height="1" alt=""><'+'/td>');
  document.write('<td width="3"><img src="images'+'/spacer.gif" width="3" height="1" alt=""><'+'/td>');
  document.write('<td width="134"><img src="images'+'/spacer.gif" width="134" height="1" alt=""><'+'/td>');
  document.write('<td width="3"><img src="images'+'/spacer.gif" width="3" height="1" alt=""><'+'/td><'+'/tr>');
}

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 sideButtonWriter(buttonNum,wotSect){
document.write('<tr><td width="3"><img src="images'+'/spacer.gif" width="3" height="1" alt=""><'+'/td><td valign="top">');
document.write('<div align="center">');
document.write('<center><table width="134" border="0" cellspacing="0" cellpadding="0">');
document.write('<tr><td height="4">'+'<img src="images'+'/sitestuff'+'/diva.gif" width="134" height="4"><'+'/td>'+'<'+'/tr>');
document.write('<tr><td class="buttonsHead">'+'Sections<'+'/td>'+'<'+'/tr>');
document.write('<tr><td height="5">'+'<img src="images'+'/sitestuff'+'/divb.gif" width="134" height="5">'+'<'+'/td>'+'<'+'/tr>');
document.write('<'+'/table><'+'/center><'+'/div>');
  
document.write('<div id="navcontainer"><ul id="navlist">');

var theRow="";
var theButtons=eval("theButtons"+wotSect);
var theButtonUrls=eval("theButtonsURLs"+wotSect);
for (var loop=0;loop<theButtons.length;loop++){
 if (buttonNum!=(loop+1)){
  var theRow='<li id="inactive">';
  theRow+='<a href="'+myUnescape(theButtonUrls[loop])+'.htm" id="notcurrent">'+myUnescape(theButtons[loop])+'<'+'/a>';
  document.write(theRow);
 }
 else{
  var theRow='<li id="active">';
  theRow+='<a href="'+myUnescape(theButtonUrls[loop])+'.htm" id="current">'+myUnescape(theButtons[loop])+'<'+'/a>';
  document.write(theRow);
 }
}
document.write('</ul></div>');
}

function pageHeadWriter(theTitle){
  document.write('<td valign="top" width="475">');
  document.write('<div align="center"><table border="0" cellspacing="0" cellpadding="0" width="471">');
  document.write('<tr><td height="4"><img src="images'+'/sitestuff'+'/div_main.gif" width="471" height="4"><'+'/td><'+'/tr>');
  document.write('<tr><td class="mainPagehead">'+theTitle+'<'+'/td><'+'/tr>');
  document.write('<tr><td height="5"><img src="images'+'/sitestuff'+'/divb.gif" width="471" height="5"><'+'/td><'+'/tr>');
  document.write('<tr><td valign="top">');
}

function glow(imgName) {
  if (document.images) {
    document[imgName].src = eval(imgName + "on.src");
  }
}

function fade(imgName) {
  if (document.images) {
    document[imgName].src = eval(imgName + "off.src");
  }
}

function swapImage(imgName,newImg){
  if ((navigator.appName == 'Netscape' && parseFloat(navigator.appVersion) >= 3) || (parseFloat(navigator.appVersion) >= 4)){		
		eval('document.' + imgName + '.src = "' + newImg + '"');
	}
}

function swap(id, newSrc) {
    var theImage = wotImage(document, id, 0);
    if (theImage) {
        theImage.src = newSrc;
    }
}

function wotImage(doc, name, j) {
    var theImage = false;
    if (doc.images) {
        theImage = doc.images[name];
    }
    if (theImage) {
        return theImage;
    }
    if (doc.layers) {
        for (j = 0; j < doc.layers.length; j++) {
            theImage = wotImage(doc.layers[j].document, name, 0);
            if (theImage) {
                return (theImage);
            }
        }
    }
    return (false);
}

function jumpWriter(colspanner){
 document.write('<tr><td colspan='+colspanner+' align="right"><a href="#top" ');
 document.write('onmouseover="dm(\'Click here to jump to the top of this page...\');return document.status;"');
 document.write('onmouseout="dm(\'\');return document.status;">');
 document.write('<img src="images/sitestuff/up_t.gif" alt="Jump to Top" width="12" height="7" border="0" vspace="8">');
 document.write('<'+'/a><'+'/td><'+'/tr>');
 document.write('<tr><td colspan='+colspanner+'>');
 document.write('<img src="images'+'/spacer.gif" width="20" height="6" hspace="0" vspace="0" border="0">');
 document.write('<'+'/td><'+'/tr>');
}

function jumpInserter(){
if (needJumper>0){
document.write('<div id="jumperDiv"><a href="#top">');
document.write('<img src="images/sitestuff/up.gif" alt="Jump to Top" width="13" height="13" hspace="0" vspace="0" border="0" title="Jump to Page Top">');
document.write('</a></div>');
}
}

function writeSWF(wotPath,wotFile,wotW,wotH,wotClr){
var isIE=(navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin=(navigator.appVersion.indexOf("Windows") != -1) ? true : false;
jsVersion=1.1;
if(isIE && isWin) {
 document.write('<scr'+'ipt language=VBScript\> \n');
 document.write('on error resume next \n');
 document.write('flash4Installed=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
 document.write('flash5Installed=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');	
 document.write('flash6Installed=(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');	
 document.write('</scr'+'ipt\>\n');
}
if (hasFlash()) {
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" \n');
  document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" \n');
  document.write('id='+wotFile+' width='+wotW+' height='+wotH+'> \n');
  document.write('<param name=movie value="'+wotPath+wotFile+'.swf"> \n');
  document.write('<param name=quality value=high> \n');
  document.write('<param name=bgcolor value=#'+wotClr+'> \n');
  document.write('<embed src="'+wotPath+wotFile+'.swf" quality=high bgcolor=#'+wotClr+' width='+wotW+' height='+wotH+' type="application/x-shockwave-flash" \n');
  document.write('pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"> \n');
  document.write('<'+'/embed><'+'/object>');
}
}

function endSpacer(){
 document.write('<tr><td colspan="5">');
 document.write('<img src="images/spacer.gif" width="10" height="10" alt="">');
 document.write('<'+'/td>');
 document.write('<td class="sidebarProjects"><img src="images/spacer.gif" width="10" height="10" alt="">');
 document.write('<'+'/td>');
 document.write('<td><img src="images/spacer.gif" width="3" height="10" alt="">');
 document.write('<'+'/td>');
 document.write('<'+'/tr>');
 document.write('<tr><td colspan="7">');
 document.write('<img src="images/spacer.gif" width="10" height="3" alt="">');
 document.write('<'+'/td><'+'/tr>');
}

function creditWriter(){
 document.write('<div align="center"><table border="0" cellpadding="0" cellspacing="0" width="759"><tr><td class="creditFooter">');
 document.write('site design &copy; <a class="creditFooter" href="http://www.macdigital-uk.com/" target="_blank">macdigital</a>');
 document.write('</td></tr></table></div>');
}

function spaceInserter(path,theCols,theHt){
 document.write('<tr><td colspan="'+theCols+'">');
 document.write('<img src="'+path+'images/spacer.gif" width="10" height="'+theHt+'" alt="">');
 document.write('<'+'/td><'+'/tr>');
}

function sideBoxTop(wotHeading){
 document.write('<table width="134" border="0" cellspacing="0" cellpadding="0">');
 document.write('<tr><td height="4"><img src="images/sitestuff/diva.gif" width="134" height="4"></td></tr>');
 document.write('<tr><td class="boxhead"><script>document.write('+wotHeading+');</script></td></tr>');
 document.write('<tr><td height="5"><img src="images/sitestuff/divb.gif" width="134" height="5"></td></tr>');
 document.write('<tr><td bgcolor="#eeeeee" align="center">');
}

function sideBoxBase(){
 document.write('</td></tr>');
 document.write('<tr><td height="14"><img src="images/sitestuff/divc.gif" width="134" height="14"></td></tr>');
 document.write('</table>');
}

/* Email Writer */

var tld_=new Array()
tld_[0]="com";
tld_[1]="org";
tld_[2]="net";
tld_[3]="ws";
tld_[4]="info";
tld_[10]="co.uk";
tld_[11]="org.uk";
tld_[12]="gov.uk";
tld_[13]="ac.uk";
var topDom_=13;
var m_="mailto:";
var a_="@";
var d_=".";

function mail(name,dom,tl,theSubj){
var s=e(name,dom,tl);
document.write('<a href="'+m_+s+theSubj+'">'+s+'</a>');
}

function doMail(name,dom,tl,theSubj,theLinkTxt,theStyle){
document.write('<a href="'+m_+e(name,dom,tl)+theSubj+'" class="'+theStyle+'">'+theLinkTxt+'</a>');
}

function e(name,dom,tl){
var s=name+a_;
if (tl!=-2){
s+= dom;
if (tl>=0)
 s+= d_+tld_[tl];
}
else
s+=swapper(dom);
return s;
}

function swapper(d){
var s="";
for (var i=0; i<d.length; i+=2)
  if (i+1==d.length)
  s+=d.charAt(i)
  else
  s+=d.charAt(i+1)+d.charAt(i);
  return s.replace(/\?/g,'.');
}
