// Newsflash.js
// Steuerund der Newsanzeige auf der Startseite

// Bildbreite: 950px

function refList()
{
	this.currentPosition = 0;
	
	this.moveLeft = function()
	{
		if (this.currentPosition > 0)
		{
			this.currentPosition--;
			this.adjustView();		
		}
	}

	this.moveRight = function()
	{
		if (this.currentPosition < 5)
		{
			this.currentPosition++;
			this.adjustView();
		}
		
	}

	this.adjustView = function()
	{
		var newPos = this.currentPosition*790;
				newPos = "-"+newPos+"px";
	
		$('#slidercontent').animate({"left":newPos}, "1000","swing");
		
		if (this.currentPosition == 0)
		{
			$('#slider_left').hide();
		}
		else
		{
			$('#slider_left').show();
		}

		if (this.currentPosition == 2)
		{
			$('#slider_right').hide();
		}
		else
		{
			$('#slider_right').show();
		}
		
	}

	
	this.adjustView();


}


var refView = new refList();


