/* Js para mostrar las secciones y la Red Universia() 
onLoad esta nos arquivos header.jsp e header_interna.jsp
*/


function mostrarSecciones() {
	
	mostrarRedUniversia();
	/*
	var boton = document.getElementById("mas-secciones");
	var secciones = document.getElementById("secciones");
	
	boton.onmouseover = function() {
		secciones.className = "block";
		boton.className = "mas-secciones";
	}
	
	boton.onmouseout = function() {
		secciones.className = "";
		boton.className = "";
	}
	
	
	secciones.onmouseover = function() {
		secciones.className = "block";
		boton.className = "mas-secciones";
	}
	
	secciones.onmouseout = function() {
		secciones.className = "";
		boton.className = "";
	}
	*/
}


function mostrarRedUniversia() {
	
	var boton = document.getElementById("red-universia");
	var secciones = document.getElementById("reduniversia");
	
	boton.onmouseover = function() {
		secciones.className = "block";
		boton.className = "mas-secciones";
	}
	
	boton.onmouseout = function() {
		secciones.className = "";
		boton.className = "";
	}
	
	
	secciones.onmouseover = function() {
		secciones.className = "block";
		boton.className = "mas-secciones";
	}
	
	secciones.onmouseout = function() {
		secciones.className = "";
		boton.className = "";
	}

}

function caixalogin() {
	
	/* script para a seta de login */
	
	var boton;
	var secciones;

	if(document.getElementById("vai-login")!=null ){
		boton = document.getElementById("vai-login");
		secciones = document.getElementById("caixa-login");
		boton.onclick = function() {
		secciones.className = "block";
		}
		
		secciones.onclick = function() {
			secciones.className = "";
		}
	}
	
	if(document.getElementById("vai-login1")!=null ){
		boton = document.getElementById("vai-login1");
		secciones = document.getElementById("caixa-login");
		boton.onclick = function() {
		secciones.className = "block";
		}
		
		secciones.onclick = function() {
			secciones.className = "";
		}
	}

	
	/* script para o servi?o provas interativas */
	
	var boton1;
	var boton2;
	var boton3;
	var boton4;
	var boton5;
	var boton6;
	
	var secciones1;
	var secciones2;
	var secciones3;
	var secciones4;
	
	if(document.getElementById("tabela1")!=null ){
		boton1 = document.getElementById("botao1");
		boton2 = document.getElementById("botao2");
		boton3 = document.getElementById("botao3");
		boton4 = document.getElementById("voltar");
		boton5 = document.getElementById("voltar1");
		boton6 = document.getElementById("voltar2");
		
		secciones1 = document.getElementById("tabela1");
		secciones2 = document.getElementById("tabela2");
		secciones3 = document.getElementById("tabela3");
		secciones4 = document.getElementById("tabela4");
		
		secciones1.className = "block";
		
		boton1.onclick = function() {
			secciones1.className = "";
			secciones2.className = "block";
			secciones3.className = "";
			secciones4.className = "";
		}
		
		boton2.onclick = function() {
			secciones1.className = "";
			secciones2.className = "";
			secciones3.className = "block";
			secciones4.className = "";
		}
		
		boton3.onclick = function() {
			secciones1.className = "";
			secciones2.className = "";
			secciones3.className = "";
			secciones4.className = "block";
		}
		
		boton4.onclick  = function() {
			secciones1.className = "block";
			secciones2.className = "";
			secciones3.className = "";
			secciones4.className = "";
		}
		
		boton5.onclick  = function() {
			secciones1.className = "block";
			secciones2.className = "";
			secciones3.className = "";
			secciones4.className = "";
		}
		
		boton6.onclick  = function() {
			secciones1.className = "block";
			secciones2.className = "";
			secciones3.className = "";
			secciones4.className = "";
		}
	}
}

function popup(pagina,w,h,s) {
	if (self.screen) { 
		sw = screen.width;
		sh = screen.height;
		cx = (.5*sw) - (w*.5);
		cy = (.5*sh) - (h*.5);
		var dimentions_and_such = 'width='+w+','+'height='+h+',' + 'screenX=' +cx+','+'screenY='+cy+','+'left='+cx+','+'top='+cy+',scrollbars='+s;
	}
	window.open(pagina,"popmm",dimentions_and_such);
}

function getData(){
	var data = new Date();
	var mes = data.getMonth() + 1;
	if (mes <= 9)
		mes = "0" + mes;
	return data.getDate()+"/"+mes+"/"+data.getFullYear();
}


function getDia(lingua){
	var data = new Date();
	var diasPt = new Array("Domingo","Segunda-feira","Ter&ccedil;a-feira","Quarta-feira","Quinta-feira","Sexta-feira","S&aacute;bado");
	var diasEs = new Array("Domingo","Lunes","Martes","Mi&eacute;rcoles","Jueves","Viernes","S&aacute;bado");
	
	if (lingua=='pt')
		return diasPt[data.getDay()];
	else	
		return diasEs[data.getDay()];
}
    
// javascript para cambiar el tama?o del texto modificacion de http://www.white-hat-web-design.co.uk/articles/js-fontsize.php
/*
var min=8;
var max=18;

function increaseFontSize() {
	var caja = document.getElementById("text-size");
   var p = caja.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }
   var h2 = caja.getElementsByTagName('h2');
   for(i=0;i<h2.length;i++) {
      if(h2[i].style.fontSize) {
         var s = parseInt(h2[i].style.fontSize.replace("px",""));
      } else {
         var s = 24;
      }
      if(s!=max) {
         s += 1;
      }
      h2[i].style.fontSize = s+"px"
   }
}
function decreaseFontSize() {
	var caja = document.getElementById("text-size");
   var p = caja.getElementsByTagName('p');    
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }
   var h2 = caja.getElementsByTagName('h2');
   for(i=0;i<h2.length;i++) {
      if(h2[i].style.fontSize) {
         var s = parseInt(h2[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 2;
      }
      h2[i].style.fontSize = s+"px"
   }   
}

function aumentarTexto() {
	
	var boton = document.getElementById("aumentar");
	var caja = document.getElementById("text-size");
	
	boton.onclick = function() {
		caja.className = "destacado1 caja-ancha text-size-mas";
	}

}

function disminuirTexto() {
	
	var boton = document.getElementById("disminuir");
	var caja = document.getElementById("text-size");
	
	boton.onclick = function() {
		caja.className = "destacado1 caja-ancha text-size-menos";
	}

}*/