jQuery(document).ready(function() {
//	actAhoraMismo();
	addLnkOnLine();
	
	$.pop();	// para la búsqueda avanzada
});

function ventanaSecundaria (URL){
   window.open(URL,"Asociada","width=250,height=200,scrollbars=NO")
}


function addLnkOnLine()
{
	// var obj=$("lnkAudioEnVivo");
	// var obj=jQuery('#lnkAudioEnVivo');
	// alert(obj.href);
	var obj=document.getElementById("lnkAudioEnVivo");
	obj.href="#";
	obj.onclick=function(){window.open("online/", "OnLine", "width=360,height=269,scrollbars=no,resizable=0,toolbar=0,border=0,hotkeys=0,status=0");};
}

// Gráficos estadísticos
$(function(){
	//make some charts
	// $('#tblGrafEncuesta').visualize({type: 'pie', pieMargin: 5, title: '2009 Total Sales by Individual', height:190});	
	// $('table').visualize({type: 'line'});
	// $('table').visualize({type: 'area'});
	$('#tblGrafEncuesta').visualize({type: 'pie', height:190, width:500});
	
	//hide table
	$('#tblGrafEncuesta').addClass('accessHide');
	
	$('.chartConfiguratorThingy')
		.bind('click keyup',function(){
			var chartOptions = {height:190, width:500};
			var formVars = $(this).serialize();
			$.each(formVars.split('&'),function(){
				var thisPair = this.split('=');
				if(thisPair[1]){ 
					//fix non-string types
					var thisVal = unescape(thisPair[1]);
					//bool true
					if(thisVal == 'true'){ thisVal = true; }
					//bool false
					if(thisVal == 'false'){ thisVal = false; }
					//arrays
					if(thisPair[0] == 'colors' || thisPair[0] == 'textColors'){
						thisVal = thisVal.replace(/[\[\]\']/g,'').split(',');
					}
					
					chartOptions[thisPair[0]] = thisVal;
				}
			});
			$('.visualize').remove();
			$('#tblGrafEncuesta').visualize(chartOptions);
		});	
});

// Rotador (carrusel) de banners
jQuery("#rotador").jcarousel({
	auto: 5,
	scroll: 1,
	wrap: 'both',
	// easing: 'BounceEaseOut',
	easing: 'swing',
	animation: 1000, 
	initCallback: mycarousel_initCallback,
	// This tells jCarousel NOT to autobuild prev/next buttons
	buttonNextHTML: null,
	buttonPrevHTML: null
});

// Carousel
function mycarousel_initCallback(carousel) {
    jQuery('.jcarousel-control a').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
        return false;
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });

};
/*
jQuery.easing['BounceEaseOut'] = function(p, t, b, c, d) {
	if ((t/=d) < (1/2.75)) {
		return c*(7.5625*t*t) + b;
	} else if (t < (2/2.75)) {
		return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
	} else if (t < (2.5/2.75)) {
		return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
	} else {
		return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
	}
};

function carouselTitu_initCallback(carousel) {
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });

};
*/

