function crearVentana(numero)
{
   var opciones="top=20,width=520,height=410,left=250"; 

   mi_ventana = window.open("ficha.asp?cod="+numero,"fichas",opciones); 
}

function validar2(formulario)
{
	reg_mail = /^[\.A-Za-z0-9_-]+\@[\.A-Za-z0-9_-]+\.[\.A-Za-z0-9_-]+$/;
	var flag=true;
	with(formulario)
	{
		if(NIF.value == "" )
		{
			flag=false;
			alert("Debe rellenar la casilla nif/cif");
		}
		if(NOMBRE.value == "" )
		{
			flag=false;
			alert("Debe rellenar la casilla nombre");
		}
		if(DIRECCION.value == "" )
		{
			flag=false;
			alert("Debe rellenar la casilla direccion");
		}
		if(CODPOSTAL.value == "" )
		{
			flag=false;
			alert("Debe rellenar la casilla Cod.Postal");
		}
		if(LOCALIDAD.value == "" )
		{
			flag=false;
			alert("Debe rellenar la casilla localidad");
		}
		if(PROVINCIA.value == "" )
		{
			flag=false;
			alert("Debe rellenar la casilla provincia");
		}
		if(EMAIL.value == "" )
		{
			flag=false;
			alert("Debe rellenar la casilla email");
		}
		if(PWD.value == "" )
		{
			flag=false;
			alert("Debe rellenar la casilla password");
		}
		if (!(reg_mail.test(EMAIL.value)))
		{
			alert("El formato del email es incorrecto");
			flag=false;
		}
		
	}
	return flag;
}

function validar1(formulario)
{
alert ("ESTO NO FUNCIONA")
	reg_mail = /^[\.A-Za-z0-9_-]+\@[\.A-Za-z0-9_-]+\.[\.A-Za-z0-9_-]+$/;
	var flag=true;
	with(formulario)
	{
		if(NIF.value == "" )
		{
			flag=false;
			alert("Debe rellenar la casilla nif/cif");
		}
		if(NOMBRE.value == "" )
		{
			flag=false;
			alert("Debe rellenar la casilla nombre");
		}
		if(DIRECCION.value == "" )
		{
			flag=false;
			alert("Debe rellenar la casilla direccion");
		}
		if(CODPOSTAL.value == "" )
		{
			flag=false;
			alert("Debe rellenar la casilla del código postal");
		}
		if(LOCALIDAD.value == "" )
		{
			flag=false;
			alert("Debe rellenar la casilla localidad");
		}
		if(PROVINCIA.value == "" )
		{
			flag=false;
			alert("Debe rellenar la casilla provincia");
		}
		if(EMAIL.value == "" )
		{
			flag=false;
			alert("Debe rellenar la casilla email");
		}
		if (!(reg_mail.test(EMAIL.value)))
		{
			alert("El formato del email es incorrecto");
			flag=false;
		}
		if(PWD.value == "" )
		{
			flag=false;
			alert("Debe escribir una contraseña");
		}

		
	}
	return false;
}

function validarEmail(formulario)
{
	reg_mail = /^[\.A-Za-z0-9_-]+\@[\.A-Za-z0-9_-]+\.[\.A-Za-z0-9_-]+$/;
	var flag=true;
	with(formulario)
	{
		if(Email.value == "" )
		{
			flag=false;
			alert("Debe rellenar la casilla email");
		}
		else
		{
			if (!(reg_mail.test(Email.value)))
			{
				alert("El formato del email es incorrecto");
				flag=false;
			}
		}
	}
	return flag;
}



<!-- Copyright 2006,2007 Bontrager Connection, LLC
// http://bontragerconnection.com/ and http://www.willmaster.com/
// Version: July 28, 2007

var cX = 0; var cY = 0; var rX = 0; var rY = 0;
function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }
function AssignPosition(d) {
if(self.pageYOffset) {
	rX = self.pageXOffset;
	rY = self.pageYOffset;
	}
else if(document.documentElement && document.documentElement.scrollTop) {
	rX = document.documentElement.scrollLeft;
	rY = document.documentElement.scrollTop;
	}
else if(document.body) {
	rX = document.body.scrollLeft;
	rY = document.body.scrollTop;
	}
if(document.all) {
	cX += rX; 
	cY += rY;
	}
d.style.left = (cX+10) + "px";
d.style.top = (cY+10) + "px";
}
function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
dd.style.display = "block";
}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
if(dd.style.display == "none") { dd.style.display = "block"; }
else { dd.style.display = "none"; }
}
//-->



