function abreVentana(pagina, ancho, alto, nombre){ 
	var anchoPantalla = window.screen.width;
	var largoPantalla = window.screen.height;
	var anchoVentana = ancho;
	var largoVentana = alto;
	var pX = (anchoPantalla - anchoVentana) / 2;
	var pY = (largoPantalla - largoVentana) / 2;
	var ventanaCentrada=window.open(pagina,nombre,
"toolbar=0,location=0,directories=0,menubar=0,scrollbars=0,resizeable=0,width="+anchoVentana+",height="+largoVentana+",top="+pY+",left="+pX)
.focus();
}


function ChequearDireccionCorreoE(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("La dirección de correo electrónico no parece correcta.")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("La dirección de correo electrónico no parece correcta.")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("La dirección de correo electrónico no parece correcta.")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("La dirección de correo electrónico no parece correcta.")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("La dirección de correo electrónico no parece correcta.")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("La dirección de correo electrónico no parece correcta.")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("La dirección de correo electrónico no parece correcta.")
		    return false
		 }

 		 return true					
	}

function Enviar(){
/*	var email=document.frmSugerencias.email;
*/
	if ((document.frmSugerencias.email.value==null)||(document.frmSugerencias.email.value=="")){
		alert("El correo electrónico es obligatorio.")
		document.frmSugerencias.email.focus()
	} else if ((document.frmSugerencias.nombre.value==null)||(document.frmSugerencias.nombre.value=="")){
		alert("Por favor, introduzca un nombre.")
		document.frmSugerencias.nombre.focus()
	} else if ((document.frmSugerencias.telefono.value==null)||(document.frmSugerencias.telefono.value=="")){
		alert("Por favor, introduzca un teléfono.")
		document.frmSugerencias.telefono.focus()
	} else if ((document.frmSugerencias.comentarios.value==null)||(document.frmSugerencias.comentarios.value=="")){
		alert("Por favor, introduzca un comentario.")
		document.frmSugerencias.comentarios.focus()
	} else if (ChequearDireccionCorreoE(document.frmSugerencias.email.value)==false){
		document.frmSugerencias.email.value=""
		document.frmSugerencias.email.focus()
	} else {
		document.frmSugerencias.submit()
	}
 }