{
		var objToShrink;
		var objToFade;
		
		var heightNew = 0;
		
		var heightFinal = 28;
		var heightDiff = 0;
		
		var animateTime = 500; //ms
		var PPMS = 0; //Pixels per milli-second
		var PPMSmult= 1;
		
		var alphaCounter = 100;
		var objToMove;
		
		var fading = 0;
		var moving = 0;
		
		var FeedOrder = "1,2,3";	// This will eventually be handled by cookies and profiles.
		var FeedOrderArray = new Array();
		
		var globalFeedID = 0;
		var globalFeedNextId = 0;
	}
	function ToggleFeed(id)
	{
		 if($("#feedtoggle" + id ).html() == "-")
		{
			if(fading == 0)
			{
				fading=1;
				globalFeedID = id;
				$("#feedcontent" + id).fadeTo("normal",0)
				HideFeed($("#feed" + id));
				pageTracker._trackEvent('Feed', 'Close', 'Feed'+id);
			}
		}
		else
		{
			if(fading == 0)
				{
					fading=1;
					$("#feedtoggle" + id ).innerHTML = "-";
					$("#feedcontent" + id).fadeTo("normal",1)
					ShowFeed($("#feed" + id));
					pageTracker._trackEvent('Feed', 'Open', 'Feed'+id);
				}
		}
		
	}
	
	function HideFeed(id)
	{
		objToShrink = id;
		heightNew = objToShrink.height(); 
		if(heightDiff == 0){
			heightDiff = heightNew - heightFinal;
		}
		
		if(heightNew > heightFinal)
		{
			heightNew = objToShrink.height() * 0.80;
			objToShrink.css("height",heightNew + "px")
			if(heightNew > heightFinal)
			{
				setTimeout("HideFeed(objToShrink)",PPMSmult);
			}
			else
			{
				objToShrink.css("height",heightFinal)
				$("#feedtoggle" + globalFeedID).html("+");
				fading=0;
			}
		}
		else
		{
			objToShrink.css("height",heightFinal)
			$("#feedtoggle" + globalFeedID).html("+");
			fading=0;	
		}
	}

	function ShowFeed(id)
	{
	
		objToShrink = id;
		heightNew = objToShrink.height();
		objToShrink.css("height","");
		calculatedHeight =  objToShrink.height();
		
		objToShrink.css("height",heightNew + "px");

		heightNew = objToShrink.height(); 
		if(heightDiff == 0){
			heightDiff = heightNew - heightFinal;
			PPMS = (heightDiff / animateTime);
		}
		
		if(heightNew < calculatedHeight)
		{
			heightNew = objToShrink.height() * 1.60;
			objToShrink.css("height",heightNew + "px")
			if(heightNew < calculatedHeight)
			{
				setTimeout("ShowFeed(objToShrink)");
			}
			else
			{
				objToShrink.css("height",calculatedHeight)
				$("#feedtoggle" + globalFeedID).html("-");
				fading=0;
			}
		}
		else
		{
			objToShrink.css("height",calculatedHeight)
			$("#feedtoggle" + globalFeedID).html("-");
			fading=0;
		}
	}
	
	// jQuery.fn.swap = function(b) {
		// b = jQuery(b)[0];
		// var a = this[0];
		// var t = a.parentNode.insertBefore(document.createTextNode(''), a);
		// b.parentNode.insertBefore(a, b);
		// t.parentNode.insertBefore(b, t);
		// t.parentNode.removeChild(t);
		// return this;
	// };
	
	jQuery.fn.swap = function(b) {
	    b = jQuery(b)[0];
	    var a = this[0],
	        a2 = a.cloneNode(true),
	        b2 = b.cloneNode(true),
	        stack = this;

	    a.parentNode.replaceChild(b2, a);
	    b.parentNode.replaceChild(a2, b);

	    stack[0] = a2;
	    return this.pushStack( stack );
	};

	
	function MoveFeed(id,direction){
		if(moving == 0)
		{
			moving = 1;
			FeedOrderArray = FeedOrder.split(",");
			globalFeedID = id.toString();
			var ThisIdIndex = FeedOrderArray.indexOf(globalFeedID)
			var NextIdIndex;
			if(direction=="d")
			{
				NextIdIndex = ThisIdIndex + 1;
				globalFeedNextID = FeedOrderArray[NextIdIndex];
				if(typeof(globalFeedNextID)!="undefined")
				{
					FeedOrderArray[ThisIdIndex] = globalFeedNextID;
					FeedOrderArray[NextIdIndex] = globalFeedID;
					FeedOrder = FeedOrderArray.join(",");
					if(fading == 0)
						{
							fading = 1;
							$("#feed" + globalFeedID).fadeOut("fast", function(){$("#feed" + globalFeedNextID).swap("#feed" + globalFeedID);});
							$("#feed" + globalFeedID).fadeIn("normal", function(){fading=0;moving = 0;});
							pageTracker._trackEvent('Feed', 'MoveDown', 'Feed'+id);
						}
				}
				else
				{
					moving=0;
				}
			}
			else if(direction=="u")
			{
				NextIdIndex = ThisIdIndex - 1;
				globalFeedNextID = FeedOrderArray[NextIdIndex];
				if(typeof(globalFeedNextID)!="undefined")
				{
					FeedOrderArray[ThisIdIndex] = globalFeedNextID;
					FeedOrderArray[NextIdIndex] = globalFeedID;
					FeedOrder = FeedOrderArray.join(",");
					if(fading == 0)
						{
							fading = 1;
							$("#feed" + globalFeedID).fadeOut("fast", function(){$("#feed" + globalFeedNextID).swap("#feed" + globalFeedID);});
							$("#feed" + globalFeedID).fadeIn("normal", function(){fading=0;moving = 0;});
							pageTracker._trackEvent('Feed', 'MoveUp', 'Feed'+id);
						}
				}
				else
				{
					moving=0;
				}
			}
		}
		else
		{
			alert("Wait until the feeds are done moving before moving them again.  Thanks.");
			moving=0;
		}
	}

