
/*  VARIABLES  */

// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false
	
	//velocidad de desplazamiento
	/*
	desp0=60;
	desp1=80;
	desp2=100;
*/	
	desp0=30;
	desp1=40;
	desp2=60;
	
	//ancho / alto doc
	var ancho = 0;
	var altur = 0;

	//ancho capas
	var infow = 350;
	
	//altura capas
	//var cap1h = 253;
	
	//situacion final
	var infof = 0;
	var noticia = 0;
	var aux_height_info;
	var aux_width_info;
	
/*****************************/
function ini_fra(){
	
	if (document.getElementById('menu_escuela')){
		ini_menu_escuela();
	}
	docsize();
	if(document.getElementById('lista_histo')){
		document.getElementById('lista_histo').style.marginTop = altur/2 - 150;
	}
	if(document.getElementById('foto_sec')){
		if(IE){
			document.getElementById('foto_sec').style.height = altur - 110;
		}else{
			document.getElementById('foto_sec').style.height = altur - 130;
			document.getElementById('barrafoto').style.bottom = -5;
		}
	}
	document.getElementById('info').style.marginLeft = 0;
	document.getElementById('info').style.display = "block";
	if (IE){
		document.getElementById('info').style.height = altur - 20;
	}else{
		document.getElementById('info').style.height = altur - 30;
	}
	aux_height_info = parseInt(document.getElementById('info').style.height);
	aux_width_info = aux_height_info * 2 / 3;
	if (document.getElementById('boxB')){
		document.getElementById('boxB').style.height = aux_height_info - 80;
	}
	if (document.getElementById('boxL_0')){
		document.getElementById('boxL_0').style.height = aux_height_info - 80;
		document.getElementById('boxL_0').style.width = 812 - aux_width_info;
	}
	if (document.getElementById('boxL_1')){
		document.getElementById('boxL_1').style.height = aux_height_info - 80;
		document.getElementById('boxL_1').style.width = 812 - aux_width_info;
	}
	if (document.getElementById('boxL_2')){
		document.getElementById('boxL_2').style.height = aux_height_info - 80;
		document.getElementById('boxL_2').style.width = 812 - aux_width_info;
	}
	document.getElementById('cont').style.marginLeft = 0;
	document.getElementById('cont').style.display = "block";
	document.getElementById('cont').style.height = altur - 50;
//	document.getElementById('barV').style.height = altur - 100;
//	document.getElementById('barV').style.width = 3;
//	ini_inf();
}

function docsize(){

	if( typeof( window.innerWidth ) == 'number' ) {
	//Non-IE
		ancho = window.innerWidth
		altur = window.innerHeight
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	//IE 6+ in 'standards compliant mode'
		ancho = document.documentElement.clientWidth
		altur = document.documentElement.clientHeight
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	//IE 4 compatible
		ancho = document.body.clientWidth
		altur = document.body.clientHeight
	}
}

function ini_inf(){
	val_1 = document.getElementById('info').style.marginLeft;
	num_1 = parseInt(val_1);
	num_1 = num_1 + (desp0 * -1);
	if (num_1 > 0 + desp0){
		document.getElementById('info').style.marginLeft = num_1;
		document.getElementById('cont').style.marginLeft = num_1;
		setTimeout("ini_inf()",1.0);
	}else{
		document.getElementById('info').style.marginLeft = 0;
		document.getElementById('cont').style.marginLeft = 0;
	}
}

function cam_web(web){
/*	val_1 = document.getElementById('info').style.marginLeft;
	num_1 = parseInt(val_1);
	num_1 = num_1 + (desp0 * -1);
	if (num_1 > (-ancho + desp0)){
		document.getElementById('info').style.marginLeft = num_1;
		document.getElementById('cont').style.marginLeft = num_1;
		setTimeout("cam_web('"+web+"')",1.0);
	}else{
		document.getElementById('info').style.marginLeft = -ancho;
		document.getElementById('cont').style.marginLeft = -ancho;*/
		document.location = web+".php";
//	}
}

function ini_menu_escuela(){
	document.getElementById('menu_escuela').style.display = "block";
	desactivar_menu_clases();
	desactivar_info_clases();
}

function menu_escuela(){
	if (document.getElementById('menu_escuela').style.display == "none"){
		document.getElementById('menu_escuela').style.display = "block";
	}else{
		ini_menu_escuela();
	}
}
function menu_clases(tipo){
	desactivar_info_clases();
	if (document.getElementById('menu_clases_'+tipo).style.display == "none"){
		desactivar_menu_clases();
		document.getElementById('menu_clases_'+tipo).style.display = "block";
		document.getElementById('opci_clases_'+tipo).style.textDecoration = "none";
	}else{
		desactivar_menu_clases();
	}
}

function mostrar_info(nombre){
	desactivar_info_clases();
	document.getElementById(nombre).style.display = "block";
}
function cerrar_info(nombre){
	document.getElementById(nombre).style.display = "none";
}
function desactivar_menu_clases(){
		document.getElementById('menu_clases_grup').style.display = "none";
		document.getElementById('menu_clases_part').style.display = "none";
		document.getElementById('menu_clases_espe').style.display = "none";
		document.getElementById('opci_clases_grup').style.textDecoration = "none";
		document.getElementById('opci_clases_part').style.textDecoration = "none";
		document.getElementById('opci_clases_espe').style.textDecoration = "none";
}

function desactivar_info_clases(){
	for (i=1;i<=12;i++) {
		document.getElementById('info'+i).style.display = "none";
	} 	
}

function ocultar(capa){
	document.getElementById(capa).style.display = "none";
}
function mostrar(capa){
	document.getElementById(capa).style.display = "block";
}
function opcion1(){
	ocultar('boxL_0');
	mostrar('boxL_1');
	ocultar('titulo_0');
	mostrar('titulo_1');
}
function opcion1_out(){
	ocultar('boxL_1');
	mostrar('boxL_0');
	ocultar('titulo_1');
	mostrar('titulo_0');
}
function opcion2(){
	ocultar('boxL_0');
	mostrar('boxL_2');
	ocultar('titulo_0');
	mostrar('titulo_2');
}
function opcion2_out(){
	ocultar('boxL_2');
	mostrar('boxL_0');
	ocultar('titulo_2');
	mostrar('titulo_0');
}
function opcionN_out(){
	ocultar('noticia'+noticia);
	mostrar('boxL_0');
	ocultar('titulo_N');
	mostrar('titulo_0');
}
function mostrar_noticia(num){
	noticia=num;
	ocultar('boxL_0');
	document.getElementById('noticia'+num).style.height = aux_height_info - 80;
	document.getElementById('noticia'+num).style.width = 822 - aux_width_info;
	mostrar('noticia'+num);
	ocultar('titulo_0');
	mostrar('titulo_N');
}

