function pulsar(src) {
	if(event.srcElement.tagName=='TD'){
		src.children.tags('A')[0].click();
	}
}	  

function sobre(src, capa) {
    if (!src.contains(event.fromElement)) {
	  src.className='menuSobre';
	}
	if (capa) showHide(capa, 'show', 'v');
}
	  
function fuera(src, capa) {
	if (!src.contains(event.toElement)) {
	  src.className='menu';
	}
	if (capa) showHide(capa, 'hide', 'v');
}
function str_trim(inputString) { 
	if (typeof inputString != "string") { 
		return inputString; 
	} 
	var retValue = inputString; 
	var ch = retValue.substring(0, 1); 
	while (ch == " ") { 
		retValue = retValue.substring(1, retValue.length); 
		ch = retValue.substring(0, 1); 	
	} 
	ch = retValue.substring(retValue.length-1, retValue.length); 
	while (ch == " ") { 
		retValue = retValue.substring(0, retValue.length-1); 
		ch = retValue.substring(retValue.length-1, retValue.length); 	
	} 
	/*while (retValue.indexOf(" ") != -1) { 
		retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ")+1, retValue.length); 
		alert(retValue);
	} */	
	return retValue; 
} 

function fechaValida(campo) {
	string = str_trim(campo.value); 	
	chars = '0123456789-';
	if (string == "" || string.length != 10) {
		alert('Ingrese una fecha válida (dd-mm-aaaa)');
		campo.focus();
		return false;
	}
	for (i=0; i<string.length; i++) {
		chr = string.charAt(i);
		if (chars.indexOf(chr) == -1) {
			alert('Ingrese una fecha válida (dd-mm-aaaa)');
			campo.focus();
			return false;
		};
	}	
	return true;
}
function showHide(what, sh, dv) { // dv:  display (d) o visibility (v)
	var aux='';
	if (!dv) dv='d';

	if (dv=='d') 
	{
		if (sh=='show') aux='block';
		else aux='none';	
		var str="document.getElementById('" + what +"').style.display='" + aux + "';";
	} 
	else
	{
		if (sh=='show') aux='visible';
		else aux='hidden';	
		var str="document.getElementById('" + what +"').style.visibility='" + aux + "';";
	}
	eval(str);
}

function checkFecha(evt) {
	evt = (evt) ? evt : window.event
	var charCode = (evt.which) ? evt.which : evt.keyCode
	if (charCode > 31 && (charCode < 44 || charCode > 57)) {
		status = 'Caracter no permitido';
		setTimeout("status = '';",  2000);
		return false
	}
	status = '';
	return true
}

function isEmpty (objeto) {
	for (i=0; i < objeto.value.length; i++) 
		if (objeto.value.substring(i, i+1) != ' ' ) return false;
				
	return true;
}