function CargarFoto(img, ancho, alto){ 
derecha=(screen.width-ancho)/2; 
arriba=(screen.height-alto)/2; 
string="toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width="+ancho+",height="+alto+",left="+derecha+",top="+arriba+"";
fin=window.open(img,"",string); 
} 
function setColour(element, colour) {
if (element.style) element.style.background = colour;
}
startList = function() {
if (document.all&&document.getElementById) {
  navRoot = document.getElementById("nav");
  for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
  node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
this.className=this.className.replace(" over", "");
  }
}
  }
}
}
window.onload=startList;
function Reset()
{
     document.formulario.nombre.value="";	
	document.formulario.telefono.value="";
     document.formulario.apellidos.value="";
     document.formulario.coment.value="";
	 return true;
}
function validadatos()
{

if ((document.formulario.nombre.value.length==0) ||  (document.formulario.email.value.length==0) || (document.formulario.coment.value.length==0))
{
	alert("Debe introducir todos los datos solicitados para poder continuar");
	return false;
}

// validamos la direccion de correo


else
{
	ok1=CompruebaCorreo(document.formulario.email.value);
	return ok1;
   }

   //el formulario se envia

}

function validadatos2()
{

if ((document.formulario.nombre.value.length==0) || (document.formulario.email.value.length==0) || (document.formulario.coment.value.length==0) || (document.formulario.telefono.value.length==0))
{
	alert("Debe introducir todos los datos solicitados para poder continuar");
	return false;
}

// validamos la direccion de correo


else
{
	ok1=CompruebaCorreo(document.formulario.email.value);
	return ok1;
   }

   //el formulario se envia

}

function CompruebaCorreo(vmail)
{
	var ok=2;
	var fin=vmail.length;
 	for (var i=0;i<fin;i++)
	{
 		var sByte=vmail.substring(i,i+1);
 		if (sByte=="@" || sByte==".")
		 {
 			ok=ok-1;
		  }
 	}
 
	 if (ok>0)
	{
		alert("Debe introducir la direccion de correo correctamente");
		return false;

	}
	else
		return true;

 }

