window.addEvent("domready", function() {
    
	var sldr = new iCarousel("carousel-content", {
		idPrevious: "prev",
		idNext: "next",
		idToggle: "undefined",
		item: {
			klass: "content-items",
			size: 320
		},
		animation: {
			duration: 500,
			amount: 3
		}
		
	});
	//alert("aaaa");
	
	// the lines below is to give limitation for the scrolling carousel
	// created by Leonard Adhitya (leonard.adhitya@gmail.com)
	
	// ATTENTION THIS ONE STILL NEED FIXING... ONLY THIS ONE !!!
	
	//real length is length/3 
	/*var container = document.getElementById('carousel-content'); // get the container of the carousel
	var items = container.childNodes; // get all the children
	
	var lastindex = (items.length/3)-1; // the last index of the items, 1st the length have to be divided by 3 and subst by 1 for indexing purpose	
	var nextindex = 0; // index of the item
	var last; // this variable is to determine what is the REAL last index to be put for scrolling, in case of the items has less quantities than the frame, which in this case 5. 
	
	if((lastindex-2) <= 0) { // in case the items quantity is less than 4 which makes the index become 0 or less
		last = 0;	
	}
	else { // normal drill, this will make the last item show on the edge of the right frame. a frame in this case have 5
		last = lastindex-2;
	}
	
	$("prev").addEvent("click", function(event){ // arrow prev
	   new Event(event).stop();
	   
	   if(nextindex > 0) { // no scrolling if index reaches 0;
	      nextindex -= 3; // this is the index target
		  //alert('index '+nextindex);
	      sldr.goTo(nextindex); // scroll to target
	   }
	   
	   
	});	
	$("next").addEvent("click", function(event){ // arrow next
	   new Event(event).stop();
	    
	   if(nextindex < last) { // no scrolling when index reaches the end of the item index.
	      nextindex += 3; // this is the index target
	      //alert('index '+nextindex);
		  sldr.goTo(nextindex);// scroll to target
	   }
	   
	});
	*/
});
