/**
 * We use the initCallback callback
 * to assign functionality to the controls

 Referencia: http://sorgalla.com/jcarousel/

 */
function mycarousel_initCallback(carousel) {
    jQuery('.jcarousel-control a').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
        return false;
    });

    jQuery('.jcarousel-scroll select').bind('change', function() {
        carousel.options.scroll = jQuery.jcarousel.intval(this.options[this.selectedIndex].value);
        return false;
    });

    jQuery('#mycarousel-next').bind('click', function() {
        carousel.next();
        return false;
    });

    jQuery('#mycarousel-prev').bind('click', function() {
        carousel.prev();
        return false;
    });
};

function mostraVideo(youtube) {
    //$('#videoLoad').html('<img src="'+URL_LOCAL+'/wp-content/themes/ctbc_tribus/images/img/loader.gif" style="position:absolute; margin-left:200px; margin-top:100px;">');
    $('#videoView').html("<object width=\"445\" height=\"300\" data=\"http://www.youtube.com/v/"+youtube+"&amp;hl=pt_BR&amp;fs=1\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" style=\"visibility: visible;\"><param value=\"true\" name=\"loop\"><param value=\"transparent\" name=\"wmod\"><param value=\"false\" name=\"menu\"></object>");
}

// Ride the carousel...
jQuery(document).ready(function() {
    
    jQuery("#mycarousel").jcarousel({
        scroll: 1,
        initCallback: mycarousel_initCallback,
        auto: 4
    });
    jQuery('#carrosel_tv_tribus').jcarousel();

    jQuery("ul.galeria_flickr a").fancybox({
        'transitionIn'	: 'none',
        'transitionOut'	: 'none',
        'titleShow'	: true
    });

//    jQuery("#btFa").fancybox({
//        'scrolling'	: 'no',
//        'titleShow'	: false,
//        'onClosed'	: function() {
//            $("#msgRet").hide();
//        }
//    });

    jQuery("#btFa").fancybox({
        'width' : '75%',
        'height' : '75%',
        'autoScale' : false,
        'transitionIn' : 'none',
        'transitionOut' : 'none',
        'type' : 'iframe'
    });

//    jQuery("#btSerFa").click(function() {
//        if (jQuery("#fatwitter").val().length < 1) {
//            jQuery("#msgRet").html('(*) Campo obrigatório!');
//            jQuery("#msgRet").show();
//            jQuery.fancybox.resize();
//            return false;
//        }
//        var pk = 0;
//        var urlPadrao = URL_LOCAL+"/queroserfa.php";
//        jQuery.fancybox.showActivity();
//        $.post(urlPadrao, {
//            'banda_id' : jQuery('#banda_id').val(),
//            'fatwitter' : jQuery('#fatwitter').val()
//        }, function(data) {
//            jQuery("#msgRet").html('');
//            if(data == 'true'){
//                jQuery("#formFa")[0].reset();
//                jQuery("#fancybox-loading").hide();
//                jQuery("#msgRet").html('Cadastro realizado com sucesso!');
//                jQuery("#msgRet").show();
//            }else{
//                jQuery("#formFa")[0].reset();
//                jQuery("#fancybox-loading").hide();
//                jQuery("#msgRet").html(data);
//                jQuery("#msgRet").show();
//            }
//        });
//        return false;
//    });


});

