//<![CDATA[

	/// <reference path="jquery-1.3.2-vsdoc.js" />
	///inetpub/wwwroot/jquery/
	// Closure
	jQuery(document).ready(function($)
	{
		$('<li id="custom-search"><form method="get" class="SearchForm" id="sForm" action="http://lunamedia.co.uk/client/ben/"><div><input type="text" class="SearchInput" value="" name="s" id="sInput" /><input type="hidden" id="searchSubmit" /></div></form></li>').insertAfter('li#menu-item-43');
	
	
		$.fn.slideMenu = function(options)
		{
			var opts = $.extend({}, $.fn.slideMenu.defaults, options);
			
			return this.each(function()
			{
				var $this = $(this);
				var o = $.meta ? $.extend({}, opts, $this.data()) : opts;
				var timer = 0;
				
				

				$this.children(":not(li.current-menu-item, li#menu-item-43)").each(function()
				{
					var $this = $(this);
					var $child = $this.children("a");

					timer = (timer * o.multiplier + o.time);
					$child.animate({ paddingTop: o.padUp }, timer).animate({ paddingTop: o.padDown }, o.time);

					$this.hover(function()
					{
						$child.addClass("Hover").stop().animate({ paddingTop: o.padUp }, o.time);
					},
					function()
					{
						$child.stop().animate({ paddingTop: o.padDown }, o.time, function() { $(this).removeClass("Hover"); });
					});
				}).siblings("li#rss").each(function()
				{
					var $this = $(this);
					var $child = $this.children("a");

					timer = (timer * o.multiplier + o.time);
					
					// For some reason this fails with Fx 2 when loading.  The (identical) hover works fine.
					try
					{
						$child.animate({ backgroundPosition: "(" + o.backgroundOff + "px " + o.backgroundUp + "px)" }, timer).animate({ backgroundPosition: "(" + o.backgroundOff + "px " + o.backgroundDown + "px)" }, o.time);
					}
					catch (e) { }

					$this.hover(function()
					{
						$child.css({ backgroundPosition: o.backgroundOn + "px " + o.backgroundDown + "px" }).stop().animate({ backgroundPosition: "(" + o.backgroundOn + "px " + o.backgroundUp + "px)" }, o.time);
					},
					function()
					{
						$child.stop().animate({ backgroundPosition: "(" + o.backgroundOn + "px " + o.backgroundDown + "px)" }, o.time, function() { $(this).css({ backgroundPosition: o.backgroundOff + "px " + o.backgroundDown + "px" }); });
					});
				});
			});
		};
	

		$.fn.slideMenu.defaults = 
		{
			padUp: 7,
			padDown: 15,
			backgroundOff: 9,
			backgroundOn: -29,
			backgroundDown: 13,
			backgroundUp: 4,
			time: 150,
			multiplier: 0.83
		};
		
		$(".Menu").slideMenu();
		
		//Inconsistent subpixel alignment (kinda) fix
			if (!$.browser.mozilla)
		{ 
			$(".Header").css("margin-left", "-2px").children(".Menu").css({ backgroundPosition: "2px 0", width: "772px" });
		}
		
		
		// Other Stuff
		
			$(".SearchForm .SearchInput").each(function()
			{
				var searchTxt = $(this).val();
				
				if (searchTxt == "")
				{
					$(this).val("Search").addClass("Blank");
				}
				else if (searchTxt == "Search")
				{
					$(this).addClass("Blank");
				}
			}),
		
			$(".SearchForm .SearchInput").focus(function()
			{
				if (this.value == "Search")
				{
					this.value = "";
				}
				else
				{
					selectAll(this);
				}
				
				$(this).removeClass("Blank");
			}),
			
			$(".SearchForm .SearchInput").blur(function()
			{
				if (this.value == "" || this.value == "Search")
				{
					this.value = "Search";
					$(this).addClass("Blank");
				}
			})
		
		
		
		
	});(jQuery);
//]]>
