
	
	var myrules = {
		'#IFormOfIdentification' : function(element){
			element.onchange = function(){
				UpdateIdentificationValueText();
			}
		},
		'#identification_form' : function(element){
			element.onsubmit = function(){
				return ValidateIdentificationForm();
			}
		}
		
	};


Behaviour.register(myrules);



function ValidateIdentificationForm()
{
  document.getElementById("SIdentify").disabled = true;

  var submitForm = true;

  // Validate the surname field
  if ( document.getElementById("ISurname") != null )
  {
    if ( document.getElementById("ISurname").value.length <= 0 )
    {
      document.getElementById("TSurnameError").style.display = "";
      submitForm = false;
    }
    else
    {
      document.getElementById("TSurnameError").style.display = "none";
    }
  }

  // Validate the board point field
  if ( document.getElementById("IBoardPoint") != null )
  {
    if ( document.getElementById("IBoardPoint").value.length <= 0 )
    {
      document.getElementById("TBoardPointError").style.display = "";
      submitForm = false;
    }
    else
    {
      document.getElementById("TBoardPointError").style.display = "none";
    }
  }

  // Validate the identification field
  if ( document.getElementById("IIdentification") != null )
  {
    if ( document.getElementById("IIdentification").value.length <= 0 )
    {
      document.getElementById("TIdentificationError").style.display = "";
      submitForm = false;
    }
    else
    {
      document.getElementById("TIdentificationError").style.display = "none";
    }
  }

  if ( submitForm != true )
  {
    document.getElementById("SIdentify").disabled = false;
  }

  return submitForm;
}

/*
UpdateIdentificationValueText = function()
{
    if($("IFormOfIdentificationText") !=null)
    {
		if($("TIdentificationValue") !=null)
		{
		    if($("IFormOfIdentification") != null)
		    {
	            var i = $("IFormOfIdentification").selectedIndex;
    			
	            if( i!=-1)
	            {
	                if($("IFormOfIdentificationText").options[i])
				    {
					    var t = $("IFormOfIdentificationText").options[i].text;
    					
					    if(t!= null)
					    {
	                        $("TIdentificationValue").innerHTML =  t;
					    }
				    }
	            }
	        }
		}
    }
}

// At the initialisation of the identification page, we update the identification title text.
DOM.Ready.onDOMReady(UpdateIdentificationValueText);
*/