/* Script to pick a header image. */

/* We only pick an image for the home page, otherwise return the same
   image for all the inside pages. */
var pathname = new String(document.location)
newarray = pathname.split("/")
if ( newarray[newarray.length-1] != "index.shtml" && newarray[newarray.length-1] != "") {
   document.write('<td colspan=2><a href="/index.shtml"><img src="/images/page-header-inside.jpg" width=850 height=89 border=0></a></td>');
} else {

/* If we are here then we are on the home page */
var header = new Array();
header["winter"]=7;    /* Number of possible images for each season */
header["spring"]=3;
header["summer"]=5;
header["autumn"]=3;
/* Images have the name format: /images/home-page-header-<season><#>.jpg 
   For example: /images/home-page-header-summer1.jpg */

/* Assign a "season" to the months. First month is January. */   
var season = new Array("winter","winter","spring","spring","spring","summer","summer","summer","autumn","autumn","autumn","winter");
var today = new Date();
var month = today.getMonth();
/* Pick one of this season's images */
var number= Math.round(Math.random()*(header[season[month]]-1))+1;
document.write('<td colspan=2><img src="/images/home-page-header-' + season[month] + number + '.jpg" width=850 height=358></td>');
}

