function mailcorrecto(mail) {
	var c1,c2,c3,c4,c5,c6,cf;
	var len,i,error;
		len = mail.length;
		if (len==0) {
			return 0;
		} else {
			i=0;
			c1 = mail.charAt(i);
			cf = mail.charAt(len-1);
			i++;
			if (c1=='@' || c1=='.' || c1==' ' || cf=='@' || cf=='.' || cf==' ') {
				error=0; 
			} else {	
				while (i<len && c2!='@' && c2!=' ') {
					c2 = mail.charAt(i);
					i++;
				}
				if (c2!='@') error=0; 
				else {
					c3 = mail.charAt(i);
					i++;
					if (c3=='@' || c3=='.' || c3==' ') {
						error=0; 
					} else {
						while (i<len && c4!='.' && c4!='@' && c4!=' ') {
							c4 = mail.charAt(i);
							i++;
						}	
						if (c4!='.') error=0; 
						else {
							c5 = mail.charAt(i);
							if (c5!='.' && c5!='@' && c5!=' ') {
								while (i<len && c6!='.' && c6!='@' && c6!=' ') {
									c6 = mail.charAt(i);
									i++;
								}	
								if (c6=='@' || c6==' ') {
									error=0; 
								} else {
									error=1; 
								}
							} else error=0; 
						}
					}
				}	
			}
			return error;
		}	
}
	

function comprueba()
{
	
  var f = document.solicitar;
  
    if (f.email.value=="")
  {
    alert("Has olvidado introducir el email");
    f.email.focus();
    return false
  }else{
	   
	if(!echeck(f.email.value)){
	  alert("El e-mail debe ser válido");
		f.email.focus();
		return false
	}


  }
  
  if (f.nombre.value=="")
  {
    alert("Has olvidado introducir el nombre");
    f.nombre.focus();
    return false
  }
  if (f.apellidos.value=="")
  {
    alert("Has olvidado introducir los apellidos");
    f.apellidos.focus();
    return false
  }
  if (f.empresa.value=="")
  {
    alert("Has olvidado introducir la empresa");
    f.empresa.focus();
    return false
  }

  
  
  	
    if (f.telefono.value=="")
  {
    alert("Has olvidado introducir el teléfono");
    f.telefono.focus();
    return false
  }
 
  if (f.interesado.value=="")
  {
    alert("Tienes que poner en que estas interesado en recibir información.");
    f.interesado.focus();
    return false
  }
 

	f.submit(); 
  return true;
}  

<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
//LA ENTRADA A CONTACTA ESTA EN MENU
/*function cambioMenu(param)
{
	parent.menuweb.location="menu.php?cambioMenu="+param;
	//parent.topp.location="top.php?cambioMenu="+param;
}*/

function toggle_him(id){
               
          $(".arrow").attr("src", "image/flecha_abajo.jpg");
          $("#arrow_"+id).attr("src", "image/cerrar.jpg");
          $(".respuesta").hide();
          $("#respuesta_"+ id).show();
          $(".menu_clientes_activo").removeClass('menu_clientes_activo');
		  $("#link_cliente_"+id).addClass('menu_clientes_activo');

}


function show_me(element_name) {
	$(".info_show_hide").hide()
	$('#'+element_name).fadeIn('slow')
	$(".texto_liselect").removeClass('texto_liselect');
	$("#link_"+element_name).addClass('texto_liselect');
}

/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		 
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		  
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		   
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		  
		    return false
		 }

 		 return true					
	}

function ValidateForm(){
	var emailID=document.frmSample.txtEmail
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }