// JavaScript Document
function cargar_dimensiones_inicio(){
	var w = document.documentElement.clientWidth;
	var h = document.documentElement.clientHeight;


	// wl = ancho izquierdo (seleccion de lenguajes) -> 5% del ancho total
	var wl = (h*5)/100;
//	document.getElementById('content_languages_bg').style.width = wl+'px';
//		document.getElementById('languages_bg').style.width = wl+'px';

//	document.getElementById('content_languages_bg').style.width = '54px';
//	document.getElementById('languages_bg').style.width = '54px';

	document.getElementById('content_languages_bg').style.height = h+'px';
//	document.getElementById('languages_bg').style.height = (h)+'px';
	
//	var wb = ((w*99)/100)-0;
//	var wb = w-54;
//	var hi = 768;
//	var wi = 1312;	
	
	var hi = 1125;
	var wi = 2000;	
	
	var nw;

	
//	if(w<1366){
		if(wi<w ){
		h=hi*w/wi; 	
		nw = w;
	
			}
		else
		{
		h=hi;
		nw=h*wi/hi; 
		}
		
//		h = 1125;
//		nw= 2000;
	/*}
	else{
	h=h;
	nw=w;	
	}*/
	
	
//	document.getElementById('content_cuerpo_bg').style.width = nw+'px';
//	document.getElementById('cuerpo_bg').style.width = nw+'px';
//	document.getElementById('content_cuerpo_bg').style.height = h+'px';
	
	document.getElementById('cuerpo_bg').height = h;
//	document.getElementById('cuerpo_bg').style.height = h+'px';	
	document.getElementById('cuerpo_bg').width=nw;
	document.getElementById('cuerpo_bg').style.width=nw+'px';	
	var middle = 10;//(wl/2);

}

function update_background(bg){
	 var screenWidth = document.documentElement.clientWidth;
	 var screenHeight = document.documentElement.clientHeight;
	 var bg = jQuery("#"+bg);  
	
	 // Proporcion horizontal/vertical. En este caso la imagen es cuadrada  
	 var ratio = 1;  
	 if(screenWidth/screenHeight > ratio) { 
		$(bg).height("auto");  
		$(bg).width("100%");  
	 }else{  
		$(bg).width("auto");  
		$(bg).height("100%");  
	 }  
	 
	 // Si a la imagen le sobra anchura, la centramos a mano  
	 if($(bg).width() > 0){  
		$(bg).css('left', (screenWidth - $(bg).width()) / 2);  
	 }
} 

$(document).ready(function(){
	$(".panel .boton").click(function(){

		document.getElementById('cuerpo_absolute').style.display = "inline"; 
		document.getElementById('menuesp').style.display = "inline"; 
		document.getElementById('menuall').style.display = "none"; 	
		document.getElementById('menuing').style.display = "none"; 	
		document.getElementById('abiografia').innerHTML = "BIOGRAF&Iacute;A";
		document.getElementById('ahistoria').innerHTML = "HISTORIA ARTIST&Iacute;CA";			

		procesaAjax("index_ing.php","idioma=_esp&opcion=biografia","info_down");
		$(this).parents(".panel").animate({ opacity: 'hide' }, 3000);
		
		document.body.style.overflow  = "auto";
	});
});

$(document).ready(function(){
	$(".panel .boton_ing").click(function(){


	document.getElementById('cuerpo_absolute').style.display = "inline"; 
	document.getElementById('menuesp').style.display = "none"; 
	document.getElementById('menuall').style.display = "none"; 		
	document.getElementById('menuing').style.display = "inline"; 	


	
	document.getElementById('abiografia').innerHTML = "BIOGRAPHY";
	document.getElementById('ahistoria').innerHTML = "RESUME";	
	procesaAjax("index_ing.php","idioma=_ing&opcion=biografia","info_down");
/*		document.body.style.overflow  = "auto";*/
		$(this).parents(".panel").animate({ opacity: 'hide' }, 3000);
		document.body.style.overflow  = "auto";		
	});
});

function show_t(op){
	if(op == "biografia"){
		
	document.getElementById("texto_bio").style.display="inline";
	document.getElementById("texto_hist").style.display="none";
	document.getElementById("abiografia").className="color_gold";	
	document.getElementById("ahistoria").className="color_brown";
		
	document.getElementById('foto_text').style.display = "inline"; 	
	document.getElementById('foto_historia').style.display = "none"; 	

	}
	if(op == "historia"){
		
	document.getElementById("texto_bio").style.display="none";	
	document.getElementById("texto_hist").style.display="inline";
				
	document.getElementById('foto_text').style.display = "none"; 		
	document.getElementById('foto_historia').style.display = "inline"; 	

	document.getElementById("abiografia").className="color_brown";	
	document.getElementById("ahistoria").className="color_gold";	

	}
}
