// Maximizar ventana
window.moveTo(0,0);
if (document.all) {
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById) {
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
function keyPress(e) {
	if (!document.all) { var keycode = e.which;	} else { var keycode = e.keyCode; }
	var realkey = String.fromCharCode(keycode); 
	if (keycode == 13) { return false; } else { return true; }
}
function goBuscar() {
	var o_cBuscar = document.getElementById("cBuscar");
	if (o_cBuscar.value=="") {
		alert("Debe introducir un texto a buscar.");
		o_cBuscar.focus();
		return false; } 
	else {
		if (parseInt(o_cBuscar.value.length)<3) {
			alert("El texto a buscar debe ser superior de 3 caracteres.");
			o_cBuscar.focus();
			return false; } 
	}
	return true;
}
function zoom(img) {
	if (img!="") {
		window.open('/www.lc/zoom.asp?img='+img);	
	}	
}
function validaNumero(o) {
	var CaracteresPermitidos = '0123456789';
	if (o.value=="") {
		alert("El valor introducido no es válido.");
		o.focus();
		return false;
	}
	// verifica que las unidades introducidas sean correctas
	for (var Cont=0; Cont<o.value.length; Cont++) {
		X = o.value.substring(Cont,Cont+1);
		if (CaracteresPermitidos.indexOf(X)==-1) {
			alert("El valor introducido no es válido.");
			o.focus();
			return false;
		}
	}
	return true;
}
function ponenMayusculas(o) {
	o.value = o.value.toUpperCase();
}
function ponenMinusculas(o) {
	o.value = o.value.toLowerCase();
}