// script for main page title, pageprint and pagelevel
// created by P.Hobbs - EUdesign.com - April 2005
//
// amended May 2006 to include pagebase signoff and improved header setting

function mtit(ptit,ppr,plev) {
  pNum()
  document.writeln('<DIV>')
  document.writeln('<TABLE WIDTH=90% ALIGN="center" CELLPADDING=5 CELLSPACING=0 BORDER=1>')
  document.writeln('<TH ALIGN="left">')
  document.writeln('<FONT FACE="Verdana, Arial, Helvetica, sans-serif" COLOR="#ffcc00" SIZE=4>')
  document.writeln('  Alsigns-Surelite')
  document.writeln('  <SUP><BIG>')
  document.writeln('  <FONT COLOR="#6699ff">____</FONT>')
  document.writeln('  <FONT COLOR="#ff66cc">___</FONT>')
  document.writeln('  <FONT COLOR="#ffff00">__</FONT>')
  document.writeln('  <FONT COLOR="#66ff00">_</FONT>')
  document.writeln('  </BIG></SUP>')
  document.writeln('<NOBR>'+ptit+'</NOBR></FONT></TH>')
  document.writeln('</TABLE>')
  document.writeln('</DIV>')
  document.writeln('<DIV>')
  var pfont='<FONT FACE="Verdana, Arial, Helvetica, sans-serif" SIZE=1>'
  document.writeln('<TABLE WIDTH="90%" ALIGN="center" CELLPADDING=0 CELLSPACING=0 BORDER=0>')
  document.writeln('<TD ALIGN="left">')
  document.writeln(pfont)
  document.writeln('<A HREF="http://www.surelite.co.uk/" TARGET="_new">www.surelite.co.uk</A></FONT></TD>')
  if (ppr) {
    var subd='', pimg='imgs/clipart/printer.gif'
    for (var i=1;i<=plev;i++) {subd+='../'}
    document.writeln('<TD ALIGN="right">')
    document.writeln(pfont)
    var pim='<IMG SRC="'+subd+pimg+'" ALIGN="center" WIDTH=19 HEIGHT=18 ALT="Get Print Version" BORDER=0>'
    var pref='p_'+location.href.substr(location.href.lastIndexOf('/')+1)
    document.writeln('<A HREF="'+pref+'" TARGET="_blank">')
    document.writeln(pim+'Get Print Version'+pim+'</A></FONT></TD>')
  }
  document.writeln('</TABLE>')
  document.write('</DIV>')
}

var pNo="x",pRev,pFwd,hComm		// global
function pNum(){
var fTit=location.href.substr(location.href.lastIndexOf('/')+1)
  for (var i=1;i<tal;i++) { 	// chk for match
    if (pList[i].pAdd==fTit) {
      pNo=i; i=tal
    }
  }
  if (pNo=="x") return		// stop if unlisted
  pRev=pNo-1,pFwd=pNo+1		// calc. prev & next
  if (pRev=="") pRev=tal-1
  if (pFwd==tal) pFwd=1
//alert('pRev='+pRev+'\npNo='+pNo+'\npFwd='+pFwd)
  hComm=location.href.substr(0,location.href.length-fTit.length)
//alert('location.href='+location.href+'\nhComm='+hComm)
  tdir(hComm+pList[pRev].pAdd,hComm+pList[pFwd].pAdd)
}

function tdir(tr,tf) {
  document.writeln('<DIV>')
  document.writeln('<TABLE WIDTH=90% ALIGN="center" CELLPADDING=5 CELLSPACING=0 BORDER=0>')
  document.writeln('<TH WIDTH=30% ALIGN="left">')
  document.writeln('<FONT FACE="Verdana, Arial, Helvetica, sans-serif" COLOR="#ffffff" SIZE=1>')
  document.writeln('  <A HREF="'+tr+'">Tour back</A></TH>')
  document.writeln('<TH WIDTH=40% ALIGN="center">')
  document.writeln('<FONT FACE="Verdana, Arial, Helvetica, sans-serif" COLOR="#ffffff" SIZE=1>')
  document.writeln('  Page '+pNo+'</TH>')
  document.writeln('<TH WIDTH=30% ALIGN="right">')
  document.writeln('<FONT FACE="Verdana, Arial, Helvetica, sans-serif" COLOR="#ffffff" SIZE=1>')
  document.writeln('  <A HREF="'+tf+'">Tour forward</A></TH>')
  document.writeln('</TABLE>')
  document.write('</DIV>')
}

function bdir() {
  document.writeln('<DIV>')
  document.writeln('<TABLE WIDTH=90% ALIGN="center" CELLPADDING=5 CELLSPACING=0 BORDER=1>')
  document.writeln('<TH WIDTH=30% ALIGN="left">')
  document.writeln('<FONT FACE="Verdana, Arial, Helvetica, sans-serif" COLOR="#ffffff" SIZE=1>')
  document.writeln('  <A HREF="'+pList[pRev].pAdd+'">Tour back</A></TH>')
  document.writeln('<TH WIDTH=40% ALIGN="center">')
  document.writeln('<FONT FACE="Verdana, Arial, Helvetica, sans-serif" COLOR="#ffffff" SIZE=1>')
  document.writeln('  Page '+pNo+'</TH>')
  document.writeln('<TH WIDTH=30% ALIGN="right">')
  document.writeln('<FONT FACE="Verdana, Arial, Helvetica, sans-serif" COLOR="#ffffff" SIZE=1>')
  document.writeln('  <A HREF="'+pList[pFwd].pAdd+'">Tour forward</A></TH>')
  document.writeln('</TABLE>')
  document.write('</DIV>')
}

function bsign(yr) {
  document.writeln('<H6 ALIGN="center">')
  document.write('<FONT COLOR="#ffcc00">&copy; '+yr+'2010 Alsigns - Surelite Division - All Rights Reserved</FONT></H6>')
}