/*
 *  @(#)$Id: contact_behaviour.js,v 1.2 2006-09-22 21:42:32 griswold Exp $
 *
 *  Copyright (c) 2006 Llamawerx Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of
 *  Llamawerx ("Confidential Information").  You shall not disclose such
 *  Confidential Information and shall use it only in accordance with
 *  the terms of the license agreement you entered into with Llamawerx.
 */

function toForm() {
   setFocus('first_name');
   highlight(document.getElementById('first_name'), 1);
}

var myrules = {
      'body' : function(element) {
         toForm();
      },
      'input' : function(element){
         element.onfocus = function() {
            highlight(element, 1);
         },
         element.onblur = function() {
            highlight(element, 0);
         }
      },
      'textarea' : function(element){
         element.onfocus = function() {
            highlight(element, 1);
         },
         element.onblur = function() {
            highlight(element, 0);
         }
      },
      '.noborder' : function(element){
         element.onfocus = function() {
            return;
         },
         element.onblur = function() {
            return;
         }
      },
      '.validate_num' : function(element){
         element.onkeypress = function(event) {
            return validNumKey(event);
         }
      },
      '#reset_btn' : function(element){
         element.onclick = function() {
            toForm();
         }
      }
	};
	
Behaviour.register(myrules);
