var animated = false;
jQuery(document).ready(function()
{ //Animation starten
 jQuery("#box #innerBox #header .leftButton").click(
	function(){	if(animated === false) moveLeft();	}
 );
 jQuery("#box #innerBox #header .rightButton").click(
	function(){	if(animated === false) moveRight();	}
 );
});

function moveLeft()
{
 var $elmFirst = jQuery("#box #innerBox #header #headimages li:first");
 var $elmsecond = jQuery("#box #innerBox #header #headimages li:first").next("li");
 $elmFirst.css("width", "auto");
 var nextPictureLenght = parseInt($elmsecond.width());
 $elmFirst.remove();
 $elmFirst.css("marginRight", "7px");
 $elmFirst.insertAfter("#box #innerBox #header #headimages li:last");
} 
function moveRight()
{
 var $elmLast = jQuery("#box #innerBox #header #headimages li:last");
 $elmLast.css("width", "auto");
 var nextPictureLenght = parseInt($elmLast.width());
 $elmLast.remove();
 $elmLast.css("marginLeft","0");
 $elmLast.insertBefore("#box #innerBox #header #headimages li:first");
}