var News = {
	initialize: function(options){
		this.NewsItems = $$('li.newsItem');
		this.displayRegion = $('press-feed');
		this.interval = 4000;
		this.current = 0;
		this._fx  = false;

		this.displayRegion.innerHTML = this.NewsItems[0].innerHTML;
		this.runTest.periodical(this.interval, this);
	},

	runTest: function(){
		this.fadeOut(this.displayRegion);
		if(this.current < (this.NewsItems.length - 1)) {
			this.displayRegion.innerHTML = this.NewsItems[this.current +1].innerHTML;
			this.current  = this.current  + 1;
		} else {
			this.displayRegion.innerHTML = this.NewsItems[0].innerHTML;
			this.current  = 0;
		}
		this.fadeIn(this.displayRegion);
	},

	fadeOut: function(item){
     this._fx = item.effect('opacity').start(0,1);
  },
	fadeIn: function(item){
     this._fx = item.effect('opacity').start(0,1);
  },
	changeContent: function(item){
     this._fx = item.effect('opacity').start(0,1);
  }
}
window.addEvent('domready',  News.initialize.bind(News));

window.onload = function () {
	clock()
}


function clock() {
var date=new Date();
var year=date.getFullYear();
var month=date.getMonth();
var day=date.getDate();
var hour=date.getHours();
var minute=date.getMinutes();
var second=date.getSeconds();
var months=new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")

var monthname=months[month];

if (hour > 12) {
hour=hour- 12;
}

if (minute < 10) {
minute="0"+minute;
}

if (second < 10) {
second="0"+second;
}

document.getElementById('tm').innerHTML="It's "+hour+":"+minute+" on "+monthname+" "+day+", "+year+".";
setTimeout("clock()", 1000)

}