$.backstretch("img/bg_foto1.jpg", {speed: 2000});

$(window).resize(function() {
	posiciones();
});





function posiciones() {
	alto = $(window).height();
	if (cont+head+47+foot < alto) {
		$("#footer").css("position","absolute");
		$("#footer").css("top", alto-foot+"px");
	} else {
		$("#footer").css("position","relative");
		$("#footer").css("top","0");
	}
}







$(document).ready(function() {
	foot = $("#footer").height();
	cont = $("#contenido").height();
	head = $("#header").height();
	posiciones();

	$(".selectdd").msDropDown({mainCSS:'dd'});
	$(".ddChild").css("width","239");
	

	$('#desplegable a').click(function() {
		checkclass = $(this).attr('class');
//		alert(checkclass);
		if (checkclass == "activado") {
			$(this).removeClass("activado");
			$('#idioma ul').animate({
				height: '20px'
				}, 500, function() {
				// Animation complete.
			});
			
		} else {
			$(this).addClass("activado");
			$('#idioma ul').animate({
				height: '80px'
				}, 200, function() {
				// Animation complete.
				});
		}
	});
	
	
	$("#header").mouseleave(function(){
		$("#desplegable a").removeClass("activado");
			$('#idioma ul').animate({
				height: '20px'
				}, 500, function() {
				// Animation complete.
			});
	});


});
