var ax =  0;
$(document).ready(function(){
	var a1 = $('#den').height() + 20;
	var bg = "Влез";
	var en = "Enter";
	var es = "Entrada";
	
	$('#den').css('opacity', 1);
	$('.hold').css('height', a1);
	$('ul').click(function(){
		$(this).animate({
	          height: 95
	      }, {queue:false,duration:250});
		
	});
	$('ul').mouseleave(function(){
		$(this).animate({
	          height: 25
	      }, {queue:false,duration:250});		
	});
	$('ul li').click(function(){
		$('.unbind').html($(this).html());
		$('ul').height(25);
		if($(this).attr('id')=='bg'){
		$('#submit').attr('value', bg);
		}
		else if($(this).attr('id')=='en'){
		$('#submit').attr('value', en);
		}
		else {
		$('#submit').attr('value', es);
		}
		$('#lang').attr('value', $(this).attr('id'));
		var a2 = $('#d'+$(this).attr('id')).height() + 20;
		//alert(a2);
		$('.hold').animate({
	          height: a2
	      }, {queue:false,duration: 500});	  
		$('.lang').animate({	         
	          opacity: 0
	      }, {queue:true,duration: 300});	  
	      
		$('#d'+$(this).attr('id')).animate({
	          opacity: 1
	      }, {queue:true,duration: 300});
		$('#d'+$(this).attr('id')).animate({
	          opacity: 1
	      }, {queue:true,duration: 300});
	});
	$('.unbind').unbind();
});


