   
   /********************************************************************************************** 
	*	function ognInitDropList(dieDropList,derValue)
	*		
	*		La función inicializa la lista desplegable pasada como primer parámetro dejando
	*		seleccionada la opción cuyo valor coincide con el segundo parámetro.
	*		En caso de no hallarse coincidencia la función no hace nada con lo que la lista
	*		aparecerá inicializada el la primera de sus opciones (o aquella seleccionada por
	* 		defecto mediante el atributo selected).
	*
	*	---------------------------------------------------------------------------
	*		
	*		$dieDropList	-> Objeto HTMLSelectElement a inicializar
	*		$derValue		-> Valor de la opción a la que deseamos inicializar la lista
	*
	***********************************************************************************************/
	
	   function ognInitDropList(dieDropList,derValue){
				
			for (i=1;i<dieDropList.length;i++){
				if (dieDropList.options[i].value==derValue){
					dieDropList.selectedIndex = i;
					return;
				}
			}
			
		}
		
   /**********************************************************************************************/
   
   
   /********************************************************************************************** 
	*	function ognIsCheckBoxEmpty(derCheckBox)
	*		
	*		La función comprueba que al menos una de las opciones de una lista de checkboxes esté
	* 		seleccionada
	*
	*	---------------------------------------------------------------------------
	*		
	*		$dieDropList	-> Objeto NodeList que contiene las diferentes opcioneslista
	*
	***********************************************************************************************/
	
	   function ognIsCheckBoxEmpty(derCheckBox){
			
			for (i=0;i<derCheckBox.length;i++){
				if (derCheckBox.item(i).checked)
					return(true);
			}
			
			return(false);			
			
		}
		
   /**********************************************************************************************/
   
   
   /********************************************************************************************** 
	*	function ognValidateEmail (derEmail)
	*		
	*		Valida que la sintaxis de una cadena dada coincida con la de una dirección válida de 
	*		e-mail.
	*
	*	---------------------------------------------------------------------------
	*		
	*		$derEmail	-> Cadena con la direccion de correo que queremos validar 
	*
	***********************************************************************************************/
	
		function ognValidateEmail(derEmail) {
		    
		    str = derEmail.toLowerCase( );
		    
		    if (str.indexOf("@") > 1) {
		        var addr = str.substring(0, str.indexOf("@"));
		        var domain = str.substring(str.indexOf("@") + 1, str.length);
		        // at least one top level domain required
		        if (domain.indexOf(".") == -1) {
		            //alert("Verify the domain portion of the email address.");
		            return false;
		        }
		        // parse address portion first, character by character
		        for (var i = 0; i < addr.length; i++) {
		            oneChar = addr.charAt(i).charCodeAt(0);
		            // dot or hyphen not allowed in first position; dot in last
		            if ((i == 0 && (oneChar == 45 || oneChar == 46))  || 
		                (i == addr.length - 1 && oneChar == 46)) {
		                //alert("Verify the user name portion of the email address.");
		                return false;
		            }
		            // acceptable characters (- . _ 0-9 a-z)
		            if (oneChar == 45 || oneChar == 46 || oneChar == 95 || 
		                (oneChar > 47 && oneChar < 58) || (oneChar > 96 && oneChar < 123)) {
		                continue;
		            } else {
		                //alert("Verify the user name portion of the email address.");
		                return false;
		            }
		        }
		        for (i = 0; i < domain.length; i++) {
		            oneChar = domain.charAt(i).charCodeAt(0);
		            if ((i == 0 && (oneChar == 45 || oneChar == 46)) || 
		                ((i == domain.length - 1  || i == domain.length - 2) && oneChar == 46)) {
		                //alert("Verify the domain portion of the email address.");
		                return false;
		            }
		            if (oneChar == 45 || oneChar == 46 || oneChar == 95 || 
		                (oneChar > 47 && oneChar < 58) || (oneChar > 96 && oneChar < 123)) {
		                continue;
		            } else {
		                //alert("Verify the domain portion of the email address.");
		                return false;
		            }
		        }
		        return true;
		    }
		    //alert("The email address may not be formatted correctly. Please verify.");
		    return false;
		}	
	
   /**********************************************************************************************/
   
   
   /********************************************************************************************** 
	*	function ognIsDate(dieDate)
	*		
	*		Validación de una fecha introducida por el usuario.
	*		Valida que la fecha esté introducida en formato dd/mm/yyyy.
	*		La primere linea supone la aceptación de valores nulos para el campo fecha.
	*
	*	---------------------------------------------------------------------------
	*		
	*		$dieDate	-> Cadena introducida por el usuario con la fecha que deseamos validar
	*
	***********************************************************************************************/
	
		function ognIsDate(dieDate) {
			if (dieDate=='') return(true); //Permitimos valor nulo para el campo de fecha
			var DatosFecha = dieDate.split('/');
			var Fecha = new Date();
			Fecha.setFullYear(DatosFecha[2],DatosFecha[1]-1,DatosFecha[0]);		
			return ((Fecha.getMonth()==DatosFecha[1]-1)&&(DatosFecha[2].length==4));
		}
	
   /**********************************************************************************************/
   
  
   /********************************************************************************************** 
	*	function ognIsDatePreterita(dieDate)
	*		
	*		Valida que la fecha pasada como parámetro sea igual al día de hoy o posterior
	*		La función devuelve true en caso de que la fecha sea anterior al día de hoy
	*
	*	---------------------------------------------------------------------------
	*		
	*		$dieDate	-> Objeto Date con la fecha que deseamos validar
	*
	***********************************************************************************************/
	
		function ognIsDatePreterita(dieDate) {
			
			var today	= new Date();
			today.setHours(0);
			today.setMinutes(0);
			today.setSeconds(0);
			today.setMilliseconds(0);
			
			if (dieDate<today)
				return(true);
			else
				return(false);
		}
	
   /**********************************************************************************************/
   