//Updated by Dave Thomas on 24th October 2007

function writeHeader()

{

//Script to write the two bars at the top of the page and (eventually) to add the breadcrumb links
//Last modified on 24th October 2007 by Dave Thomas

var title=document.title

//Write top message bar

document.writeln('<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" COLS="1" ROWS="5" WIDTH="100%">');
document.writeln('<TR>');
document.writeln('<TD ALIGN="CENTER" BGCOLOR="#986717" HEIGHT="25px"><FONT FACE="Arial" Size="6">');

//Home page link

document.writeln('<B><A CLASS="header" HREF="index.htm" TITLE="Click Here to return to the DWVRT Home Page">Derwent & Wye Valley Railway Trust</A></FONT><FONT COLOR="WHITE" FACE="Arial" Size="4"><BR> &gt  ');

//put page title

document.writeln(title);


document.writeln('</B></FONT></TD>');
document.writeln('</TR><TR>');

document.writeln('<TD BGCOLOR="FFd700" HEIGHT="6px"></TD>');

document.writeln('</TR>');

//Horizontal menu

document.writeln('<TR>');
document.writeln('<TD>');

document.writeln('<div class="horizontalcssmenu">');
document.writeln('<UL id="cssmenu1">');

document.writeln('<LI style="border-left: 1px soLId #202020;"><A HREF="index.htm">Home</A></LI>');

document.writeln('<LI><A HREF="about.htm" >About</A></LI>');

document.writeln('<LI><A HREF="#">Projects</A>');
document.writeln('<UL>');
document.writeln('<LI><A HREF="downbuilding.htm">Down Building</A></LI>');
document.writeln('<LI><A HREF="water.htm">Watering Facilties</A></LI>');
document.writeln('<LI><A HREF="coach.htm">Coach</A></LI>');
document.writeln('</UL>');
document.writeln('</LI>');

document.writeln('<LI><A HREF="trustees.htm">Trustees</A></LI>');

document.writeln('<LI><A HREF="#">The Route</A></LI>');
document.writeln('<UL>');
document.writeln('<LI><A HREF="history.htm">History</A></LI>');
document.writeln('<LI><A HREF="ambergate.htm">Ambergate To Matlock</A></LI>');
document.writeln('<LI><A HREF="darley.htm">Darley Dale</A></LI>');
document.writeln('<LI><A HREF="chlane.htm">Church Lane Crossing</A></LI>');
document.writeln('<LI><A HREF="rowsley.htm">Rowsley</A></LI>');
document.writeln('<LI><A HREF="bakewell.htm">Rowsley To Bakewell</A></LI>');
document.writeln('<LI><A HREF="hassop.htm">Hassop</A></LI>');
document.writeln('<LI><A HREF="gtlongst.htm">Great Longstone</A></LI>');
document.writeln('<LI><A HREF="monsal.htm">Monsal Head</A></LI>');
document.writeln('<LI><A HREF="millers.htm">Millers Dale</A></LI>');
document.writeln('<LI><A HREF="blackwell.htm">Blackwell Mill</A></LI>');
document.writeln('<LI><A HREF="buxton.htm">Buxton</A></LI>');
document.writeln('</UL>');
document.writeln('</LI>');

document.writeln('<LI><A HREF="pictures.htm">Pictures</A></LI>');

document.writeln('<LI><A HREF="#"">Donate</A></LI>');
document.writeln('<UL>');
document.writeln('<LI><A HREF="giftaid.htm">Gift Aid</A></LI>');
document.writeln('<LI><A HREF="payroll.htm">Payroll Giving</A></LI>');
document.writeln('<LI><A HREF="shares.htm">Shares, Securites, etc</A></LI>');
document.writeln('<LI><A HREF="selfass.htm">Self Assessment</A></LI>');
document.writeln('</UL>');
document.writeln('</LI>');


document.writeln('<LI><A HREF="#">Web Links</A>');
document.writeln('<UL>');
document.writeln('<LI><A HREF="http://www.peakrail.co.uk">Peak Rail</A></LI>');
document.writeln('<LI><A HREF="http://www.peakrailvols.org.uk">Peak Rail Volunteering</A></LI>');
document.writeln('<LI><A HREF="http://www.rowsleyassociation.org.uk">The Rowsley Association</A></LI>');
document.writeln('<LI><A HREF="http://www.derby-signalling.org.uk">Derby Signalling</A></LI>');
document.writeln('</UL>');
document.writeln('</LI>');

document.writeln('</UL>');

document.writeln('</DIV>');

document.writeln('</TR>');
document.writeln('</TD>');
document.writeln('</TABLE>');

}



// Gallery script.
// With image cross fade effect for those browsers that support it.


function LoadGallery(pictureName,imageFile,titleCaption,captionText)
{
  if (document.all)
  {
    document.getElementById(pictureName).style.filter="blendTrans(duration=1)";
    document.getElementById(pictureName).filters.blendTrans.Apply();
  }
  document.getElementById(pictureName).src = imageFile;
  if (document.all)
  {
    document.getElementById(pictureName).filters.blendTrans.Play();
  }
  document.getElementById(titleCaption).innerHTML=captionText;
}


//Page Last Updated insert

function updated()

{

var da = new Date(document.lastModified); // Create a Date Object set to the last modifed date 
var db = da.toGMTString(); // Convert to a String in UK format
var dc = db.split(" "); // Split the string on spaces 

if ( eval( dc[3] ) < 1970 ) dc[3] = eval( dc[3] ) +100; // Correct any date purporting to be before 1970 

db = dc[1] + " " + dc[2] + " " + dc[3]; // Ignore day of week and combine date, month and year 

document.write ('<FONT SIZE=-1>Page Last Updated ' + db + ' by <A HREF="mailto:webmaster@dwvrt.org.uk">webmaster@dwvrt.org.uk</A></FONT>'); // Display the result 

}

//Charity and Company Details Page Footer


function footer()

{


document.writeln('<H5>The Derwent and Wye Valley Railway Trust (Limited by Guarantee). Registered Charity no. 1109543<BR>Registered office Matlock Station Station Yard Matlock Derbyshire DE4 3NA<BR>Company registered in England and Wales no. 05285448</H5>')

}


//Drop Down Menu

var cssmenuids=["cssmenu1"] //Enter id(s) of CSS Horizontal UL menus, separated by commas
var csssubmenuoffset=-1 //Offset of submenus from main menu. Default is 0 pixels.

function createcssmenu2(){
for (var i=0; i<cssmenuids.length; i++){
  var ultags=document.getElementById(cssmenuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
			ultags[t].style.top=ultags[t].parentNode.offsetHeight+csssubmenuoffset+"px"
    	var spanref=document.createElement("span")
			spanref.className="arrowdiv"
			spanref.innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;"
			ultags[t].parentNode.getElementsByTagName("a")[0].appendChild(spanref)
    	ultags[t].parentNode.onmouseover=function(){
					this.style.zIndex=100
    	this.getElementsByTagName("ul")[0].style.visibility="visible"
					this.getElementsByTagName("ul")[0].style.zIndex=0
    	}
    	ultags[t].parentNode.onmouseout=function(){
					this.style.zIndex=0
					this.getElementsByTagName("ul")[0].style.visibility="hidden"
					this.getElementsByTagName("ul")[0].style.zIndex=100
    	}
    }
  }
}

if (window.addEventListener)
window.addEventListener("load", createcssmenu2, false)
else if (window.attachEvent)
window.attachEvent("onload", createcssmenu2)

