(function($) {

	/**
	 * Add the "More" option in a select menu
	 * @author Alessandro Coscia
	 * @link www.programmatorephp.it/jquery
	 */
	$.fn.selectAddMore = function(options) {
		
		$(this).each( function () {
			
			// Add "More" field
			hiddenFieldId = (($(this).attr('name')) + '_selectAddMore_hiddenFieldId');
			$(this).after("<input type='text' value='' id='" + hiddenFieldId + "' name='" + hiddenFieldId + "' style='display:none;' />");
			
			// Add "More" button
			moreButtonId = (($(this).attr('name')) + '_selectAddMore_moreButtonId');
			$(this).after(" <input type='button' value='Other...' id='" + moreButtonId + "' rel='" + ($(this).attr('name')) + "' />");
			
			// Add more button's event
			$('#' + moreButtonId).click(function () {
				hiddenFieldId = (($(this).attr('rel')) + '_selectAddMore_hiddenFieldId');
				$('#' + hiddenFieldId).css('display', 'inline');
				$('#' + hiddenFieldId).focus();
			});
			
		} );
		
		return this;
			
	};

})(jQuery);