function DropDownAutoLeft(options)
{
	
	//Optional options object 	
	this.Options = {
		'menuWrapper' : 'menuWrapper',
		'dropDownHolder' : 'dropDownHolder'
	};
	
	//assign Options with custom or default values 
	if ( options != null ) {
		for( var index in this.Options ) {
			this.Options[index] = (typeof options[index] != "undefined") ? options[index] : this.Options[index];
		}
	}
	
	//constant for global 'this'
	var uberThis = this;
	
	//main menuHolder
	var menuHolder = $(this.Options.menuWrapper).childElements();
	
	//main dropDownHolder
	var dropDownHolder = $(this.Options.dropDownHolder);
	
	//timeout for outer dropDown
	var ddTimeout;
	
	//init app
	this.init = function(){
		
		//add mouse events
		menuHolder.each(function(n,i){
			var currDropDown = menuHolder[i].id+'_dd';
			
			menuHolder[i].observe("mouseover", function(){
				uberThis.showMenu(menuHolder[i].id);
			});
			menuHolder[i].observe("mouseout", function(){
				uberThis.triggerHideMenu();
			});
			$(currDropDown).observe("mouseover",function(){
				uberThis.clearMenuTimeout();
			});
			$(currDropDown).observe("mouseout",function(){
				uberThis.triggerHideMenu();
			});			
		});
	};
	
	//show the dropDownHolder and current dropDown
	//hide remaining dropDowns
	this.showMenu = function(currMenu)
	{
		menuHolder.each(function(n,i){
			
			//clear the timeout to hide the menu
			uberThis.clearMenuTimeout();
			
			//get the targeted dropdown
			var currDropDown = menuHolder[i].id + '_dd';
			
			//show the outer dropDownHolder
			dropDownHolder.show();			
			
			//show and position the targeted dropdown
			if(menuHolder[i].id == currMenu)
			{
				menuHolder[i].makePositioned();
				var currLeft = menuHolder[i].positionedOffset().left;
				$(currDropDown).show();		
				$(currDropDown).style.left = currLeft + 'px';	
			}
			//hide the remaining dropdown
			else
			{
				$(currDropDown).hide();
			}
		});
	}
	
	//set the timeout to hide the outer dropDownHolder
	this.triggerHideMenu = function()
	{
		ddTimeout = setTimeout(function()
		{	
			dropDownHolder.hide();
		},500);
	}
	
	//clear the timeout if another dropdown is triggered
	this.clearMenuTimeout = function(){
		clearTimeout(ddTimeout);
	}

}



