function ejecutarValidacion()
{
    if (document.getElementById('nombre').value=="") {
      validatePrompt(document.getElementById('nombre'),"Es obligatorio introducir el campo Nombre");
      return(false);
    }
    
    if (document.getElementById('empresa').value=="") {
      validatePrompt(document.getElementById('empresa'),"Es obligatorio introducir el campo Empresa");
      return(false);
    }
    
	if (document.getElementById('telefono').value=="")
	{
    	validatePrompt(document.getElementById('telefono'),"Es obligatorio introducir el teléfono");
    	return false;
	}
	else
	{
	   if (!fieldIsNumber(document.getElementById('telefono')))
	   {	
    	validatePrompt(document.getElementById('telefono'),"Debes introducir números en el campo Teléfono.");
    	return false;
	   }
	}
    
    if (document.getElementById('direccion').value=="") {
      validatePrompt(document.getElementById('empresa'),"Es obligatorio introducir el campo Direccion");
      return(false);
    }           
    
    if (document.getElementById('poblacion').value=="") {
      validatePrompt(document.getElementById('empresa'),"Es obligatorio introducir el campo Poblacion");
      return(false);
    }        
    
     if (document.getElementById('provincia').value=="") {
      validatePrompt(document.getElementById('empresa'),"Es obligatorio introducir el campo Provincia");
      return(false);
    }               
    
	if (document.getElementById('cp').value=="")
	{
    	validatePrompt(document.getElementById('cp'),"Es obligatorio introducir el código postal");
    	return false;
	}
	else
	{
	   if (!fieldIsNumber(document.getElementById('cp')))
	   {	
    	validatePrompt(document.getElementById('cp'),"Debes introducir números en el campo código postal.");
    	return false;
	   }
	}       
    
    if (document.getElementById('email').value=="") {
      validatePrompt(document.getElementById('email'),"Es obligatorio introducir el campo Email");
      return(false);
    }                 
    
	return (true);
	
	
}

function validatePrompt(Ctrl,PromptStr)
{
  alert(PromptStr);
  Ctrl.focus();
  return;
}

function fieldIsNumber(camp)
{
 var i;
 for(i=0;i<camp.value.length;i++)
 {
   if ((camp.value.charAt(i)<"0") || (camp.value.charAt(i)>"9"))
   {
   return false;	    
	}
 }
 return true;
}
/******************************************************************************
******************************************************************************
******************************************************************************
******************************************************************************
******************************************************************************
******************************************************************************/


/******************************************************************************/
