function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


	/* Acordeon variables por defecto */
	
	numImagenes = 5;
	pageWidth= 960;
	maxWidth = 720; /* ancho real de la imagen (contando bordes y padding) */


$(document).ready(function(){
	/* colorbox */
	$("a[rel='lightbox']").colorbox();
	
	$(".popup600").colorbox({iframe:true, innerWidth:600, innerHeight:400});
	$(".popup").colorbox({iframe:true, innerWidth:800, innerHeight:600});
	$(".popupinline").colorbox({innerWidth:800, innerHeight:600, inline:true});	
	
	//$("span.popupspan").colorbox({iframe:true, innerWidth:800, innerHeight:600});
	$(".popupspan").colorbox({href:
							 function(){
							 	var url= $(this).attr('rel');
								return url;																
							 },iframe:true, innerWidth:800, innerHeight:600});
    		
	
	
	/* Acordeon */
	
    medWidth = pageWidth/numImagenes;
	minWidth = (pageWidth-maxWidth)/(numImagenes-1);	

	$("#acorde a.blq").animate({width: medWidth+"px"}, { queue:false, duration:1400 });
		

    $("#acorde a.blq").bind('mouseover', function() {
				$("#acorde a.blq").animate({width: minWidth+"px"}, { queue:false, duration:400 });
				$(this).animate({width: maxWidth+"px"}, { queue:false, duration:400});
				$("div div",this).removeClass('recetas');
    });
		
		
	$("#acorde").bind('mouseout', function() {
				$("#acorde a.blq").animate({width: medWidth+"px"}, { queue:false, duration:400 });
				$("div div",this).addClass('recetas');
				
    });
		
	// Slider
  	//$('#coin-slider').coinslider({width:960,height:575,opacity:1,delay: 3000,navigation: false,hoverPause: false, links: false, effect: 'swirl'});				
	
    // Scroll para contenidos
	$('.scroll-pane').jScrollPane({verticalGutter:20});

});



	

	
// SLIDESWITCH	
function slideSwitch() {
	
	var $active = $('.slide DIV.active');	
	if ( $active.length == 0 ) $active = $('.slide DIV:last');	
		// los divs se muestran en el orden que esten en el codigo
		var $next =  $active.next().length ? $active.next() : $('.slide DIV:first');
		  // descomentar para que los divs se muestren aleatoriamente		
		 // var $sibs  = $active.siblings();
		 // var rndNum = Math.floor(Math.random() * $sibs.length );
		 // var $next  = $( $sibs[ rndNum ] );	
		$active.addClass('last-active');	
		$next.css({opacity: 0.0})
			.addClass('active')
			.animate({opacity: 1.0}, 1000, function() {	
				$active.removeClass('active last-active');	
			});	
}
		
	
$(function() {	
		setInterval( "slideSwitch()", 4000 );	
});


/*
$(function() {
	  $('#datehoy_row').DatePicker({
		flat: true,
		format: 'Y-m-d',
		date: '2011-05-01',
		current:'2011-05-01',
		mode: 'single',
		calendars: 3,
		starts: 1,
		prev: '', next: ''
	});	
});
*/


