function setupSearch(){
	var input = $(".site_search input[name='pt']");
	input.bind("focus",function(){
		var ds = $(this);
		if(ds.val() == "请输入产品关键字搜索") ds.val("");
	});

	input.bind("blur",function(){
		var ds = $(this);
		if(ds.val() == "") ds.val("请输入产品关键字搜索");
	});

	$(".site_search").bind("submit",function(){
		var txt = $(this).find("input[name='pt']");
		if(txt.val() == "请输入产品关键字搜索") txt.val("");
	});
}

function ProductMenuOper(pcid){
	var allSamp = $(".pro_menu_tr samp");
	var allLi = $(".pro_menu_tr li");
	allSamp.bind("click",function(){
		var ds = $(this);
		var css =ds.attr("class");
		allSamp.removeClass("ed");
		allLi.css("display","none");

		if(css == "ed") return;
		ds.toggleClass("ed");
		ds.parent().find("li").css("display","");
	});

	if(pcid == "") return;

	var a = $(".pro_menu_tr a[href$='pcid=" + pcid + "']");
	if(a.length == 0) return;

	var ul = a.parent().parent();
	var samp = ul.find("samp");
	var li = ul.find("li");
	samp.toggleClass("ed");
	li.css("display","");
}

function resetImgSize(ds,w,h){
	ds = $(ds);
	if(w == h){
		if(ds.width() > ds.height()){
			ds.width(w);
			ds.height("auto");
		}else{
			ds.height(w);
		}
	}else{
		var myW = ds.width();
		var myH = ds.height();
		if(ds.width() >= w){
			ds.width(w);
			ds.height("auto");
			if(ds.height() >= h){
				ds.height(h);
				ds.width("auto");
			}
		}
	}
}
