
var soundspath="http://www.loco2807.steamrailways.com/sounds";
var videospath="http://www.loco2807.steamrailways.com/videos";
var imagespath="./images";
var filespath="http://www.loco2807.steamrailways.com/files";

function rnd(m)
 {
  var d=new Date();
  //var n=d.getSeconds()*d.getMinutes()*d.getSeconds();
  var n=d.getTime();
  n=(n%m)+1;
  n=Math.floor(n);
  if (n>m)
   {n=m}
  return n;
 }

function box1s(width,type)
 {
  if (type!="T")
    {
    if (box1s.arguments.length<1)
     {width='100%'}
    if (box1s.arguments.length<2)
     {colour='#FFFFCC';
      border='#996633'}
    else
      if (type=="M")
       {colour='#FFFFCC';
        border='#996633'}
      else
  //    if (type=="T")
  //     {colour='#FFFFF8';
  //      border='#FFFFF8'}
  //  else
	    if (type=="E")
         {colour='#EEFFEE'
		  border='#006600'}
		else
		  if (type=="H")
           {colour='#FFFFFF'
            border='#006600'}  
		  else
          {colour='#FFFFCC';
           border='#996633'}
    document.write('<table ALIGN=CENTER BGCOLOR="'+colour+'" WIDTH="'+width+'" cellspacing=0 cellpadding=0>');
    document.write('<TR><td bgcolor="'+border+'" colspan="3"><img src="x.gif" width="1" height="1" border="0" alt="">');
    document.write('</td></tr><tr><td bgcolor="'+border+'" width="1">');
    document.write('<img src="x.gif" width="1" height="1" border="0" alt=""></td><td><table width="100%" cellpadding=1><tr><td>');
   }
 } 

function box1f(type)
 {
  if (type!="T")
   {
    if (box1f.arguments.length<1)
     {border='#996633'}
    else
      if (type=="M")
       {border='#996633'}
      else
//      if (type=="T")
//       {border='#FFFFF8'}
//      else
	    if (type=="E")
         {border='#006600'}
		else
		  if (type=="H")
           {border='#006600'}
		  else
           {border='#996633'}
    document.write('</td></tr></table></td><td bgcolor="'+border+'" width="1"><img src="x.gif" width="1" height="1" border="0" alt="">');
    document.write('</td></tr><TR><td bgcolor="'+border+'" colspan="3">');
    document.write('<img src="x.gif" width="1" height="1" border="0" alt=""></td></tr></table>');
   }
 }

function box2s(width,type)
 {
  colour='#FFFFCC';
  document.write('<table ALIGN=CENTER BGCOLOR="'+colour+'" WIDTH="'+width+'" cellspacing=0 cellpadding=0 border=1>');
  document.write('<TR><td height=100%>');
 } 

function box2f(type)
 {
  document.write('</td></tr></table>');
 }

function margins(type)
 {
  if (margins.arguments.length<1)
   {type=30}
  if (type==30)
   {colour='#E0F4E0'
	border='#006600'}
  else
   {colour='#E0F4E0'
	border='#006600'}
  //t=new Array;h=new Array;
  //margini(t,h);  
  document.write('<table width="100%" cellspacing=0 cellpadding=0 border=0>');
  document.write('<tr><td width=5 height="100%" bgcolor="'+border+'">');
  document.write('<img src="x.gif" width="1" height="1" border="0" alt=""></td>');
  document.write('<td width="15%" height="100%"><table width="100%" height="100%" cellspacing=0 cellpadding=2>');
  document.write('<tr><td height=1 bgcolor="'+border+'"></td></tr>');
  document.write('<tr><td height="100%" align=right valign=top bgcolor="'+colour+'" class="margintext">');
  document.write(t[1]);for(var i=2;i<9;i++){document.write("<br><br><br>"+t[i]);}
  //document.write('<br><br><iframe src="http://rcm-uk.amazon.co.uk/e/cm\?t=cotswoldsteam-21\&o=2\&p=44\&l=ur1\&category=books\&banner=05C7W7RCHV1P8B2MBA82\&f=ifr" width="100" height="70" scrolling="no" border="0" marginwidth="0" style="border:none;" frameborder="0"></iframe>');
  document.write('</td></tr><tr><td height=1 bgcolor="'+border+'"></td></tr></table></td>');
  document.write('<td width=5 height="100%" bgcolor="'+border+'"><img src="x.gif" width="1" height="1" border="0" alt=""></td>');
  document.write('<td width=6 height="100%" bgcolor=#ffffff><img src="x.gif" width="6" height="1" border="0" alt=""></td>');
  document.write('<td width="70%" valign="top">');
 }

//function margini(t,h)
 //{
  t=new Array;h=new Array;
  t[1]="Help us complete 'a 28 for 2008' by investing in <a href='shares.htm'>'The Final Push'</a>";
  t[2]="Become a <A HREF='shares.htm'>shareholder</A> or <A HREF='friend.htm'>friend of 2807</A>";
  t[3]="See our range of OO gauge models, leisurewear and other items at the <A HREF='shop.htm'>2807 shop</a>";
  t[4]="Join our <a href='club100.htm'>100 Club</a>";
  t[5]="Make a <a href='donate01.htm'>donation</a> to the project";
  t[6]="Don't miss our Special Offers on <a href='shares.htm'>shares</a> and in our <a href='firebar.htm'>Firebar Appeal</a>";
  t[7]="Find the latest restoration news in our <a href='restored.htm'>restoration diary</a> and the high level plan on our <a href='restore.htm'>restoration page</a>";
  t[8]="Find out <a href='why2807.htm'>why</a> we're restoring No.&nbsp;2807";
  h[1]="<A HREF='articles.htm'>articles</A>";
  h[2]="<A HREF=salesstd.htm>bric-a-brac</A>";
  h[3]="<A HREF='club100.htm'>100 Club</A>";
  h[4]="<a href='contacts.htm'>contact us</a>";
  h[5]="<A HREF='data.htm'>data</A>";
  h[6]="<A HREF='donate01.htm'>donate</A>";
  h[7]="<A HREF='firebar.htm'>firebar appeal</A>";
  h[8]="<A HREF='friend.htm'>become a friend of 2807</A>";
  h[9]="<A HREF='gallery.htm'>gallery</A>";
  h[10]="<A HREF='helpus.htm'>ways to help us</A>";
  h[11]="<A HREF='history.htm'>history</A>";
  h[12]="<A HREF='links.htm'>links to other web sites</A>";
  h[13]="<A HREF='medias.htm'>media scrapbook</A>";
  h[14]="<A HREF='newsreq.htm'>free magazine</a>";
  h[15]="<A HREF='news.htm'>news</a>";
  h[16]="<A HREF='puzzles.htm'>puzzles</a>";
  h[17]="<A HREF='qanda.htm'>Q & A</a>";
  h[18]="<A HREF='./files/raffle09.pdf'>2807 raffle</A>";
  h[19]="<A HREF='resource.htm'>resources</A>";
  h[20]="<A HREF='restore.htm'>restoration</A>";
  h[21]="<A HREF='restored.htm'>restoration diary</A>";
  h[22]="<a href='workprty.htm'>restoration team page and calendar</a>"; 
  h[23]="<A HREF=salesstd.htm>sales stand</A>";
  h[24]="<A HREF='shares.htm'>shares</A>";
  h[25]="<A HREF='shop.htm'>shop</A>";
  h[26]="<A HREF='sponsor1.htm'>sponsorship</A>";
  h[27]="<A HREF='timeline.htm'>timeline</A>";
  h[28]="<a href='why2807.htm'>why no. 2807?</a>";
 //}
 
function marginf(type)
 {
  if (marginf.arguments.length<1)
   {type=30}
  if (type==30)
   {colour='#E0F4E0'
	border='#006600'}
  else
   {colour='#E0F4E0'
	border='#006600'}
  //t=new Array;h=new Array;
  //margini(t,h);
  document.write('</td><td width=6 height="100%" bgcolor="#ffffff">');
  document.write('<img src="x.gif" width="6" height="1" border="0" alt=""></td>');
  document.write('<td width=5 height="100%" bgcolor="'+border+'">');
  document.write('<img src="x.gif" width="1" height="1" border="0" alt=""></td>');
  document.write('<td width="15%" height="100%">');
  document.write('<table width="100%" height="100%" cellspacing=0><tr><td height=1 bgcolor="'+border+'"></td></tr>');
  document.write('<tr><td height="100%" align=left valign=top bgcolor="'+colour+'" class="margintext">');
  document.write(h[1]);for(var i=2;i<29;i++){document.write('<br>'+h[i]);}
  //document.write('<br><br><iframe src="http://rcm-uk.amazon.co.uk/e/cm?t=cotswoldsteam-21&o=2&p=44&l=ur1&category=dvd&banner=0EAYDGK77NRFCPKTPG82&f=ifr" width="100" height="70" scrolling="no" border="0" marginwidth="0" style="border:none;" frameborder="0"></iframe>');
  document.write('</td></tr><tr><td height=1 bgcolor="'+border+'"></td></tr></table></td>');
  document.write('<td width=5 height="100%" bgcolor="'+border+'">');
  document.write('<img src="x.gif" width="1" height="1" border="0" alt=""></td></table>');
 }

function rels()
 {
  box1s();
  document.write('<div class="relatedtext"><br><h4>Related Pages:</h4>');
 } 
 
function relf()
 {
  document.write("<br clear=all></div>");
  box1f();
 }

  a=new Array;

  a[1]="We've got an excellent 80-minute railway DVD on sale in our <A HREF=shop.htm>shop</a>.";
  a[2]='Sponsor a firebar in our <a href="firebar.htm">Firebar&nbsp;Appeal</a>.';
  a[3]="See our range of cuddly toys at the <A HREF=shop.htm#hhct>2807&nbsp;shop</a>.";
  a[4]="Help restore 2807 to steam again by purchasing&nbsp;<A HREF=shares.htm>shares</A>.";
  a[5]="See our range of railware at the <A HREF=shop.htm#hhrw>2807&nbsp;shop</a>.";
  a[6]="Help us complete 'a 28 for 2008' by investing in <a href='shares.htm'>'The Final Push'</a>.";
  a[7]="Help restore 2807 to steam again by joining our&nbsp;<A HREF=club100.htm>100 club</A>.";
  a[8]="See our range of OO gauge models at the <A HREF=shop.htm#hhoogm>2807&nbsp;shop</a>.";
  a[9]="Join <A HREF=friend.htm>friends&nbsp;of&nbsp;2807</a>.";
  a[10]="See our range of leisure-wear at the <A HREF=shop.htm#hhlw>2807&nbsp;shop</a>.";
  a[11]="Help restore 2807 to steam by joining the <A HREF=workprty.htm>restoration&nbsp;team</a>.";
  a[12]="See the full range of items at the <A HREF=shop.htm>2807&nbsp;shop</a>.";

  
function ad1(ad)
 {
  if (ad=="r" || ad=="R")
   {ad=rnd(12)}
  else
   {if (ad > 12)
    {ad = rnd(12)}
   }
  box1s();
  document.write('<table ALIGN=CENTER BGCOLOR=#FFFFCC WIDTH=100% cellspacing=0><TR><TD align=center class="adtext">' + a[ad] + '</td></tr></table>');
  //document.write(a[ad]);
  box1f();
 }

function amazon(type)
 {
  if (type==10) // Generic Banner
   {
    box1s('100%','E');
    document.write('<center><br><iframe src="http://rcm-uk.amazon.co.uk/e/cm?t=cotswoldsteam-21&o=2&p=42&l=ur1&category=generic&banner=1CAPSKFWJ41SG7Z4NN82&f=ifr" width="234" height="60" scrolling="no" border="0" marginwidth="0" style="border:none;" frameborder="0"></iframe></center><br>');
	box1f('E');
   }
  if (type==20) // Generic Banner, no box
   {
    document.write('<center><br><iframe src="http://rcm-uk.amazon.co.uk/e/cm?t=cotswoldsteam-21&o=2&p=42&l=ur1&category=generic&banner=1CAPSKFWJ41SG7Z4NN82&f=ifr" width="234" height="60" scrolling="no" border="0" marginwidth="0" style="border:none;" frameborder="0"></iframe></center><br>');
   }
  if (type==30) // Small search box
   {
    document.write('<center><br><iframe src="http://rcm-uk.amazon.co.uk/e/cm?t=cotswoldsteam-21&o=2&p=20&l=qs1&f=ifr" width="120" height="90" frameborder="0" scrolling="no"></iframe></center><br>');
   }
 }

function google(type)
 {
  if (type==10) // 180x150
   {
    google_ad_client = "pub-3893739577634415";
    google_ad_width = 125;
    google_ad_height = 125;
    google_ad_format = "125x125_as";
    google_ad_type = "text_image";
    google_ad_channel ="";
    google_color_border = "006600";
    google_color_link = "006600";
    google_color_bg = "FFFFFF";
    google_color_text = "000000";
    google_color_url = "006600";
	box1s('100%','E');
    document.write('<br><center><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>');
   }
 }

function googlez(type)
 {
  if (type==10) // 180x150
   {
    document.write('</center><br>');
    box1f('E');
   }
 }