	$(function(){
		var $shopmenu = $("#shopmenu");
		$("#nav .shop").mouseenter(function(){ if(!$shopmenu.is(":visible")) $shopmenu.stop(true,true).fadeIn("fast") })
		.mouseleave(function() { $shopmenu.delay(500).fadeOut("fast")});
		$shopmenu.hover(function(){ $shopmenu.stop(true, true).show() },function() { $shopmenu.delay(500).fadeOut("fast")});
		
		var $searchButton = $("#searchButton");
		var $searchBox = $("#searchBox")
		
		/*$searchButton.click(function () {
			$searchButton.addClass("phone");
			$searchBox.slideDown(300);
			$("#searchInput").focus()
			
			$searchButton.html("GO");
			$searchButton.click(function () {
				var strSearch = $("#searchInput").val();
				window.open("http://www.americommerce.com/search.aspx?strSearch="+strSearch,"_parent");
			});
		}); */
		
		$searchButton.click(function () {
			var strSearch = escape($("#searchInput").val());
			window.open("http://www.americommerce.com/search.aspx?strSearch="+strSearch,"_parent");
		});
		
		$("#searchInput")
			.keyup( function(e) {
				if(e.keyCode == 13) {
					e.preventDefault();
					var strSearch = $(this).val();
					window.open("http://www.americommerce.com/search.aspx?strSearch="+strSearch,"_parent");
					return false;
				}
			})
			.focus( function(){
				if($(this).val()=="Search Here...")
					$(this).val("");
			})
			.blur( function() {
				if($(this).val()=="")
					$(this).val("Search Here...");
			});
		
		/*
		//makes the left calumn sidebar scroll with the page
		if($("#sidebar").length > 0){
			var bodyHeight = $("body").height()
			var sidebarHeight = $("#sidebar").height();
			var footerHeight = $("#footer").height();
			var headerHeight = $("#header").height();
			var topBoxHeight = $(".top-box").height();
			var scrollStart = headerHeight + topBoxHeight;
			var maxScroll = bodyHeight - sidebarHeight - footerHeight;
			
			setTimeout("setSideBarTop()", 500)
		
			$(window).scroll(function(){
				scrollTop = $(window).scrollTop()
			
				if (scrollTop < maxScroll && scrollTop > scrollStart)
					$("#sidebar").stop().animate({marginTop: scrollTop + sidebarTop - 90});
				else if (scrollTop < scrollStart)
					$("#sidebar").stop().animate({marginTop: sidebarTop})

			})
		}
		*/
		
		//sidebar hover effect
		$(".sidebar-nav li").mouseover(function(){
				$(this).removeClass("nohover").addClass("hover");
			})
			.mouseleave(function(){
				$(this).removeClass("hover")
				if ( !($(this).hasClass("active")) )
					$(this).addClass("nohover");
			})
		
	});
	var sideBarTop
	function setSideBarTop (){
		if ($("#sidebar").length>0)
			sidebarTop = parseInt($("#sidebar").css("margin-top").replace("px",""));
	}
	
	function tabOver(e)
	{
		if (e.className!='CommonSimpleTabStripSelectedTab')
			e.className='CommonSimpleTabStripTabHover';
	}
	function tabOut(e)
	{
		if (e.className!='CommonSimpleTabStripSelectedTab')
			e.className='CommonSimpleTabStripTab';
	}
