// ydhr.js

//gb 15ap09 - Removed comment indicators from defineMainTable function
//	    - Fix slash in closing tag of top anchor
//	    - Remove top anchor from defineMainTable function
//gb 17my09 - modify menu to 1 item for regular trips and 1 for specials
//gb 22oc09 - Revert to standard title in maintitle()
//gb 29oc09 - Change menu from list to table to allow greater css flexibility
//gb 31oc09 - Added showWinter(), showRefundConditions()
//gb 02no09 - Added showSantaConditions()
//	    - Added Directions and FollowUs to menu
//gb 31de09 - Rework hotnews
//	    - Split History menu item into 2 components
//gb 04ja10 - Moify showServices to indicate 'regular trains'
//gb 04mr10 - Create showPopupPicture()
//gb 15jl10 - Modified ShowServices()

// Determine how wide the form should be
function defineMainTable()
{
  var wWidth=900;	
  //document.write("<a name=\"#top\"></a>");
  document.write("<table align=\"center\" width=\"" + wWidth + "\">");
}

// Main title for all pages
function maintitle()
{
  document.write("<div class=\"maintitle\">York-Durham Heritage Railway</div>");
//  document.write("<div class=\"maintitle\">Our schedules have changed<br>- trips on Saturday &amp; Sunday</div>");
}


// Hotnews is the top right corner of the title area
function hotnews()
{
  //document.write("<h4>Students - need hours to graduate? Contact</h4>");
  document.write("<div><b><font size=2 color=\"red\">Students - need hours to graduate?</b><br>Contact </font>");
  document.write("<small>");
  document.write(showemail("students","YDHR student inquiry"));
  document.write("</small>");
  document.write("</div>");
}


// Create menu for all pages  obsolete oct 29-09
function menuAsList()
{
  document.write("<div id=\"menu\">");
  document.write("<ul>");

  document.write("<li><a href=\"index.html\">Home</a></li>");
  document.write("<li><font color=\"blue\"> Schedule &amp; fares:</font><br>");
  document.write("&nbsp;&nbsp;&nbsp;<a href=\"Schedule.html\"> Regular Trips</a><br>");
  document.write("&nbsp;&nbsp;&nbsp;<a href=\"SpecialEvents.html\"> Special Events</a></li>");
  document.write("<li><a href=\"FAQ.html\"> Questions?</a></li>");
  document.write("<li><font color=\"blue\"> Maps to:</font><br>");
  document.write("&nbsp;&nbsp;&nbsp;<a href=\"Stouffville.html\">Stouffville</a><br>");
  document.write("&nbsp;&nbsp;&nbsp;<a href=\"Uxbridge.html\">Uxbridge</a></li>");
  document.write("<li><a href=\"Bookings.html\"> Corporate Events, Private Bookings &amp; Movie Shoots</a></li>");
  document.write("<li><a href=\"News.html\"> Latest News</a></li>");
  document.write("<li><a href=\"AboutUs.html\"> About us &amp; Membership</a></li>");
  document.write("<li><a href=\"Volunteers.html\"> Volunteer Activities</a></li>");
  document.write("<li><a href=\"Supporters.html\"> Supporters & Contributing</a></li>");
  document.write("<li><a href=\"History.html\"> History</a></li>");
  document.write("<li><a href=\"RollingStock.html\"> Rolling Stock</a></li>");
  document.write("<li><a href=\"Links.html\"> Links</a></li>");
  document.write("<li><a href=\"Contact.html\"> Contact Us</a></li>");

  document.write("</ul>");
  document.write("</div>");
}


// Create menu for all pages  Menu displayed as a table  Oct 29-09
function menu()
{
  document.write("<div id=\"menu\">");
  document.write("<table id=\"menutable\">");

  document.write("<tr><td><a href=\"index.html\">Home</a></td></tr>");
  document.write("<tr><td>Schedule &amp; fares:<br>");
  document.write("&nbsp;&nbsp;&nbsp;<a href=\"Schedule.html\"> Regular Trips</a><br>");
  document.write("&nbsp;&nbsp;&nbsp;<a href=\"SpecialEvents.html\"> Special Events</a></td></tr>");
  document.write("<tr><td><a href=\"FAQ.html\"> Questions?</a></td></tr>");
  document.write("<tr><td>Maps to:<br>");
  document.write("&nbsp;&nbsp;&nbsp;<a href=\"Stouffville.html\">Stouffville</a><br>");
  document.write("&nbsp;&nbsp;&nbsp;<a href=\"Uxbridge.html\">Uxbridge</a><br>");
  document.write("&nbsp;&nbsp;&nbsp;<a href=\"Directions.html\">Directions</a></td></tr>");
  document.write("<tr><td><a href=\"Bookings.html\"> Corporate Events, Private Bookings &amp; Movie Shoots</a></td></tr>");
  document.write("<tr><td><a href=\"News.html\"> Latest News</a></td></tr>");
  document.write("<tr><td><a href=\"AboutUs.html\"> About us &amp; Membership</a></td></tr>");
  document.write("<tr><td><a href=\"Volunteers.html\"> Volunteer Activities</a></td></tr>");
  document.write("<tr><td><a href=\"Supporters.html\"> Supporters & Contributing</a></td></tr>");
  document.write("<tr><td>History:<br>");
  document.write("&nbsp;&nbsp;&nbsp;<a href=\"HistoryOfTheYDHRA.html\"> of the YDHRA</a><br>");
  document.write("&nbsp;&nbsp;&nbsp;<a href=\"HistoryOfTheLine.html\"> of the Rail Line</a></td></tr>");
  document.write("<tr><td><a href=\"RollingStock.html\"> Rolling Stock</a></td></tr>");
  document.write("<tr><td><a href=\"Links.html\"> Links</a></td></tr>");
  document.write("<tr><td><a href=\"FollowUs.html\"> Follow Us</a></td></tr>");
  document.write("<tr><td id=\"lastentry\"><a href=\"Contact.html\"> Contact Us</a></td></tr>");

  document.write("</table>");
  document.write("</div>");
}

// Create a hyperlink with email address and subject
function showemail(addr, subject)
{
  var url1="ydhr.on";
  var htmlcode="<a href="+"\"mailto:";

  htmlcode=htmlcode+addr;
  htmlcode=htmlcode+"@";
  htmlcode=htmlcode+url1;
  htmlcode=htmlcode+".ca?Subject=";
  htmlcode=htmlcode+subject;
  htmlcode=htmlcode+"\"";
  htmlcode=htmlcode+">";
  htmlcode=htmlcode+addr;
  htmlcode=htmlcode+"@";
  htmlcode=htmlcode+url1;
  htmlcode=htmlcode+".ca</a>";		
  return htmlcode;
}


function backToTop()
{
    document.write("<div class=\"normal\"><a href=\"#top\">back to top</a></div>");
}


function showNoRespons()
{
  document.write("<div class=\"norespons\">");
  document.write("Notice: The York-Durham Heritage Railway has no control over and takes no responsibility for the content, design, useability or suitability of any external website that we provide links to.");
  document.write("</div>");
}


function showservices()
{
  document.write("<hr>");
  document.write("<div class=\"services\">");
  document.write("All of our regular trains are equipped with a wheelchair accessible washroom and concession stand for coffee, cold drinks and confections.&nbsp;&nbsp;");
  document.write("</div>");
}


function showWinter()
{
  document.write("<hr>");
  document.write("<div class=\"services\">");
  document.write("Our Santa Trains will have a minimum level of heat.  Please dress warmly.");
  document.write("</div>");
}

function showRefundConditions(drawHr)
{
  if( drawHr==true) document.write("<hr>");
  document.write("<div class=\"rights\">");
  document.write("No refunds, unless event cancelled due to inclement weather.<br>");
  document.write("</div>");
}

function showSantaConditions(drawHr)
{
  if( drawHr==true) document.write("<hr>");
  document.write("<div class=\"rights\">");
  document.write("No refunds, unless event cancelled due to inclement weather.<br>"
		+"Free ride and/or discount vouchers not valid for Santa Trains.");
  document.write("</div>");
}

function showrights()
{
  document.write("<hr>");
  document.write("<div class=\"rights\">");
  document.write("The YDHR reserves the right to change fares, schedules, activities, equipment and departure points without notice.");
  document.write("</div>");
}


function showfooter()
{
  document.write("<hr>");
  document.write("<div class=\"footer1\">");
  document.write("The York-Durham Heritage Railway is operated entirely by volunteers of the York-Durham Heritage Railway Association.<br>");
  document.write("</div>");
  document.write("<div class=\"footer2\">");
  document.write("&copy; 2010, York-Durham Heritage Railway Association - All Rights Reserved.");
  document.write("</div>");
}

// Create popup for use by the Route Map to images along the way

var popup = window.createPopup();

function showPopupPicture(imgURL,refObj)
{
  popup.document.body.innerHTML = '<img src='+imgURL+' width=200 height=150 />';
  popup.show(500, 325, 200, 150, refObj);
  return false;
}
