﻿visible = "defecto";
function verComponente(componente) {
	
	document.getElementById(visible).style.display = 'none';
	document.getElementById(componente).style.display = 'block';
	visible = componente;
	
	}
function cerrar(){
	document.getElementById(visible).style.display = 'none';
	}
function carga()
{
	posicion=0; elMovimiento=null;
	
	// IE
	if(navigator.userAgent.indexOf("MSIE")>=0) navegador=0;
	// Otros
	else navegador=1;
}


function first(){ 

   {
    Shadowbox.init(); 

    // open a welcome message 
    Shadowbox.open({ 
        player:     'iframe', 
		
        title:      '¿Usando Internet Explorer? ', 
        content:    'noie.html', 
        height:     410, 
        width:      500 
		
    }); 
	};
	
	
        
}

function firsti(){ 

   {
    Shadowbox.init(); 

	};
	
	
        
}

function evitaEventos(event)
{
	// Funcion que evita que se ejecuten eventos adicionales
	if(navegador==0)
	{
		window.event.cancelBubble=true;
		window.event.returnValue=false;
	}
	if(navegador==1) event.preventDefault();
}

function comienzoMovimiento(event, id)
{
	elMovimiento=document.getElementById(id);
	
	/* Si el elemento que se le hizo click es texto (nodeType=3) se toma como target
	el elemento padre */
	if(elMovimiento.nodeType==3) elMovimiento=elMovimiento.parentNode;
	
	 // Obtengo la posicion del cursor
	if(navegador==0)
	 {
	 	cursorComienzoX=window.event.clientX+document.documentElement.scrollLeft+document.body.scrollLeft;
		cursorComienzoY=window.event.clientY+document.documentElement.scrollTop+document.body.scrollTop;

		document.attachEvent("onmousemove", enMovimiento);
		document.attachEvent("onmouseup", finMovimiento);
	}
	if(navegador==1)
	{    
		cursorComienzoX=event.clientX+window.scrollX;
		cursorComienzoY=event.clientY+window.scrollY;
		
		document.addEventListener("mousemove", enMovimiento, true); 
		document.addEventListener("mouseup", finMovimiento, true);
	}
	
	elComienzoX=parseInt(elMovimiento.style.left);
	elComienzoY=parseInt(elMovimiento.style.top);
	// Actualizo el posicion del elemento
	elMovimiento.style.zIndex=++posicion;
	
	evitaEventos(event);
}

function enMovimiento(event)
{  
	var xActual, yActual;
	if(navegador==0)
	{    
		xActual=window.event.clientX+document.documentElement.scrollLeft+document.body.scrollLeft;
		yActual=window.event.clientY+document.documentElement.scrollTop+document.body.scrollTop;
	}  
	if(navegador==1)
	{
		xActual=event.clientX+window.scrollX;
		yActual=event.clientY+window.scrollY;
	}
	
	elMovimiento.style.left=(elComienzoX+xActual-cursorComienzoX)+"px";
	elMovimiento.style.top=(elComienzoY+yActual-cursorComienzoY)+"px";

	evitaEventos(event);
}

function finMovimiento(event)
{
	if(navegador==0)
	{    
		document.detachEvent("onmousemove", enMovimiento);
		document.detachEvent("onmouseup", finMovimiento);
	}
	if(navegador==1)
	{
		document.removeEventListener("mousemove", enMovimiento, true);
		document.removeEventListener("mouseup", finMovimiento, true); 
	}
}

<!--
	function redimensionar() {
		
			var altura = (window.innerHeight - 162);
			var altura = (document.body.clientHeight - 162);
			document.getElementById('cont').style.height = altura+'px';
		    
	}
//-->



    function aparecer(id){
	
	document.getElementById(id).style.display="block";
	}
	
	
	
	var h=0;
var exp;
	var altura = 0;
	var velocidad = 10;
		function extender() {
		var objeto = document.getElementById('menuext');
		objeto.style.display = 'block';
		altura += velocidad;
		if (!(altura <= -170)) {
			objeto.style.height = altura + 'px';
			window.setTimeout ("extender();", 20);
		}
		
	}
	function contraer() {
		var objeto2 = document.getElementById('menuext');
		altura -= velocidad;
		if (!(altura >= 0)) {
			objeto2.style.height = altura + 'px';
			window.setTimeout ("contraer();", 20);
		} else {
			objeto2.style.display = 'none';
			objeto2.style.height = '0px';
		}
		
	}
	function extender_contraer () {
		if (	altura <= 0) {
			extender();
		} else {
			contraer();
		}
	}

	

	var altura2 = 0;
	var velocidad2 = 10;
	function exte() {
		var objeto3 = document.getElementById('buscasik');
		objeto3.style.display = 'block';
		altura2 += velocidad2;
		if (!(altura2 >= 43)) {
			objeto3.style.height = altura2 + 'px';
			window.setTimeout ("exte();", 20);
		}
		
	}
	function contra() {
		var objeto4 = document.getElementById('buscasik');
		altura2 -= velocidad2;
		if (!(altura2 <= 0)) {
			objeto4.style.height = altura2 + 'px';
			window.setTimeout ("contra();", 20);
		} else {
			objeto4.style.display = 'none';
			objeto4.style.height = '0px';
		}
		
	}
	function exte_contra () {
		if (	altura2 <= 0) {
			exte();
		} else {
			contra();
		}
	}
	
var altura3 = 0;
	var velocidad3 = 10;
	function exter() {
		var objeto5 = document.getElementById('herra');
		objeto5.style.display = 'block';
		altura3 += velocidad3;
		if (!(altura3 >= 200)) {
			objeto5.style.height = altura3 + 'px';
			window.setTimeout ("exter();", 20);
		}
		
	}
	function contrar() {
		var objeto6 = document.getElementById('herra');
		altura3 -= velocidad3;
		if (!(altura3 <= 0)) {
			objeto6.style.height = altura3 + 'px';
			window.setTimeout ("contrar();", 20);
		} else {
			objeto6.style.display = 'none';
			objeto6.style.height = '0px';
		}
		
	}
	function exter_contrar () {
		if (	altura3 <= 0) {
			exter();
		} else {
			contrar();
		}
	}
		
		
var altura4 = 0;
	var velocidad4 = 10;
	function externa() {
		var objeto7 = document.getElementById('nuevos');
		objeto7.style.display = 'block';
		altura4 += velocidad4;
		if (!(altura4 >= 279)) {
			objeto7.style.marginTop = '-' + altura4 + 'px';
			window.setTimeout ("externa();", 20);
		}
		
	}
	function contrarne() {
		var objeto8 = document.getElementById('nuevos');
		altura4 -= velocidad4;
		if (!(altura4 <= 10)) {
			objeto8.style.marginTop = '-' + altura4 + 'px';
			window.setTimeout ("contrarne();", 20);
		} else {
			objeto8.style.display = 'none';
			objeto8.style.height = '0px';
		}
		
	}
	function externa_contrarne () {
		if (	altura4 <= 0) {
			externa();
		} else {
			contrarne();
		}
	}		
	

var altura41 = 0;
	var velocidad41 = 10;
	function externa2() {
		var objeto71 = document.getElementById('nuevo2s');
		objeto71.style.display = 'block';
		altura41 += velocidad41;
		if (!(altura41 >= 279)) {
			objeto71.style.marginTop = '-' + altura41 + 'px';
			window.setTimeout ("externa2();", 20);
		}
		
	}
	function contrarne2() {
		var objeto81 = document.getElementById('nuevo2s');
		altura41 -= velocidad41;
		if (!(altura41 <= 10)) {
			objeto81.style.marginTop = '-' + altura41 + 'px';
			window.setTimeout ("contrarne2();", 20);
		} else {
			objeto81.style.display = 'none';
			objeto81.style.height = '0px';
		}
		
	}
	function externa2_contrarne2 () {
		if (	altura41 <= 0) {
			externa2();
		} else {
			contrarne2();
		}
	}			









