var bgclr='ffffff';

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 clrovr(hiliteclr){
  if(jsvers>1.1){
  source=event.srcElement
  if (source.tagName=="TR"||source.tagName=="table")
  return
  while(source.tagName!="TD")
  source=source.parentElement
  if (source.style.backgroundColor!=hiliteclr&&source.id!="ignore")
  source.style.backgroundColor=hiliteclr
  }
}

function clrout(origclr){
  if(jsvers>1.1){
  if (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")
  return
  if (event.toElement!=source)
  source.style.backgroundColor=origclr
  }
}

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;
}

if (wotSec==0){
  if ((wotPage=="sitemap")||(wotPage=="privacypolicy")||(wotPage=="disclaimer")){
   var rootLevel=1;
   var imgPath="";
   var thePath="";
   var homeBtnClass="catHead";
  }
  //else if(wotPage=="index"){
  //var homeBtnClass="catHead_on";
  //}
}
else{
  var rootLevel=0;
  var imgPath="../";
  var thePath="../";
  var homeBtnClass="catHead";
}


b1Pth=thePath+"aboutus/";
btns1=new Array("background","meet+the+staff","working+in+partnership","awards","news","contact+us");
btnsURLs1=new Array((b1Pth+"background"),(b1Pth+"staff"),(b1Pth+"partners"),(b1Pth+"awards"),(b1Pth+"news"),(b1Pth+"contact"));

b2Pth=thePath+"services/";
btns2=new Array("enterprise+development","power+programme","business+loan+fund","consultancy","faqs");
btnsURLs2=new Array((b2Pth+"enterprise"),(b2Pth+"power"),(b2Pth+"loanfund"),(b2Pth+"consultancy"),(b2Pth+"faqs"));

b3Pth=thePath+"casestudies/";
btns3=new Array("ninnynoo designs","st. peter & paul a.s.c.","pod bar restaurant","wild woman");
btnsURLs3=new Array((b3Pth+"ninnynoo"),(b3Pth+"peterpaul"),(b3Pth+"pod"),(b3Pth+"wildwoman"));

mainBtns=new Array("about us","our services","case studies");
mainBtnsURLs=new Array("xxx","xxx","xxx");

var buttonNum;
if (wotSec=="1"){
if (wotPage=="background") {buttonNum="1"};
if (wotPage=="staff") {buttonNum="2"};
if (wotPage=="partners") {buttonNum="3"};
if (wotPage=="awards") {buttonNum="4"};
if (wotPage=="news") {buttonNum="5"};
if (wotPage=="contact") {buttonNum="6"};
}
if (wotSec=="2"){
if (wotPage=="enterprise") {buttonNum="1"};
if (wotPage=="power") {buttonNum="2"};
if (wotPage=="loanfund") {buttonNum="3"};
if (wotPage=="consultancy") {buttonNum="4"};
if (wotPage=="faqs") {buttonNum="5"};
}
if (wotSec=="3"){
if (wotPage=="ninnynoo") {buttonNum="1"};
if (wotPage=="peterpaul") {buttonNum="2"};
if (wotPage=="pod") {buttonNum="3"};
if (wotPage=="wildwoman") {buttonNum="4"};
}


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

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

  wHead+='<div class="menuHd"><img src="'+imgPath+'images/bgnd/menuhead_'+eval(loop+1)+'.gif" width="180" height="20" hspace="0" vspace="0" border="0"></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"><div class="btnWrap"><a href="'+myUnescape(theBtnsURLs[bLoop])+'.htm" class="bOff" title="Click here to visit ';
      wHead+='the &quot;'+myUnescape(theBtns[bLoop])+'&quot; page">'+myUnescape(theBtns[bLoop])+' </a></div> </li>';
    }
    else{
      if (wotSec==(eval(loop+1))){
        wHead+='<li class="active"><div class="btnWrap" valign="middle"><a href="'+myUnescape(theBtnsURLs[bLoop])+'.htm" class="bOn" ';
        wHead+='title="Click here to reload this page">'+myUnescape(theBtns[bLoop])+' </a></div> </li>';
      }
      else{
        wHead+='<li class="inactive"><div class="btnWrap"><a href="'+myUnescape(theBtnsURLs[bLoop])+'.htm" class="bOff" title="Click here to visit ';
        wHead+='the &quot;'+myUnescape(theBtns[bLoop])+'&quot; page">'+myUnescape(theBtns[bLoop])+' </a></div> </li>';
      }
   }
  }
  wHead+='</ul>';
  wHead+='</div>';//ss_ var
  wHead+='</div>';//section_ var
}

wHead+='<div class="iip_logo">';
wHead+='<img src="'+imgPath+'images/logos/iip_logo.gif" width="180" height="94" hspace="0" vspace="0" border="0">';
wHead+='</div>';

wHead+='</div>'; // btn_contents
wHead+='</div>'; // navPanel

wHead+='<div id="mainPgContent">';

wHead+='<div id="pageH">'+pageTitle+'</div>';

if (pagePic!=""){
wHead+='<div class="mainPic">';
wHead+='<img src="'+picPath+pagePic+'" alt="'+pagePicCap+'" title="'+pagePicCap+'" width="'+pW+'" height="'+pH+'" hspace="0" vspace="0" border="0" class="bigPicClass">';
wHead+='</div>'; // mainPic

//wHead+='<div class="mainPicCaption">';
//wHead+=''+pagePicCap+'';
//wHead+='</div>'; // mainPic

}

wHead+='<div id="textwrap">';
document.write(wHead);
}

function ender(){
var wFoot='';
wFoot+='</div>'; // textwrap
wFoot+='<div id="fLine"></div>';
wFoot+='</div>'; // mainPgContent
wFoot+='</div>'; // cBox
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>'; // creditFooter

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

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>');
}

