// JavaScript Document
$(function(){
	$("#range").val($("#search_range dt").attr("class"));	   
	
	$("#search-form").submit(function(){
		if($("#keyword").val() == "" || $("#keyword").val() == 	"产品或新闻搜索"){
			return false;	
		}else{
			return true;
		}
	});
	$("#keyword").focus(function(){
		$(this).addClass("search-box-on");
		if($(this).val() == "产品或新闻搜索"){
			$(this).val(""); 	
		}		
		else{
			$(this).select();
		}
	});
	$("#keyword").blur(function(){
		if ($(this).val() == ""){
			$(this).val("产品或新闻搜索"); 
			$(this).removeClass("search-box-on");
		}			 
	});
	
	$("#search_range").hover(
		function(){									  
			$(this).addClass("show");						  
		},
		function(){
			$(this).removeClass("show");
		}		
	);
	
	$("#search_range dd a").click(function(){			
			$("#search_range dt").attr("class",$(this).parent().attr("class"));
			$("#search_range").removeClass("show");
			$("#range").val($(this).parent().attr("class"));
		});
});