jQuery().ready(function(){
	jQuery('#bannerRotativo').jcarousel({
        scroll: 1,
		auto: 6,
        animation: 500,
		wrap: 'both',
        initCallback: mycarousel_controlador
    });
});

function mycarousel_controlador(carousel)
{


	jQuery('#carousel-next').bind('click', function() {
        carousel.next();
        return false;
    });

    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });


    jQuery('#carousel-prev').bind('click', function() {
        carousel.prev();
        return false;
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });


};

function AbrirJanela(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'top=0,left=0,width='+myWidth+',height='+myHeight);
}


$(function() {
	$('a[@rel*=lightbox]').lightBox();
});


function atualizaProgramaAgora() {
	var tsTimeStamp3= new Date().getTime();
	$.get("http://www.cbncascavel.com.br/wp-content/themes/theme155/programacao_cbncascavel.php", { action: "get", time: tsTimeStamp3}, function (data){tratarAtualizaProgramaAgora(data);});
}

function tratarAtualizaProgramaAgora(resultado) {
	$("#blocoPrograma").remove();
	$("#containerBlocoDescPrograma").append('<div id="blocoPrograma">No ar ' + resultado + '</div>');
}

var repetidor01 = window.setInterval('atualizaProgramaAgora()', 90000);

atualizaProgramaAgora();