var clockID = 0;

function UpdateClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }

function makeArray0() {
     for (i = 0; i<makeArray0.arguments.length; i++)
          this[i] = makeArray0.arguments[i];
}

var days = new makeArray0("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");

var months = new makeArray0('January','February','March','April','May','June','July','August','September','October','November','December');

function nths(day) { 
     if (day == 1 || day == 21 || day == 31)
          return 'st';
     else
          if (day == 2 || day == 22)
               return 'nd';
               if (day == 3 || day == 23)
                    return 'rd';
               else return 'th';
}

function getHours(){
hour = tDate.getHours();
if (hour == 0) hour = "12";
if (hour > 12) hour = hour - 12;
return hour;
}

function ampm(hr){
hr = tDate.getHours();
if (hr >= 12) ampm = "pm";
if (hr < 12) ampm = "am";
return ampm;
}

function getMinutes(){
min = tDate.getMinutes();
if (min == 0) min = "00";
if (min == 1) min = "01";
if (min == 2) min = "02";
if (min == 3) min = "03";
if (min == 4) min = "04";
if (min == 5) min = "05";
if (min == 6) min = "06";
if (min == 7) min = "07";
if (min == 8) min = "08";
if (min == 9) min = "09";

return min;
}

function getYear(d) {
 yr = d.getYear();
 if (yr < 1000)
  yr+=1900;
 return yr;
}

   var tDate = new Date();

   document.theClock.theTime.value = ""
   + "   "
   + days[tDate.getDay()] + " "
   + tDate.getDate()
   + nths(tDate.getDate()) + " "
   + months[tDate.getMonth()] + ", "
   + getYear(tDate) + " "
   + getHours() + ":" 
   + getMinutes()
   + ampm(tDate.getHours());
   
   clockID = setTimeout("UpdateClock()", 1000);
}

function StartClock() {
   clockID = setTimeout("UpdateClock()", 500);
}

function KillClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }
}

var iframeids=["blockrandom"]

var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])

if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
self.scrollTo(0,0);
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

if (window.screen.width >800) {
document.write('<STYLE type="text/css">');
document.write('.left_col { width:814px }');
document.write('</style>');
document.write('<div style="position:absolute; right:16px; top:99px; width:150px" align="center">');
document.write('<iframe name="weather" marginwidth="1" marginheight="1" scrolling="no" border="0" frameborder="0" width="150" height="110" src="http://www.merseyevents.co.uk/wb.php">');
document.write('weather banner');
document.write('</iframe>');
document.write('</div>');
}
else {
document.write('<STYLE type="text/css">');
document.write('.left_col { width:100% }');
document.write('</style>');
}
