var GEDropDown = function(el) {
	// this.containerEl = null;
	// this.titleEl = null;
	this.ulEl = null;
	// this.items = null;
	this.mouseOn = false;
	this.isOpen = true;
	this.initialize(el);
};

GEDropDown.prototype.initialize = function(el) {
	this.ulEl = el;
	// this.items = jQuery(this.ulEl).children();
	var containerEl = document.createElement('div');
	var titleEl = jQuery(this.ulEl).prev().get(0);
	
	var self = this;
	jQuery(this.ulEl)
		.removeClass('dropdown')
		.addClass('dropdown_list')
		.parent().append( containerEl );
	jQuery(containerEl)
		.addClass('dropdown')
		.append( jQuery(titleEl).addClass('dropdown_title') )
		.append( this.ulEl )
		.click( function() { self.toggleSelect(); } )
		.hover( function() { self.mouseOn = true; },
				function() { self.mouseOn = false; }
		);

   	jQuery(document).click( function() { if(!self.mouseOn && self.isOpen) self.close(); } );
	this.close();
};

GEDropDown.prototype.toggleSelect = function() { this.isOpen ? this.close() : this.open(); };

GEDropDown.prototype.close = function() { jQuery(this.ulEl).hide(); this.isOpen = false; };

GEDropDown.prototype.open = function() { jQuery(this.ulEl).show(); this.isOpen = true; };

jQuery(document).ready( function() { jQuery('.dropdown').each( function(i,el){ var list = new GEDropDown(el); } ); } );

SEngines = function() {Effect.BlindDown('home_panel_engines',{duration:.8});
this.document.getElementById('EdropdownClick').onclick=function(){return false;};
this.document.getElementById('EfoldupClick').onclick=function(){SEnginesFold();return false;}
};
SEnginesFold = function() {Effect.BlindUp('home_panel_engines',{duration:.8});
this.document.getElementById('EfoldupClick').onclick=function(){return false;};
this.document.getElementById('EdropdownClick').onclick=function(){SEngines();return false;};
};
rePaint = function() {this.document.getElementById('ge-secondary_nav').style.visibility='visible';}
