function activar(boton)
{	
	txt = eval(boton+"on");
	document.getElementById(boton).innerHTML=txt;
	eval ("document.getElementById('"+boton+"').className = 'botonon'");
}

function pulsar(boton)
{	
	txt = eval(boton+"off");
	document.getElementById(boton).innerHTML=txt;
	eval ("document.getElementById('"+boton+"').className = 'pulsado'");
}

function foco(enlace)
{
	if (enlace.blur) enlace.blur();
}

function rollover(encima, objeto)
{
	if (encima)
		objeto.className = 'rollover';
	else
		objeto.className = 'botonon';
}

function desactivar(boton)
{	
	txt = eval(boton+"off");
	document.getElementById(boton).innerHTML=txt;
	eval ("document.getElementById('"+boton+"').className = 'botonoff'");
}

function enfocar(formulario,campo)
{
	eval("document."+formulario+"."+campo+".focus()");
}

function asignar(formulario,campo,valor)
{
	eval('document.'+formulario+'.'+campo+'.value="'+valor+'"');
}

function comprueba(formulario,campo,texto)
{
	var formu = eval('document.'+formulario+'.'+campo+'.value');
	if (formu=="")
	{
		//alert("<%=dic_falta_campo%> " + texto);
		alert(texto);
		enfocar(formulario,campo)
		return false;
	}
	else
		return true;
}


function borra(obj)
{
		obj.value="";
		obj.className ="text"
}

function CalPop2(sInputName)
{
	window.open('/calpop/Calendar.asp?N=' + escape(sInputName) + '&DT=' + escape(window.eval(sInputName).value), 'CalPop', 'scrollbars=no,status=no,resizable=no,titlebar=no,directories=no,hotkeys=no,menubar=no,location=no,personalbar=no,toolbar=no,width=290,height=165');
}

function CalPop(sInputName)
{
	window.open('/calpop/noname2.asp?N=' + escape(sInputName) + '&DT=' + escape(window.eval(sInputName).value), 'CalPop', 'scrollbars=no,status=no,resizable=no,titlebar=no,directories=no,hotkeys=no,menubar=no,location=no,personalbar=no,toolbar=no,width=290,height=165');
}

function navega()
{
	x = (screen.width-600)/2
	y = (screen.height-400)/2
	var carac = 'scrollbars=yes,status=yes,resizable=yes,titlebar=no,directories=no,menubar=no,location=yes,personalbar=no,toolbar=no,width=600,height=330,left='+x+',top='+y
	window.open('','',carac);
}

function abrirventana_b(popurl,w,h){
	//x1 = (screen.width-800)/2;
	//x2 = (595-w)/2;
	//x = 192 + x1 + x2;
	x = (screen.width-w)/2;
	//y1 = (431-h)/2;
	//y = 110 + y1;
	y = (screen.height-h)/2;
	var winpops=window.open(popurl,"","width="+w+",height="+h+",scrollbars,")
	winpops.moveTo(x,y);
}

function abreDialog(popurl,w,h){
	//x1 = (screen.width-800)/2;
	//x = x1 + (595/2);
	x = (screen.width-w)/2;
	//y = 180;
	y = (screen.height-h)/2;
	window.showModalDialog(popurl,'','help:no;dialogHeight:'+h+'px;dialogWidth:'+w+'px;status:no;scroll:no;dialogLeft:'+x+'px;dialogTop:'+y+'px;');
}

function trim(cadena)
{
	return(ltrim(rtrim(cadena)))
}

function ltrim(cadena)
{
	xcad = cadena
	if (xcad.substring(0,1) != " ")
		return xcad
	else
		return ltrim(xcad.substring(1,xcad.length))
}

function rtrim(cadena)
{
	xcad = cadena
	if (xcad.substring(xcad.length-1,xcad.length) != " ")
		return xcad
	else
		return rtrim(xcad.substring(0,xcad.length-1))
}


function abrirAyuda(popurl,texto,w,h){
//	alert(popurl);
	w = 591;
	h = 493;
	x = (screen.width-w)/2;
	y = (screen.height-h)/2;
	var winpops=window.open("ayuda/help.asp?p="+popurl+"&t="+texto,"ayuda","width="+w+",height="+h+"")
	winpops.moveTo(x,y);
}


function click() {
	if (event.button==2) {
		alert ('Este boton esta desabilitado.')
	}
}
//document.onmousedown=click


