function startTime()	{
	var JSclock = document.getElementById('JSclock');
	if (JSclock) {
		var today=new Date();
		var h=today.getHours();
		var m=today.getMinutes();
		var s=today.getSeconds();
		// add a zero in front of numbers<10
		m=checkTime(m);
		s=checkTime(s);
		JSclock.innerHTML=h+":"+m+":"+s;
		t=setTimeout('startTime()',500);
	}
}

function checkTime(i)	{
	if (i<10) i="0" + i;
	return i;
}

function RePositionFooter() {
	var footer = $('footer');
	if (footer) {
		var winHeight = window.getSize()['y'];
		var conHeight 
		function getContHeight() {
			conHeight = $('container').getSize()['y'];
			if ( winHeight - conHeight > 60 ) {footer.className = 'POS_fix'; }
			else { footer.className = 'POS_rel'; }
		}
		var conHeight
		if (winHeight > 0) {
			getContHeight.delay(10);
		}
	}
}
function IEover (elem, add) {
	if (add) { elem.className += ' IEover';}
	else { elem.className = elem.className.replace(/ IEover/g, "");}
}

window.onresize=function() {
	RePositionFooter();
}

var MyMooFlows = new Array();
var MMFid = 0;
var HoverOn = false;

window.addEvent("domready", function () {
	startTime();
	RePositionFooter();

	if( Browser.Engine.trident4) {
		$$('li, div.presentation').each(function(liItem)  {
			liItem.addEvent("mouseover", function(){IEover(this, true)} )
			liItem.addEvent("mouseout", function(){IEover(this, false)} )
		})
	}

	
	var mf_div = $('MooFlow');
	if (mf_div) {
			/* MooFlow instance with the complete UI and Viewer */
			MyMooFlows[0] = new MooFlow(mf_div, {
				offsetY: -100,
				heightRatio: 0.2,
				useSlider: true,
				useAutoPlay: true,
				useCaption: true,
				useResize: true,
				useMouseWheel: true,
				useKeyInput: true,
				bgColor: '#1f1f1f',
				onClickView: function(){
					MMFid=0;
					Slimbox.open(this.master['slimbox'], this.index, {MooFlow: this});
				}
			});
	}

	var mp_div = $('MooPres');
	if (mp_div) {
			/* MooFlow instance with the complete UI and Viewer */
			MyMooFlows[1] = new MooFlow(mp_div, {
				offsetY: -100,
				heightRatio: 0.2,
				useSlider: true,
				useAutoPlay: true,
				useCaption: true,
				useResize: true,
				useMouseWheel: true,
				useKeyInput: true,
				bgColor: '#1f1f1f',
				onClickView: function(){
					MMFid=1;
					Slimbox.open(this.master['slimbox'], this.index, {MooFlow: this});
				}
			});
	}
	
	
});