/*----------------------------------------------------------------------------------------*/
var Kickout = Class.create();
Kickout.prototype = {
	initialize: function(trigger, container, openCallback) {
		this.trigger = $(trigger);
		this.container = $(container);
		this.openCallback = openCallback;
		this.setup();
	},
	setup: function() {
		this.trigger.select('img')[0].observe('mouseenter', this.open.bindAsEventListener(this));
		this.trigger.observe('mouseleave', this.close.bindAsEventListener(this));
	},
	open: function(event) {
		this.trigger.addClassName('active');
		this.container.show();
		this.container.style.zIndex = 9999;
		if (this.openCallback) this.openCallback();
		event.stop();
	},
	close: function(event) {
		this.trigger.removeClassName('active');
		this.container.hide();
		event.stop();
	}
}

document.observe('dom:loaded', function(){
	
	if($('form_login'))
		$$("#form_login input.prompt").each(function(el) { new Prompt(el); })
	if($('staffSearch'))
		$$("#staffSearch input.prompt").each(function(el) { new Prompt(el); })
	$$('#staffing #grid li.staff').each(function(el) {
		new Kickout(el, el.down(".candidateInfo"));
	});

});
