var fcFunctions = {
	contentbloc : function(o) {
		var list= o.list;
		var firstContent= o.firstContent;
		var firstAnchor= o.firstAnchor;

		/* display the first menu item contents when page loads, but only on a page where the menu exists (i.e. not on html pages used when javascript isn't available) */
		if ($(list).children().length)
		{
			$(list + " " + firstAnchor).addClass("hover");
			$(firstContent).show();
			lastRolled= firstContent;
		}

		$(list).find("a").bind("mouseenter focus",function(){
			if(lastRolled != this || lastRolled.className.indexOf("hover") == -1 ) {
				if (lastRolled) {
					$(lastRolled).removeClass("hover");

				}
				$(firstAnchor).removeClass("hover"); 	// turn the hover style off for the first anchor
				element = hideLastRolled(lastRolled, firstContent);
				$(element).addClass("off-screen");
				lastRolled = this;						// store the currently hovered anchor
				$(lastRolled).addClass("hover");		// add the hover class to the currently hovered anchor

				var selected = "#" + $(this).attr('id') + "_div";
				$(selected).removeClass("off-screen");
			}
		}).bind("click", function () {
			return false
		})

		function hideLastRolled(lR, fC) {
			if (lR == fC) {
				element= "#" + $(lR).attr('id');
			}

			else {
				element= "#" + $(lR).attr('id') + "_div";
			}
			return element;
		}
	},


	navRollover : function(o) {
		var container= o.container;
		var src;
		var newSrc;
		var insertionPoint;
		var removalPoint;
		var beginning;
		var end;

		$(container).find("img").hover(
			function () {
				src= $(this).attr('src');
				if(src.indexOf("-on") == -1) {
				insertionPoint= src.indexOf(".gif");
				beginning= src.substring(0,insertionPoint);
				end= src.substring(insertionPoint,src.length);
				newSrc= beginning + "-on" + end;
				$(this).attr('src',newSrc);
				}

			},
			function () {
				if($(this).parent().parent().hasClass("active") == false) {
					src= $(this).attr('src');
					removalPoint= src.indexOf("-on");
					beginning= src.substring(0,removalPoint);
					end= src.substring(removalPoint,src.length);
					newSrc= beginning + ".gif";
					$(this).attr('src',newSrc);
				}
			}
		)
	}
}

$(document).ready(function(){
		fcFunctions.contentbloc({
			list : ".products",				/* this is the list of links that are hovered */
			loadArea : ".information",		/* this is the div that will have its content changed */
			firstContent : "#tab-pet_div",
			firstAnchor : "#tab-pet"
		});
});
