function FeedMenu( sLinkSelector, sClass ){
    
    var jqoFeedMenu = $('<span class="feed_menu"><select></select></span>');
    var jqoSelect = jqoFeedMenu.find('select');
    
    if( sClass ){
    	jqoFeedMenu.addClass( sClass );
    }
    
    //feed links
    var defaults = { links: sLinkSelector || 'link[type*=rss],link[type*=atom]' };
    
    /*
    *
    *	Function build	
    *	
    *	@description	
    *
    *	This function builds the feed menu by ripping RSS|Atom feed
    *	content and creating links for those.						
    *							
    */
    this.build = function( mFeedLinks ) {
    	var oAll    = [];

		$.each(mFeedLinks, function(i, item) {
    			var oOption = $('<option />')
    					.html( item.alias )
    					.click(
    						function() {
								window.open( '/rss/2.0/service/' + item.id );
    							jqoFeedMenu.removeClass('feed_menu_focused');
    						}
    					);
    			jqoSelect.append(oOption);
    		}
    	);

    	
		// System shit
    	jqoSelect
    		.blur( 	function(){ 
    					if( $.browser.msie || $.browser.safari || $.browser.opera ){
    						this.selectedIndex = -1;
    					}
    					jqoFeedMenu.removeClass('open'); 
    				} 
    		)
    		.focus( function(){
    					if( $.browser.msie || $.browser.safari || $.browser.opera ){
    						this.selectedIndex = -1;
    					}
    					jqoFeedMenu.addClass('open'); 
    				} 
    		)
    		.change(
    			function(){
    				if( $.browser.msie || $.browser.safari || $.browser.opera ){
 		   				var i = this.selectedIndex;
 		   				this.selectedIndex = -1;
 		   				if ( i > -1 ) {
 		   					var o = this.options[i];
 		   					this.selectedIndex = -1;
 		   					document.location.href = $(o).attr('value');
 		   				}
    				}
    			}
    		)
    		.get(0).selectedIndex=-1;
    }
    
    /*
    *
    *	Function feedMenu.write	
    *	
    *	@description	
    *
    *	This function takes a jQuery selector and appends the 
    *	feed menu in that DOM node. If no nodes are found, it
    *	is not written.  If no selector was specified, this
    *	function automatically places the feeds menu as the
    *	last child of the body.
    *	
    *	@param	mTarget	A mixed type variable: string or jQuery or null	
    *
    */
    this.write = function( mTarget, links) {
    	
		
		
    	//target for the menu is defaulted to the page body
    	mTarget = mTarget || 'body';
    	
    	//build the feed menu options
    	this.build(links);
    	
		$(mTarget).empty();
    	$(mTarget).append( jqoFeedMenu );
    	
    }

}
