jQuery(document).ready(function() {

  var Aj = new jQuery.ajax({
    type: "GET",
    url: "slideshow_bestsellers.php?time="+Date(),
    dataType: "xml",
    complete: function(xml, msg) {
      console.log(msg);
    },
    success: function( xml ) {
      jQuery(xml).find("Product").each(function() {
        console.log(jQuery(this).find("ID").text());
        jQuery('#slidemenu').append('<li class="scroll-interval2">\n'+
            '<div class="txt_area"><a class="pic" href="product_info.php?products_id='+jQuery(this).find("ID").text()+'"><img src="images/'+jQuery(this).find("Image").text()+'" alt="'+jQuery(this).find("Name").text()+'" title="'+jQuery(this).find("Name").text()+'" width="150" /></a></div>\n'+
            '<div class="part">\n'+
            '<div class="name-1"><a class="link" href="product_info.php?products_id='+jQuery(this).find("ID").text()+'">'+jQuery(this).find("Name").text()+'</a></div>\n'+
            '<div class="button-2"><a  href="products_new.php?action=buy_now&amp;products_id='+jQuery(this).find("ID").text()+'"><span></span></a></div>\n'+
            '</div>\n'+
            '</li>');
      });
     //carousel begin
      jQuery(".carousel").jCarouselLite({
        btnNext: ".next",
        btnPrev: ".prev",
        speed: 500,
        crossfade: false,
        autopagination:false,
        autoplay: 5000
      });
     //rollover hover
      jQuery(".carousel li").hover(function() { //On hover...
        var thumbOver = jQuery(this).find("img").attr("src"); //Get image url and assign it to 'thumbOver'
        jQuery(this).find("b").css({'background' : 'url(' + thumbOver + ') no-repeat center bottom'});
     //Animate the image to 0 opacity (fade it out)
        jQuery(this).find("b").stop().fadeTo('normal', 1 , function() {
     // $(this).hide() //Hide the image after fade
        });
      } , function() { //on hover out...
     //Fade the image to full opacity
        jQuery(this).find("b").stop().fadeTo('normal', 1).show();
      });
    }
  });

}); 
