//-----( @Events )---------------------------------------------
// functions to add/remove event listeners
// this does not work in IE 5 Mac since it doesn't 
// support a advanced event registration model
var Events = {
	addEvent: function(obj, type, fn, useCapture) {
		if ( obj.attachEvent ) {
			obj['e'+type+fn] = fn;
			obj[type+fn] = function() {obj['e'+type+fn]( window.event ); }
			obj.attachEvent( 'on'+type, obj[type+fn] );
		} else {
			obj.addEventListener( type, fn, useCapture );
		}
	},
	removeEvent: function(obj, type, fn, useCapture) {
		if ( obj.detachEvent ) {
			obj.detachEvent( 'on'+type, obj[type+fn] );
			obj[type+fn] = null;
		} else {
			obj.removeEventListener( type, fn, useCapture );
		}
	},
	stopDefaultAction: function(ev) {
		// stop default action of an event
		if (!ev) { ev = window.event; }
		(ev.stopPropagation) ? ev.stopPropagation() : ev.cancelBubble = true;
		(ev.preventDefault) ? ev.preventDefault() : ev.returnValue = false;
		return false;
	} 
};
//-----( END )-------------------------------------------------


//-----( @Observe Events )-------------------------------------
Event.observe(window, 'load', function(){
  var StartTime, EndTime, TotalTime;
	Help.init();
	Msds.init();
	Tables.init();
	Textarea.init();
	avDescribe.init();
	//SmoothScroll.init();
	ProductSearch.init();
	StoreLocator.init();
	ShoppingCart.init();
	Refinements.init();
	ResultsSorter.init();
  //CMIListOperations.init();
});
//-----( END )-------------------------------------------------


//-----( @Behaviour Rules )------------------------------------
Behaviour.register({
  '#officerlist a' : function(el){
    el.onclick = function(){
      doHighlight(this.href);
    }
  }
});
Behaviour.register({
  '#directorlist a' : function(el){
    el.onclick = function(){
      doHighlight(this.href);
    }
  }
});
Behaviour.register({
  '#investorfaqlist a' : function(el){
    el.onclick = function(){
      doHighlight(this.href);
    }
  }
});
//-----( END )-------------------------------------------------