$(document).ready(function() {
    $('#jqFancyTransitions').jqFancyTransitions({
        width : 948,
        height : 400,
        titleOpacity : 0.5,
        position: 'curtain',
        direction: 'alternate',
        navigation : true,
        delay : 5000
    });

    $('.ft-button-jqFancyTransitions').css('padding', 0);
    $('#ft-prev-jqFancyTransitions').hide();
    $('#ft-next-jqFancyTransitions').hide();
    
    $('#jqFancyTransitions-small').jqFancyTransitions({
        width : 713,
        height : 370,
        titleOpacity : 0.5,
        position: 'curtain',
        direction: 'alternate',
        navigation : true,
        delay : 5000
    });
    
    $('.ft-button-jqFancyTransitions-small').css('padding', 0);
    $('#ft-prev-jqFancyTransitions-small').hide();
    $('#ft-next-jqFancyTransitions-small').hide();

    $("a.jQueryBookmark").click(function(e){
        e.preventDefault(); // this will prevent the anchor tag from going the user off to the link
        var bookmarkUrl = this.href;
        var bookmarkTitle = this.title;

        if (window.sidebar) { // For Mozilla Firefox Bookmark
            window.sidebar.addPanel(bookmarkTitle, bookmarkUrl,"");
        } else if( window.external || document.all) { // For IE Favorite
            window.external.AddFavorite( bookmarkUrl, bookmarkTitle);
        } else if(window.opera) { // For Opera Browsers
            $("a.jQueryBookmark").attr("href",bookmarkUrl);
            $("a.jQueryBookmark").attr("title",bookmarkTitle);
            $("a.jQueryBookmark").attr("rel","sidebar");
        } else { // for other browsers which does not support
             alert('Your browser does not support this bookmark action');
             return false;
        }
    });

});

function ivideos_initCallback(carousel) {
    $('.jcarousel-control a').bind('click', function() {
        carousel.scroll($.jcarousel.intval($('span', this).attr('rel')));
		$('a', $(this).parent().parent()).removeClass('current');
		$(this).addClass('current');
        return false;
    });
 
    $('.jcarousel-next').bind('click', function() {
        carousel.next();
        return false;
    });
 
    $('.jcarousel-prev').bind('click', function() {
        carousel.prev();
        return false;
    });
};

function ivideos_itemLoadCallback(carousel) {
	$('.jcarousel-control a').removeClass('current');
	$('#jcarousel-control-li-'+ carousel.first).addClass('current');
}
