jQuery(document).ready(function () {
	var countItems = 	jQuery('ul#menu-hoofmenu > li').length;
	var wrapperWidth = 	jQuery('ul#menu-hoofmenu').width();
	var widthItem = 	Math.floor(wrapperWidth/countItems);

	jQuery('ul#menu-hoofmenu > li').width(widthItem);
});

function get_css_property(element, property) {
	var x = document.getElementById(element);
	if (x.currentStyle)
		var y = x.currentStyle[property];
	else if (window.getComputedStyle)
		var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(property);
	return y;
}

function carrouselPrev() {
	var left = parseInt(get_css_property("image-container", "left").replace("px", ""));
	var width = parseInt(get_css_property("image-container", "width").replace("px", ""));
	var width = (width + 876) - (width * 2);
	if(left == 0) {
		document.getElementById('image-container').style.left = width+"px";
	}
	$("#image-container").animate({"left": "+=292px"}, "slow");
}
   
function carrouselNext() {
	$("#image-container").animate({"left": "-=292px"}, "slow", function() {
		var left = parseInt(get_css_property("image-container", "left").replace("px", ""));
		var width = parseInt(get_css_property("image-container", "width").replace("px", ""));
		var width = (width + 876) - (width * 2);
		if(left == width) {
			document.getElementById('image-container').style.left = "0px";
		}
	});
}
