// JavaScript Document

/*	==========================================================

	Class: 		Callout
	Use:		Performs operations on the callouts boxes
	Version:	v1
	By:			Dave Calvert

========================================================	*/

var Callout = Class.create();
Callout.prototype = {
    
    initialize: function () {
		$$('.callout a').each(
			this.setupcallouts.bind(this)
		);
    },
	
	setupcallouts: function (k,v){
		
		Effect.Fade($(k).up('li'), { duration: 0.5, from:1, to:0.8 } );
		Event.observe($(k),'mouseover',this.on.bindAsEventListener(this));
		Event.observe($(k),'mouseout',this.off.bindAsEventListener(this));
		
	},
	
	on: function (el) {	
		elt = Event.element(el);
		if(elt) {
			elm = $(elt).up('li');
			Effect.Fade(elm.id, { duration: 0.5, from:0.8, to:1, queue: { scope: elm.id.toString(), position:'end' } });
		}
	},
	
	off: function (el) {
		elt = Event.element(el);
		if(elt) {
			elm = $(elt).up('li');
			Effect.Fade(elm.id, { duration: 0.5, from:1, to:0.8, queue: { scope: elm.id.toString(), position:'end' } });
		}
		
	}
	
};
