/*var $j = jQuery.noConflict();

$j(function($){
  $j("#content-slider").slider({
    animate: true,
    change: handleSliderChange,
    slide: handleSliderSlide
  });
  
  //alert($j("#content-scroll").prop("scrollWidth"));
});

function handleSliderChange(e, ui)
{
  var maxScroll = $j("#content-scroll").attr("scrollWidth") - $j("#content-scroll").width();
  $j("#content-scroll").animate({scrollLeft: ui.value * (maxScroll / 100) }, 1000);
}

function handleSliderSlide(e, ui)
{
  var maxScroll = $j("#content-scroll").attr("scrollWidth") - $j("#content-scroll").width();
  //alert($j("#content-scroll")..attr("scrollWidth"));
  $j("#content-scroll").attr({scrollLeft: ui.value * (maxScroll / 100) });
}*/


jQuery(function() {
        
	//vars
	var conveyor = jQuery("#content-holder", jQuery("#posts")),
	item = jQuery(".content-item", jQuery("#posts"));
	
	
	//set length of conveyor
	//conveyor.css("width", item.length * parseInt(item.css("width")));
	//alert(parseInt(item.css("width")));
			
    //config
    var sliderOpts = {
	  max: (item.length * (parseInt(item.css("width")) + 10)) - parseInt(jQuery("#content-scroll", jQuery("#posts")).css("width")),
      slide: function(e, ui) { 
        conveyor.css("left", "-" + ui.value + "px");
      }
    };
    
    //create slider
    jQuery("#slider").slider(sliderOpts);
});
