function ViewController() 
{
	var nrofnewsboxes =0;
	var currentbox=0;
	
	ViewController.prototype.init = function ()
	{
		
		this.nrofnewsboxes = $(".newsbox").size();
		if (this.nrofnewsboxes>1)
		{
			this.currentbox=1;
			$(".newsbox").hide();
			$("#newsbox"+this.currentbox).fadeIn(1500);
			setInterval ('eaps.rotate()', 6000 );
		}
	}
	
	ViewController.prototype.rotate = function ()
	{
		$("#newsbox"+this.currentbox).fadeOut(500);
		$("#newsbox"+this.currentbox).hide(0);
		this.currentbox = this.currentbox+1;
		if (this.currentbox>this.nrofnewsboxes)
		{
			this.currentbox=1;
		}
		$("#newsbox"+this.currentbox).fadeIn(1500);
	}
}
var eaps;

$(document).ready
(
		function ()
		{
			eaps = new ViewController();
			eaps.init();
		}
)