/* Js para mostrar las secciones y la Red Universia() */

function mostrarSecciones()
{

    mostrarRedUniversia();
    mostrarOpenID();
	mostrarTabs();

}

function mostrarRedUniversia()
{
    var secciones = document.getElementById("reduniversia");
    secciones.className = "mas-secciones";
	try {	
	    secciones.onmouseover = function()
	    {
	        	secciones.className = "block";
	    }	
	    secciones.onmouseout = function()
	    {
	        	secciones.className = "";
       	
	    }	
	} catch (e) {}
}


// 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 mostrarOpenID()
{
    var boton = document.getElementById("openID-boton");
    var boton2 = document.getElementById("usuarios-boton");
    var capa = document.getElementById("openID");
    var capa2 = document.getElementById("usuarios");
    var capa3 = document.getElementById("usuario");
	
	try{
    boton.onclick = function()
    {
		capa2.className = "hidden";
		capa3.className = "usuario-universia";
		capa.className = "block";
		boton.className = "hidden";
		boton2.className = "";    	
    }

    boton2.onclick = function()
    {
		capa2.className = "block";
		capa3.className = "";
		capa.className = "hidden";
		boton.className = "";
		boton2.className = "hidden";
    }

	} catch (e) {}    
}


function mostrarTabs()
{
    var boton0 = document.getElementById("solapa-0");
	var boton1 = document.getElementById("solapa-1");
	var boton2 = document.getElementById("solapa-2");

	try {

		boton0.onclick = function()    {
	        boton0.className = "seleccionadoSolapa";
	        boton1.className = "";
			boton2.className = "";
			cargaFormuEstDerech(urlServerEst + solapa0url);			
	   	}
		
		boton1.onclick = function()    {
	        boton0.className = "";
	        boton1.className = "seleccionadoSolapa";
			boton2.className = "";
			cargaFormuEstDerech(urlServerEst + solapa1url);
	    }
		
		boton2.onclick = function()    {
	        boton0.className = "";
	        boton1.className = "";
			boton2.className = "seleccionadoSolapa";
 			cargaFormuEstDerech(urlServerEst + solapa2url);			
	    }
	
	} catch (e) {}

}

onload = mostrarSecciones;