// JavaScript Document

function retroceder1() {window.onmousedown = history.go(-1);}

/**************************************************************************************/

function eliminar(texto, link)
{
	var text = 'Seguro que desea borrar '+texto+'?';
	
	if(texto!='0')
	{	
		if (window.confirm(text))
		{
			window.location.href = link;
		}
	} else {window.location.href = link;}
}

/**************************************************************************************/

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

/**************************************************************************************/

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

/**************************************************************************************/

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


/**************************************************************************************/
function validarUsuario()
{
	var form = window.document.forms[0]
	if (form.usuario.value == "")
	{
		alert("Escriba un valor para el campo \"Usuario\".");
		form.usuario.focus();
		return (false);
	}
	if (form.contrasena.value == "")
	{
		alert("Escriba un valor para el campo \"Contraseña\".");
		form.contrasena.focus();
		return (false);
	}

return (true);
} 

/**************************************************************************************/

function validar()
{
	var theForm = window.document.forms[0]
	
	if (theForm.existeMail.value == "1")
	{
		alert("Ya existe una cuenta con la misma dirección de mail");
		theForm.elmail.focus();
		return (false);
	}
	
	if (theForm.nombre.value == "")
	{
		alert("Escriba un valor para el campo \"Nombre\".");
		theForm.nombre.focus();
		return (false);
	}
	if (theForm.elmail.value == "")
	{
		alert("Escriba un valor para el campo \"E-mail\".");
		theForm.elmail.focus();
		return (false);
	}
	if (theForm.code.value == "")
	{
		alert("Escriba los números de la imagen en el campo de abajo.");
		theForm.code.focus();
		return (false);
	}
return (true);
}


