jQuery.easing.easeOutQuart = function (x, t, b, c, d) {
	return	-c * ((t=t/d-1)*t*t*t - 1) + b;
};
$(function(){
	jQuery.fx.off = false;
	  function cargarMesFlash(i,a){
	swfobject.embedSWF("flash/eventos/titulo_calendario.swf", "calendario-titulo", "256", "42", "8", "http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75", {idioma:i,anio:a}, {wmode: "transparent"}, {});}
	/////// ajustes de tamanios
	//$('#visor_info ul').css("width",$('#visor_info ul li').length*651);
	//$('.flecha_medio').height($("#tabla_eventos_info").height()-11);
	//$('#flecha_prev').css("margin-top",($('.flecha_medio').height()/2)-10);
	//$('#flecha_next').css("margin-top",($('.flecha_medio').height()/2)-10);
	
	////////navegacion de eventos
	
	
	/*$('#visor_info').serialScroll({
			items:'li',
			prev:'#mov_izq',
			next:'#mov_der',
			start:0,
			duration:1000,
			force:true,
			stop:true,
			lock:true,
			lazy:true,
			cycle:false, //don't pull back once you reach the end
			easing:'easeOutQuart' //use this easing equation for a funny effect
		});*/
	
	//$('#mov_izq').click(function(){alert("izquierda")});
	
	//$('#mov_der').click(function(){alert("derecha")});
	//////////
	$(".marcoDerecho").mbMaskGallery({
		type:"normal",
		galleryMask:"images/eventos/mask.png",
		galleryColor:"#E3E1D6",
		loader:false,
		changeOnClick:false,
		fadeTime: 1,
		slideTimer: 0
	});
	
	
	$("#marcoIzquierdo").mbMaskGallery({
		type:"normal",
		galleryMask:"images/eventos/mask.png",
		galleryColor:"#E3E1D6",
		loader:false,
		changeOnClick:false
	});
	
	$("#proxEvento-imagen").mbMaskGallery({
		type:"normal",
		galleryMask:"images/eventos/mask.png",
		galleryColor:"#E3E1D6",
		loader:false,
		changeOnClick:false,
		fadeTime: 1,
		slideTimer: 0
	});

});

function get_month(params){
	
	$.ajax({
		type: "POST",
	 	url: "xml/calendario.php",
	 	data: params,
	 	cache: false,
		async: false,
		success: function(html){
			$('#calendario-content').html(html);
			cargarMesFlash('es',$('#anio_activo').attr('valor'));
			//$('#visor_info ul').css("width",$('#visor_info ul li').length*651);
			//$('.flecha_medio').height($("#tabla_eventos_info").height()-11);
		//$('#flecha_prev').css("margin-top",($('.flecha_medio').height()/2)-10);
			//$('#flecha_next').css("margin-top",($('.flecha_medio').height()/2)-10);
		}
	});
	
}


function switchBackground(position, minHeight){
	$('#calendario-content').css({ backgroundPosition: position, height: minHeight });
}


function numOver(element){
	$(".calEvento-globo", $(element).parent().parent()).show();
}

function numOut(element){
	$(".calEvento-globo", $(element).parent().parent()).hide();
}


function getEvent(d,m,a, idioma) {
	
	$.ajax({
		type: "POST",
		url: "xml/getEventoData.php",
		data: "d="+d+"&m="+m+"&a="+a+"&idioma="+idioma,
		cache: false,
		async: false,
		success: function(html){
			$('#listado_eventos').html(html);
			$('div#visor_info').jScrollPane({ "scrollbarMargin":0, "scrollbarWidth":15 });
			//$('.jScrollPaneContainer').css("height",410);
			$('#listado_eventos').css("top",0);
			//$('#visor_info ul').css("width",$('#visor_info ul li').length*651);
			//$('#visor_info').trigger( 'goto', [ 0 ] );
			//$('.flecha_medio').height($("#tabla_eventos_info").height()-11);
		//$('#flecha_prev').css("margin-top",($('.flecha_medio').height()/2)-10);
			//$('#flecha_next').css("margin-top",($('.flecha_medio').height()/2)-10);
		}
	});
	
}

function get_month_events(a,m, idioma) {
	
	$.ajax({
		type: "POST",
		url: "xml/getEventosMes.php",
		data: "m="+m+"&a="+a+"&idioma="+idioma,
		cache: false,
		async: false,
		success: function(html){
			$('#listado_eventos').html(html);
			$('div#visor_info').jScrollPane({ "scrollbarMargin":0, "scrollbarWidth":15 });
            //$('.jScrollPaneContainer').css("height",410);
			//$('#visor_info ul').css("width",$('#visor_info ul li').length*651);
		//	$('.flecha_medio').height($("#tabla_eventos_info").height()-11);
		//$('#flecha_prev').css("margin-top",($('.flecha_medio').height()/2)-10);
		//	$('#flecha_next').css("margin-top",($('.flecha_medio').height()/2)-10);
			//$('#visor_info').trigger( 'goto', [ 0 ] );
		}
	});
	
}

function loadMask(){
	$("#marcoDerecho").mbMaskGallery({
		type:"normal",
		galleryMask:"images/eventos/mask.png",
		galleryColor:"#E3E1D6",
		loader:false,
		changeOnClick:false
	});
}
