// JavaScript Document



function AbrirImagen(imagen, titulo, texto) {
	ss = new slideshow("ss");
	s = new slide();
	s.src =  imagen;
	s.link = imagen;
	s.title = titulo;
	s.text = texto;
	ss.add_slide(s);
	for (var i=0; i < ss.slides.length; i++) { s = ss.slides[i]; s.target = "ss_popup"; s.attr = "width=475,height=450,resizable=no,scrollbars=yes,left=50,top=100"; }
	ss.hotlink();
}


function show_hide( el ) {
	var obj = document.getElementById( el ); 	
	if ( obj.style.display == 'none' ) {
		obj.style.display = 'block';
	}
	else {
		obj.style.display = 'none';			
	}
	//alert( obj.style.display );
	//if //(obj.style.display = "none";) {  obj.style.display = "";	}
	//else { obj.style.display = "none"; }
}


function validarEmail(email)
{
    var splitted = email.match("^(.+)@(.+)$");
    if(splitted == null) return false;
    if(splitted[1] != null )
    {
      var regexp_user=/^\"?[\w-_\.]*\"?$/;
      if(splitted[1].match(regexp_user) == null) return false;
    }
    if(splitted[2] != null)
    {
      var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
      if(splitted[2].match(regexp_domain) == null) 
      {
	    var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
	    if(splitted[2].match(regexp_ip) == null) return false;
      }
      return true;
    }
	return false;
}



function MostrarYCentrarContenedor( c ){
	var scrollTop = 0;
	var contenedorH = 0;
	var contenedorW = 0;
	scrollTop = document.documentElement.scrollTop;
	
	var bloqueo = document.getElementById("bloqueo");
	if ( bloqueo) {
		bloqueo.style.top = scrollTop + "px";
		bloqueo.style.height = (document.documentElement.clientHeight - 2) + 30 +  "px";
		bloqueo.style.width = (document.documentElement.clientWidth -2 )+ "px";	
		bloqueo.style.visibility = 'visible';
	}

var contenedor = document.getElementById( c );
	if ( contenedor ) {
		contenedorH = contenedor.style.height;
		contenedorW = contenedor.style.width;
		contenedor.style.top = scrollTop + ( ( (document.documentElement.clientHeight - 2) / 2 ) - ( contenedorH / 2 ) ) - 100 + "px" ;
		contenedor.style.left = ( ( (document.documentElement.clientWidth - 2) / 2 ) - ( contenedorW / 2 ) ) - 200 + "px" ;
		contenedor.style.visibility = 'visible';
	}
}