/**
 * Technosophos RSS Widget
 * Copyright (c) 2007 Technosophos/Aleph-Null, Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.  
 *
 * ============
 * Typical Use:
 * Technosophos.rssWidget("http://myfeed/rss.xml", "#my-target-div");
 *
 * NOTE: Due to the browser security model, the RSS URL must reside on the
 * same server as HTML page into which this widget is placed.
 *
 * This script requires jQuery 1.2 or greater. http://jquery.com
 *
 * @author Matt Butcher <mbutcher@aleph-null.tv>
 */
 
var Technosophos = Technosophos || {widgets:{},settings:{}};

jQuery.extend( Technosophos, {
	fishWidget: function(target) {
		Technosophos.widgets.fish.settings.fishTarget = fishTarget = jQuery(target);
		fishTarget.children('li').each(Technosophos.widgets.fish.addMouseover);	
	}
});

jQuery.extend( Technosophos.widgets, {
	fish: {
		settings: {},
		init: {},
		addMouseover: function(i, ele) {
			jQuery(ele).children('a').mouseover(Technosophos.widgets.fish.doMouseover)
				.mouseout(Technosophos.widgets.fish.doMouseout);
		},
		doMouseover: function(event) {
			/*
			fishTarget = Technosophos.widgets.fish.settings.fishTarget;
			fishTarget.children('li').each(function(i,ele) {
				jQuery(ele).css('font-size','12pt')
			});
			*/
			// this == dom
			//alert(jQuery(this).text('FOO'));
			targ = jQuery(this).parent();
			targ.css('font-size','18pt');
			targ.prev().css('font-size','14pt');
			targ.next().css('font-size','14pt');
		},
		doMouseout: function(event) {
			//alert('Fire mouseout');
			jQuery(this).parent().parent().children('li').each(
				Technosophos.widgets.fish.clearFormatting
			);
		},
		clearFormatting: function(i,e){
			jQuery(e).css('font-size','12pt')
		},
	}
});