var categcount = 0;
var categcarousel;
var uitlegcount = 0;
function movecarousel(count) {
	categcount = categcount + count;
	if(categcount < 0)
		categcount = 0;
	if(categcount > 24)
		categcount = 24;	
	categcarousel.set("selectedItem", categcount); 
}
function movecarousel2(count) {
	newshopcount = newshopcount + count;
	if(newshopcount < 0)
		newshopcount = 0;
	if(newshopcount > 24)
		newshopcount = 24;	
	shopscarousel.set("selectedItem", newshopcount); 
}

YAHOO.util.Event.onDOMReady(function (ev) {
	categcarousel = new YAHOO.widget.Carousel("categoriebox", {animation: { speed: 0.5 },numVisible: 3,autoPlayInterval: 1000});
	categcarousel.render(); // get ready for rendering the widget
	categcarousel.show();   // display the widget


 	

})

function shiftuitleg(som) {
	var handleSuccess = function(o) {
		var root = o.responseXML.documentElement;
		document.uitlegimage.src = "/images/uitleg/" + root.childNodes[0].childNodes[1].firstChild.nodeValue;
		document.getElementById("uitlegcontent").innerHTML = root.childNodes[0].childNodes[0].firstChild.nodeValue;
		
	};
	var handleFailure = function(o) {
		
	};
	var callback =   
 	{   
		success: handleSuccess,  
		failure: handleFailure
 	};

	uitlegcount = uitlegcount + som;
	if(uitlegcount > 2)
		uitlegcount = 2;
	else if(uitlegcount < 0)
		uitlegcount = 0;


    
		var sUrl = "getuitleg.php?limit=" + uitlegcount;
		var request = YAHOO.util.Connect.asyncRequest('GET', sUrl, callback); 
	 
}  