// accordion de servicios en home
$(document).ready(function() {
// efecto fade p/imgs
		$(function() {
			$(".enlaces_sitio img").css("opacity","0.5");
			$(".enlaces_sitio img").hover(function () {
			$(this).stop().animate({
			opacity: 1.0
			}, "slow");
		},
		function () {
			$(this).stop().animate({
			opacity: 0.5
			}, "slow");
			});
		});

});
// editar titulo en modulos
function prenderTitulo(modulo_id){
	$("#editarTitulo_"+modulo_id).toggle();
}
// Efecto slow para menu principal
//
$(document).ready(function () {
	$('#navegacion ul li ul').hide();
    $('#navegacion ul li').hover(function () {
			$(this).find('> ul').stop(true, true).slideDown('slow');
 		}, function() {
 			$(this).find('> ul').stop(true, true).slideUp('slow'); 	
		});
});
//
// Cufon: Titulos con fuente
//
Cufon.replace('h1');
Cufon.replace('h2');
Cufon.replace('h3');
Cufon.replace('h5.tit5');
Cufon.replace('.novedades-ultimas li h2 a',{hover: true});
Cufon.replace('#navegacion a',{hover: true});
Cufon.replace('.lista-categorias a',{hover: true});

//
// al top de pagina
//

	jQuery(document).ready(function(){
		// modulo galeria imagenes
		$(".image").click(function() {
			var image = $(this).attr("rel");
			$('#image').hide();
			$('#image').fadeIn('slow');
			$('#image').html('<img src="' + image + '" alt="imagen" />');
			return false;
				});
	});

//We are using $(window).load here because we want to wait until the images are loaded
$(window).load(function(){
	//for each description div...
	$('div.description').each(function(){
		//...set the opacity to 0...
		$(this).css('opacity', 0);
		//..set width same as the image...
		$(this).css('width', $(this).siblings('img').width());
		//...get the parent (the wrapper) and set it's width same as the image width... '
		$(this).parent().css('width', $(this).siblings('img').width());
		//...set the display to block
		$(this).css('display', 'block');
	});

	$('div.wrapper').hover(function(){
		//when mouse hover over the wrapper div
		//get it's children elements with class description '
		//and show it using fadeTo
		$(this).children('.description').stop().fadeTo(500, 0.7);
	},function(){
		//when mouse out of the wrapper div
		//use fadeTo to hide the div
		$(this).children('.description').stop().fadeTo(500, 0);
	});

});


