// JavaScript functions to insert common code into web pages.
// With thanks and acknowledgement to Peter Hayward of the Haggerleases Light Railway, http://www.haggerleases.co.uk

// Write the last update date on the calling page - my first ever bit of JavaScript!
function DateStamp() {
 var lud = new Date(document.lastModified);
  document.writeln("<p>"); 
  document.writeln("This page last updated: "+ lud.getDate()+ "/" +(lud.getMonth()+1)+ "/" + lud.getFullYear() + ""); 
  document.writeln("</p>"); 
}

// write contact email address 
function emailLink() {
  var part1="scampington-chipside.";
  var part2="uk";
  var part3="admin";
  var part4="co.";
  document.write("<a onFocus='if(this.blur)this.blur()' href='mailto:");
  document.write(part3);
  document.write("@");
  document.write(part1);
  document.write(part4);
  document.write(part2);
  document.write("?subject=The Scampington and Chipside Garden Railway");
  document.write("'>");
  document.write(part3);
  document.write("@");
  document.write(part1);
  document.write(part4);
  document.write(part2);
  document.write("</a>");
}

// write slideshow string

function slideshow(add_url) {
SsWindow=window.open('', 'SShow', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, left=100, top=80');
SsWindow.document.close();
doc=SsWindow.document.open();
x=650;
y=560;
doc.write('<html><head>');
doc.write('<script>window.resizeTo('+x+','+y+')</script>');
doc.write('<style type="text/css">@import "style/scgr_style.css";</style>');
doc.write('<script type="text/javascript" src="js/ufo.js"></script>');

doc.write ('<script type="text/javascript">')
doc.write ('var FO = {'); 
doc.write('movie:"http://w211.photobucket.com/pbwidget.swf?pbwurl=http://w211.photobucket.com/albums/bb256/clive_t/Figures/'+add_url+'", width:"640", height:"480", majorversion:"8", build:"0", xi:"true" };');
doc.write('UFO.create(FO, "ufoWindow");');
doc.write ('</script>');


doc.write('</head>');
doc.write('<body>');

doc.write('<div id="ufoWindow">');

doc.write('<p>Replacement content</p>');

doc.write('<p><a href="http://www.macromedia.com/go/getflashplayer">');
doc.write('<img src="http://www.macromedia.com/images/shared/download_buttons/get_flash_player.gif" alt="Get macromedia Flash Player" style="border: none;" />');
doc.write('</a></p></div>');
//doc.write('<p>Test Line</p>');
doc.write('</body></html>');
doc.focus();
}