function mycarousel_itemLoadCallback(carousel, state)
{
    // Check if the requested items already exist

    if (carousel.has(carousel.first, carousel.last)) {
        return;
    }

    jQuery.post(
        system_base_url+'ajax/video/_get_content_partner',
        {
            first1: carousel.first,
            last: carousel.last
        },
        function(xml) {

            mycarousel_itemAddCallback(carousel, carousel.first,carousel.last, xml);
        },
        'xml'
    );
};

function mycarousel_itemAddCallback(carousel, first, last, xml)
{

    // Set the size of the carousel
    carousel.size(parseInt(jQuery('total', xml).text()));

     $('data',xml).each(function(j){                                                                                    
            $('data_info',xml).each(function(i){
                carousel.add(first+i, mycarousel_getItemHTML($(this).find('id'+i).text(), $(this).find('image'+i).text(), $(this).find('display_name'+i).text()));
             });
      });   
};

/**
 * Item html creation helper.
 */
function mycarousel_getItemHTML(id,url,name)
{
    return '<a href="'+system_base_url+'video/'+id+'/_show_video/" title="'+name+'"><img src="'+url+'" /></a>';
};

jQuery(document).ready(function() {
    jQuery('#mycarousel-horiz').jcarousel({
        // Uncomment the following option if you want items
        // which are outside the visible range to be removed
        // from the DOM.
        // Useful for carousels with MANY items.

         //itemVisibleOutCallback: {
         //onAfterAnimation:function(carousel, item, i, state, evt) { carousel.remove(i); }},

        itemLoadCallback: mycarousel_itemLoadCallback,
          visible:4,
          scroll:4
    });

    jQuery('#mycarousel-vert').jcarousel({
		vertical: true,
		scroll: 2
		});
    jQuery('.watched').jcarousel({
      scroll:3,
          auto:'10',
          buttonNextHTML: null,
          buttonPrevHTML: null,
          visible: 3,
          wrap: 'last'
          });
    $("#tabs").tabs();
    
});
$(function(){
$('.roundbdr').wrap('<div class="roundbdrwrap"></div>');
});
jQuery(document).ready(function() {
$('.round').corner("round 5px")
$('.roundbdr').corner("round 5px").parent().css('padding', '1px').corner("round 5px")
});
		


