$(document).ready(function(){
	// add dynamic content
	$("div#productSearch").prepend('<a href="#" class="close" title="Close">Close<\/a>');
	
	// ie6 specific code, mostly for styling issues
	if ($.browser.msie && $.browser.version <=7.0) {
		$("li:first-child").addClass("firstChild");
		$("li:last-child").addClass("lastChild");
	}
	
	// slide the search down
	$("li.search > a").click(function() {
	    return showSearchPanel();
	});
	
	//close the search
	$("#productSearch a.close").click(function(){
		$(this).parent().parent().removeClass("active");
		$(this).parent().css("display","none");
		return false;
	});
	
	// this is where code to change the pattern image
	// in the pattern type dropdown in the product search
	$("#pattern").change(function(){
		var val = $(this).val();
	});	
});

function showSearchPanel() {
    var obj = $("li.search > a");
    $(obj).parent().toggleClass("active");
   	$(obj).next().slideToggle();
   	return false;
}
