var myrules = {

  '#formWithProject' : function(el){
    el.onsubmit = function(){
      var result = emailCheck(this.sCustomerEmail.value);
      if( result != "OK" ) {
	alert("Please supply a valid e-mail address");
	this.sCustomerEmail.focus();
	this.sCustomerEmail.select();
        return false;
      }
      /* Append the Alt-Shift-B data onto the sEvent field. */
      this.sEvent.value += this.sSaeInfo.value;
      alert(this.sEvent.value);
      return true;
    }
  },

  'a.e' : function(el){
    el.onclick = function() {
      addr_fake=this.firstChild;
      addr_real=addr_fake.nodeValue.replace(" [at] ", "@");
      // addr_fake.nodeValue=addr_real; 
      this.setAttribute("href", "mailto:" + addr_real + "?Subject=[SAE Contact]: "); 
    }
    return true;
  }

};


Behaviour.register(myrules);
