// return the display name of the document item
 function display_name(item) 
 {
     var strDisplay = item.getAttribute("DisplayName");
     if (strDisplay==null || strDisplay=="")
         strDisplay = "Field";
     return strDisplay;
 }
 
 // function definition for use with the item change event
 function es_item_selected() 
 {
     var item = event.srcElement;
     event.returnValue = vs_item_selected(item);
 }
 
 // function definition to perform the item selected validation
 function vs_item_selected(item) 
 {
     // define the error message using the items display name
     var strErrorMsg = display_name(item) + " must be a valid selection";
     // ensure the first item is not selected
     if (item.selectedIndex<=0) //Accepte pas de negatif (defois, les listbox capotes)
     {
         item.focus();
         return false;
     }
     return true;
 }
 
// Vérifie si un champs est vide
function IsEmpty(item) 
{
	if( item.value == "" )
   		return true;
	return false;
}

// construct the validation object
function validation_construct() 
{
    this.eventItemSelected = es_item_selected;
    this.itemSelected = vs_item_selected;
    return this;
}
 
// define the exposed validation object
// and call the object constructor
var validation = new Object;
validation = validation_construct();
 
