Cufon.replace('h1, h2, h3, button, legend, p.aceptar');

$(document).ready(function(){



	/* carrousel principal */
	if ($('#carrousel')[0])
	{
		$('#carrousel').loopedCarousel({
			showPagination: false,
			padding: 0,
			vertical:false
		});
	}

	/* pop-up */
	$("a[rel='pop-up']").click(function () {
		var privacidad = "height=600,width=500,scrollTo,resizable=0,scrollbars=1,location=0";
		nueva=window.open(this.href, 'Popup', privacidad);
		return false;
	});


	/* pop-up entra a la prueba*/
	$("#btn_entrar").click(function (){
		var privacidad = "height=650,width=960,scrollTo,resizable=0,scrollbars=1,location=0";
		nueva=window.open(this.href, 'Popup', privacidad);
		return false;
	});

	/* carrousel2 */
	var cont = $('#carrousel2');
	var a = cont.find("ul li a")
	a.click(function(){
		var visibleElement = $( $(this).attr("href") );
		visibleElement.parent().find("div").hide();
		visibleElement.show();
	});

	//a.first().click();
	setInterval(function(){ $("a[href=#" + window.location.href.split("#")[1] + "]" ).click();  },100);

	//Seleccion producto post-cupon
	$(".seleccion-producto .subnivel").hide();
	$(".seleccion-producto .boton_form").hide();


	/*$("#form2 input:not(.subnivel input)").change(function() {
		$(".seleccion-producto .subnivel:not(." + $(this).attr("id") + ")").slideUp();
		$("." + $(this).attr("id") ).slideDown(function(){
			$(".seleccion-producto .boton_form").fadeIn(1000);
		});

	});*/


});
