// Get screen size 
var myWidth = 0, myHeight = 0;
function alertSize() {
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
//window.alert( 'Width = ' + myWidth );
  //window.alert( 'Height = ' + myHeight );
}

function displayToday() {
var today = new Date();
var weekday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
document.write(weekday[today.getDay()]);
var num = today.getDate(); 
var month = today.getMonth();
var months = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var year = today.getFullYear();
var daySuffix = new Array("st", "nd", "rd", "th");
switch (num) {
case 1: sf = "st"; break;
case 31: sf = "st"; break;
case 2: sf = "nd"; break;
case 21: sf = "st"; break;
case 22: sf = "nd"; break;
case 3: sf = "rd"; break;
case 23: sf ="rd"; break;
default : sf = "th";
};
document.write(" " + num + sf + " " + (months[month]) + " " + year);
}

//Add date
document.write('<div id="date-location">');
displayToday();
document.write("</div>");

 
 // Add main logo
document.write("<div id='header'>");
document.write('<img src="images/MSCC-Logo-Main.jpg" width="300" height="98"><br>');
document.write("</div>");

function screen() {
alertSize();
var sw = myWidth - 150;
var ap = myHeight - 75;

document.write('<div id="imagepanelbar" style="width:' + sw + 'px;">');
document.write("</div>");

document.write('<div id="imagepanel1">');
document.write('<img src="images/OntheLimit.jpg" width="252" height="170">');
document.write("</div>");

document.write('<div id="imagepanel2">');
document.write('<img src="images/SomersetLevels.jpg" width="252" height="170">');
document.write("</div>");

document.write('<div id="imagepanel3">');
document.write('<img src="images/Puffin.jpg" width="252" height="170">');
document.write("</div>");

document.write('<div id="addresspanel">');
document.write('<h4>www.midsomersetcameraclub.org.uk</h4>');
document.write("</div>");

}

screen();

