//--------------------------------------------------------------------------
//  File: evt.js
//
//  Description: intializes js event  handling
//
//  Version/Changes:
//      06/03/2007 - Mike Bryant: Created
//
//  Copyright: None
//--------------------------------------------------------------------------



/*  This doesn't appear to be used anywhere... so for now removing it b/c it doesn't work with mootools 1.2
	I couldn't get this to work in changing to 1.2 -- Dan */
window.addEvent('load', function(){
  var divs = $$(['docs', 'js', 'html', 'css']);
  divs.each(function(div){
    var link = $(div.id + 'code');
    div.setStyle('display', 'none');
    link.addEvent('click', function(e){
      e = new Event(e);
      divs.each(function(other){
        if (other != div) other.setStyle('display', 'none');
      });
      div.setStyle('display', (div.getStyle('display') == 'block') ? 'none' : 'block');
      e.stop();
    });
  });
});


window.addEvent('load', function(){
  var tooltips = new Tips($$('.tooltips'), {
    initialize:function(){
      this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 500, wait: false}).set(0);
      //this.fx = new Fx.Tween(this.toolTip, {duration: 500, wait: false}).set(0); //1.2
    },
    
    //new Fx.Style(element, property [, options]).start([from,] to); -- supposed to be for 1.1
    //new Fx.Tween(element [, options]).start([property], from[, to]); -- supposed to be for 1.2
    
    onShow: function(toolTip) {
      this.fx.start(1);
      //this.fx.start('opacity', 0, 1); //1.2
    },
    onHide: function(toolTip) {
      this.fx.start(0);
      //this.fx.start('opacity', 0, 1); //1.2
    }
  });
});

