$(document).ready(function (){
    
    // initialise hint.js
    //$('input:text').hint();
    bindSearchButtons();
     
    /*   
    $('.right').click(function() {
      addItem('right')
    });
 
    $('.left').click(function() {
      addItem('left')
    });
    */
    
});

function addItem(direction){

//console.log("addItem(" + direction + ")");

    // get handle to scrollable API
    var api = $(".scrollable").data("scrollable");
    
    //console.log(api);
    
    var itemCount = api.getSize();
    
	//alert($(".items li:last-child").length);

    // use API to add our new item. after the item is being added seek to the end
    if(direction == 'right'){
        //alert($("#.items li:nth-child(4)").length);
       //alert(api.getIndex());
        api.addItem($(".items li:eq(" + api.getIndex() + ")").clone());
        //api.move(7).end();
    } else{
        //alert(api.getIndex());
        api.addItem($(".items li:eq(" + api.getIndex() + ")").clone()).prev();
        //api.addItem($(".items li:first-child").clone());
    };

}
