// JavaScript Document
function hideShow(id) {
if(document.getElementById(id).style.display=="none") {
   document.getElementById(id).style.display="block";
   document.getElementById('tbl').style.display="";
 }
else {
   document.getElementById(id).style.display="none";
 
if((document.getElementById('box1').style.display=="none")&&
   (document.getElementById('box2').style.display=="none")&&
   (document.getElementById('box3').style.display=="none")&&
   (document.getElementById('box4').style.display=="none")) {

    document.getElementById('tbl').style.display=""
   }
  }
 }
 
function link (path) {
	window.top.location.href = path;
}

function trim(cadena)
{
	for(i=0; i<cadena.length; )
	{
		if(cadena.charAt(i)==" ")
			cadena=cadena.substring(i+1, cadena.length);
		else
			break;
	}

	for(i=cadena.length-1; i>=0; i=cadena.length-1)
	{
		if(cadena.charAt(i)==" ")
			cadena=cadena.substring(0,i);
		else
			break;
	}
	return cadena;
}

function validarEmail(valor) {
  if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(valor)){
    return true;
  } else {
    return false;
  }
}
