// Funciones varias
//
function setFocus(campo) {
	id = document.getElementById(campo);
	if (id) {
		id.focus();
	}
}

function trim(valor){
	var re = /^(\s)*|(\s)*$/;
	var str = (valor ? valor : this);
	return str.replace(re,'');
}

function checkLetras(){
  document.getElementById('texto').value = document.getElementById('texto').value.trim();
  if (document.getElementById('texto').value.length < 3) {
  	alert("Ingrese por favor al menos 3 letras.");
    return false;
  }
  return true;
}

function isMSIE()
{
	return (navigator.appName == "Microsoft Internet Explorer");
}

function isSafari()
{
	var agt=navigator.userAgent.toLowerCase();
	return ((agt.indexOf('safari')!=-1)&&(agt.indexOf('mac')!=-1))?true:false;;
}

/* bloque el scroll de la pag. principal*/
function block() {
		document.body.scroll         = "no";
		document.body.style.overflow = "hidden";
	//document.body.appendChild(objBlock);
}


/* desbloque el scroll de la pag. principal*/
function unblock() {
		document.body.scroll = "yes";
		document.body.style.overflow = "auto";
}

function imprimir() {
		window.print();
}

