
function showBanner(loc, random){
   var url = loc.toString();
   url.replace("\\","/");	
   var parts = url.split("/");

   url = parts[(parts.length-1)].toLowerCase();
   if(url.indexOf("?") > -1)
       url = url.substring(0,url.indexOf("?"));
   if(url.indexOf("#") > -1)
       url = url.substring(0,url.indexOf("#"));		

   copyright = "<br><table width=\"800\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td id=\"copyright\">All images and other written material, except those credited, are owned and copyrighted by the Scottish Australian Heritage Council.<br>";

   if(url == "index.html"){
      random = Math.floor(Math.random()*5);
      if(random == undefined){
      	document.write('<tr><td id="bannercell"><img src="/~sahc/img/banners/bannershow'+random+'.jpg" border="0" alt="SAHC Banner Image" height="260" width="796" hspace="0" vspace="0"/></td></tr>');
	copyright = "<br><table width=\"800\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td id=\"copyright\">All images and other written material, except those credited, are owned and copyrighted by the Scottish Australian Heritage Council.<br>Banner image (Glencoe by Wojsyl) used under the terms of the <a href=\"http://www.fsf.org/licensing/licenses/fdl.html\" target=\"_new\">GNU Free Documentation License</a>.  <a href=\"http://commons.wikimedia.org/wiki/Image:Scotland_Glencoe.jpg\" target=\"_new\">Original image</a> sourced from <a href=\"http://commons.wikimedia.org/\" target=\"_new\">WikiMedia Commons</a>.";
	bannerDone = true;		
      	return;
      }
      document.write('<tr><td id="bannercell"><img src="/~sahc/img/banners/bannershow'+random+'.jpg" border="0" alt="SAHC Banner Image" height="260" width="796" hspace="0" vspace="0"/></td></tr>');
      if(random == 0)
        copyright += "Banner image (Stirling Castle by Finlay McWalter) used under the terms of the <a href=\"http://www.fsf.org/licensing/licenses/fdl.html\" target=\"_new\">GNU Free Documentation License</a>.  <a href=\"http://commons.wikimedia.org/wiki/Image:Stirlingcastle.jpg\" target=\"_new\">Original image</a> sourced from <a href=\"http://commons.wikimedia.org/\" target=\"_new\">WikiMedia Commons</a>.";
      if(random == 1)
        copyright += "Banner image (Glencoe by Wojsyl) used under the terms of the <a href=\"http://www.fsf.org/licensing/licenses/fdl.html\" target=\"_new\">GNU Free Documentation License</a>.  <a href=\"http://commons.wikimedia.org/wiki/Image:Scotland_Glencoe.jpg\" target=\"_new\">Original image</a> sourced from <a href=\"http://commons.wikimedia.org/\" target=\"_new\">WikiMedia Commons</a>.";
      if(random == 2)
        copyright += "Banner image (Edinburgh Castle by Christian Bickel) used under the terms of the <a href=\"http://creativecommons.org/\" target=\"_new\">Creative Commons Attribution ShareAlike 2.0</a>.  <a href=\"http://commons.wikimedia.org/wiki/Image:Edinburg004.jpg\" target=\"_new\">Original image</a> sourced from <a href=\"http://commons.wikimedia.org/\" target=\"_new\">WikiMedia Commons</a>.";
      if(random == 3)
        copyright += "Banner image (North Uist near Solas by Scot Tares) used under the terms of the <a href=\"http://creativecommons.org/\" target=\"_new\">Creative Commons Attribution ShareAlike 2.0</a>.  <a href=\"http://commons.wikimedia.org/wiki/Image:North_Uist_near_Solas.jpg\" target=\"_new\">Original image</a> sourced from <a href=\"http://commons.wikimedia.org/\" target=\"_new\">WikiMedia Commons</a>.";
      if(random == 4)
        copyright += "Banner image (Castlebay, Isle of Barra by Evelyn and Robert Wirth) used under the terms of the <a href=\"http://www.fsf.org/licensing/licenses/fdl.html\" target=\"_new\">GNU Free Documentation License</a>.  <a href=\"http://commons.wikimedia.org/wiki/Image:Isle_of_barra-castlebay.jpg\" target=\"_new\">Original image</a> sourced from <a href=\"http://commons.wikimedia.org/\" target=\"_new\">WikiMedia Commons</a>.";
      copyright += "</td></tr></table>";
      bannerDone = true;
      return random;
   }
   if(url == "news.html" || url == "newsitem.html"){
	document.write('<tr><td id="bannercell"><img src="/~sahc/img/banners/newsbanner.jpg" alt="SAHC Banner Image" border="0" height="130" width="796" hspace="0" vspace="0"/></td></tr>');
        copyright += "Banner image (Stirling Castle by Finlay McWalter) used under the terms of the <a href=\"http://www.fsf.org/licensing/licenses/fdl.html\" target=\"_new\">GNU Free Documentation License</a>.  <a href=\"http://commons.wikimedia.org/wiki/Image:Stirlingcastle.jpg\" target=\"_new\">Original image</a> sourced from <a href=\"http://commons.wikimedia.org/\" target=\"_new\">WikiMedia Commons</a>.</td></tr></table>";
        return;	
   }
   if(url == "groups.html"){
	document.write('<tr><td id="bannercell"><img src="/~sahc/img/banners/clansbanner.jpg" alt="SAHC Banner Image" border="0" height="130" width="796" hspace="0" vspace="0"/></td></tr>');
        copyright += "Banner image (Edinburgh Castle by Christian Bickel) used under the terms of the <a href=\"http://creativecommons.org/\" target=\"_new\">Creative Commons Attribution ShareAlike 2.0</a>.  <a href=\"http://commons.wikimedia.org/wiki/Image:Edinburg004.jpg\" target=\"_new\">Original image</a> sourced from <a href=\"http://commons.wikimedia.org/\" target=\"_new\">WikiMedia Commons</a>.</td></tr></table>";
        return;	
   }
   if(url == "articles.html" || url == "articleitem.html"){
	document.write('<tr><td id="bannercell"><img src="/~sahc/img/banners/articlesbanner.jpg"  alt="SAHC Banner Image" border="0" height="130" width="796" hspace="0" vspace="0"/></td></tr>');
	copyright += "Banner image (North Uist near Solas by Scot Tares) used under the terms of the <a href=\"http://creativecommons.org/\" target=\"_new\">Creative Commons Attribution ShareAlike 2.0</a>.  <a href=\"http://commons.wikimedia.org/wiki/Image:North_Uist_near_Solas.jpg\" target=\"_new\">Original image</a> sourced from <a href=\"http://commons.wikimedia.org/\" target=\"_new\">WikiMedia Commons</a>.</td></tr></table>";
        return;	
   }
   if(url == "calendar.html" || url =="eventitem.html"){
	document.write('<tr><td id="bannercell"><img src="/~sahc/img/banners/calendarbanner.jpg" alt="SAHC Banner Image" border="0" height="130" width="796" hspace="0" vspace="0"/></td></tr>');
        copyright += "Banner image (Glencoe by Wojsyl) used under the terms of the <a href=\"http://www.fsf.org/licensing/licenses/fdl.html\" target=\"_new\">GNU Free Documentation License</a>.  <a href=\"http://commons.wikimedia.org/wiki/Image:Scotland_Glencoe.jpg\" target=\"_new\">Original image</a> sourced from <a href=\"http://commons.wikimedia.org/\" target=\"_new\">WikiMedia Commons</a>.</td></tr></table>";
	return;	
   }
   if(url == "council.html"){
	document.write('<tr><td id="bannercell"><img src="/~sahc/img/banners/councilbanner.jpg" alt="SAHC Banner Image" border="0" height="130" width="796" hspace="0" vspace="0"/></td></tr>');
        copyright += "Banner image (Castlebay, Isle of Barra by Evelyn and Robert Wirth) used under the terms of the <a href=\"http://www.fsf.org/licensing/licenses/fdl.html\" target=\"_new\">GNU Free Documentation License</a>.  <a href=\"http://commons.wikimedia.org/wiki/Image:Isle_of_barra-castlebay.jpg\" target=\"_new\">Original image</a> sourced from <a href=\"http://commons.wikimedia.org/\" target=\"_new\">WikiMedia Commons</a>.</td></tr></table>";
        return;	
   }
   if(url == "contact.html"){
	document.write('<tr><td id="bannercell"><img src="/~sahc/img/banners/contactbanner.jpg" alt="SAHC Banner Image" border="0" height="130" width="796" hspace="0" vspace="0"/></td></tr>');
	copyright += "Banner image (Hadrian's Wall by Mark Burnett) used under the terms of the <a href=\"http://www.fsf.org/licensing/licenses/fdl.html\" target=\"_new\">GNU Free Documentation License</a>.  <a href=\"http://commons.wikimedia.org/wiki/Image:Hadrian%27s_Wall_view_near_Greenhead.jpg\" target=\"_new\">Original image</a> sourced from <a href=\"http://commons.wikimedia.org/\" target=\"_new\">WikiMedia Commons</a>.</td></tr></table>";
        return;	
   }
   if(url == "links.html"){
	document.write('<tr><td id="bannercell"><img src="/~sahc/img/banners/linksbanner.jpg" alt="SAHC Banner Image" border="0" height="130" width="796" hspace="0" vspace="0"/></td></tr>');
        copyright += "Banner image (Forth Rail Bridge by Andrew Bell) used under the terms of the <a href=\"http://www.fsf.org/licensing/licenses/fdl.html\" target=\"_new\">GNU Free Documentation License</a>.  <a href=\"http://commons.wikimedia.org/wiki/Image:Bb-forthrailbridge.jpg\" target=\"_new\">Original image</a> sourced from <a href=\"http://commons.wikimedia.org/\" target=\"_new\">WikiMedia Commons</a>.</td></tr></table>";
	return;	
   }
   if(url == "search.html"){
	document.write('<tr><td id="bannercell"><img src="/~sahc/img/banners/searchbanner.jpg" alt="SAHC Banner Image" border="0" height="130" width="796" hspace="0" vspace="0"/></td></tr>');
        copyright += "Banner image (St Andrew's Cathedral by Jjhake) used under the terms of the <a href=\"http://www.fsf.org/licensing/licenses/fdl.html\" target=\"_new\">GNU Free Documentation License</a>.  <a href=\"http://commons.wikimedia.org/wiki/Image:St_Andrews_Cathedral_Ruins_Front.jpg\" target=\"_new\">Original image</a> sourced from <a href=\"http://commons.wikimedia.org/\" target=\"_new\">WikiMedia Commons</a>.</td></tr></table>";
	return;	
   }
   if(url == "gallery.html"){
	document.write('<tr><td id="bannercell"><img src="/~sahc/img/banners/gallerybanner.jpg" alt="SAHC Banner Image" border="0" height="130" width="796" hspace="0" vspace="0"/></td></tr>');
        copyright += "Banner image (Stenness Stones by Drew corser) used under the terms of the <a href=\"http://www.fsf.org/licensing/licenses/fdl.html\" target=\"_new\">GNU Free Documentation License</a>.  <a href=\"http://commons.wikimedia.org/wiki/Image:Stenness_Stones.jpg\" target=\"_new\">Original image</a> sourced from <a href=\"http://commons.wikimedia.org/\" target=\"_new\">WikiMedia Commons</a>.</td></tr></table>";
	return;	
   }
   if(url == "scottish_week_2009.html" || url == "scottish_week_2009_event.html" ){
	document.write('<tr><td id="bannercell"><img src="/~sahc/img/banners/scottishweek2009banner.jpg" alt="SAHC Banner Image" border="0" height="130" width="796" hspace="0" vspace="0"/></td></tr>');
        copyright += "Banner image (Scottish Week 2006 by Mike Lotzof) used with the kind permission of the owner.</td></tr></table>";
	return;	
   }
   if(url == "tickets.html" || url == "auto_return.html" || url == "tickets_cancel.html"){
   	document.write('<tr><td id="bannercell"><img src="/~sahc/img/banners/ticketsbanner.jpg" alt="SAHC Banner Image" border="0" height="130" width="796" hspace="0" vspace="0"/></td></tr>');
           copyright += "Banner image (Scottish Parliament by Grenavitar). <a href=\"http://commons.wikimedia.org/wiki/Image:Scottish_Parliament.jpg\" target=\"_new\">Original image</a> sourced from <a href=\"http://commons.wikimedia.org/\" target=\"_new\">WikiMedia Commons</a>.</td></tr></table>";
   	return;	
   }
}


