var intervalId;
var seconds;
var minutes;
var hours;
var am_pm;
function initializePage() {
	setFooter();
	setClock();
}
function setClock() {
	clearInterval(intervalId);
	var date = new Date();
	seconds = date.getSeconds();
	minutes = date.getMinutes();
	hours = date.getHours();
	if(hours==0) {
		hours=12;
		am_pm="AM";
	} else if(hours<12) {
		am_pm="AM";
	} else if(hours==12) {
		am_pm="PM";
	} else if(hours>12) {
		hours -= 12;
		am_pm="PM";
	}
	if(minutes<10) {
		minutes = "0"+minutes;
	}
	if(seconds<10) {
		seconds = "0"+seconds;
	}
	document.getElementById('hours').innerHTML = hours+":";
	document.getElementById('minutes').innerHTML = minutes+":";
	document.getElementById('seconds').innerHTML = seconds+" ";
	document.getElementById('am_pm').innerHTML = am_pm;
	intervalId=setInterval(setClock,1000)
}

function setFooter() {
	var contentHeight = document.getElementById('content').offsetHeight;
	var headerHeight = document.getElementById('header').offsetHeight;
	document.getElementById('footer').style.position="absolute";
	document.getElementById('footer').style.top=contentHeight+headerHeight+"px";
	document.getElementById('footer').style.left="0";
	var footerHeight = document.getElementById('footer').offsetHeight;
	document.getElementById('content').style.marginBottom = footerHeight+"px";
}

function getMenu() {
	if (flashinstalled == 2) {
		if (flashversion>=8) {
			getFlashMenu();
		} else {
			showHtmlMenu();			
		}
	} else {
		showHtmlMenu();			
	}
}

function getFlashMenu() {
	document.write('<object type="application/x-shockwave-flash" data="flash/menu.swf" width="150" height="225">\n');
  document.write('<param name="movie" value="flash/menu.swf" />');
  document.write('<param name="bgcolor" value="#000000"/>');
  document.write('</object>\n');
}
function showHtmlMenu() {
	document.getElementById('htmlMenu').style.display = "block";

}
function getGallery(pre) {
	document.write('<object type="application/x-shockwave-flash" data="'+pre+'flash/gallery.swf" width="558" height="460">\n');
  document.write('<param name="movie" value="'+pre+'flash/gallery.swf" />');
  document.write('<param name="bgcolor" value="#000000"/>');
  document.write('</object>\n');
}

this.addEventListener('resize',setFooter,false);