	
//	$(function(){
//		$("#show_photo").unbind("mouseover").bind("mouseover",function(){
//			$(this).css("cursor","hand");
//		    })
//		
//		$("#show_showcase").unbind("mouseover").bind("mouseover",function(){
//			$(this).css("cursor","hand");
//		    })
//	});

	function clear_text(search_text){
		//if($(search_text).val() == "输入关键字" || $(search_text).val() == "輸入關鍵字" || $(search_text).val() == "Inputs keywords" ){
		if($(search_text).val() == input_keywrods){
			document.getElementById('search').value = "";
		}
	}
	
	function lose_focus(){
		if($("#search").val()== ""){
			if(selLang_s == 0){
				document.getElementById('search').value = "輸入關鍵字";
			}else if(selLang_s == 1){
				document.getElementById('search').value = "Inputs keywords";
			}else if(selLang_s == 2){
				document.getElementById('search').value = "输入关键字";
			}
		}
	}
	
	function form_submit(fm){
		//清空输入的框的文字
		var tesx_str = document.getElementById("search").value;
		//if(tesx_str == "输入关键字" || tesx_str == "輸入關鍵字" || tesx_str == "Inputs keywords"){
		if(tesx_str == input_keywrods){
			document.getElementById('search').value = "";
		}
		
		var sFlag = document.getElementById("select").value;
		switch(sFlag){
			case 'MS' : if($("#searchall_self").val() == 1){
							fm.action = "/searchall/"; fm.target = "_self";
						}else{
							fm.action = "/searchall/";
						}  
			  			return true;
			case 'SS' : fm.action = "/shop_list/"; return true;
			case 'AS' : fm.action = "/news_detail/"; return true;
			case 'GS' : fm.action = "/news_detail/"; return true;
			default : alert("default!"); return true;
		}
	}
	
	
	function const_dis(type,is){
		switch(type){
			case 'pr' : pric_dis="　"+"<span class='const_none'>"+is.innerHTML+"<img onclick=\"const_cls('"+type+"');\" class='const_cls' src='/Main/client/newindex/images/cls.gif'/></span>";
						break;
			case 'si' : size_dis="　"+"<span class='const_none'>"+is.innerHTML+"<img onclick=\"const_cls('"+type+"');\" class='const_cls' src='/Main/client/newindex/images/cls.gif'/></span>";
						break;
			case 'st' : style_dis="　"+"<span class='const_none'>"+is.innerHTML+"<img onclick=\"const_cls('"+type+"');\" class='const_cls' src='/Main/client/newindex/images/cls.gif'/></span>";
						break;
			case 'se' : season_dis="　"+"<span class='const_none'>"+is.innerHTML+"<img onclick=\"const_cls('"+type+"');\" class='const_cls' src='/Main/client/newindex/images/cls.gif'/></span>";
						break;
			default : break;
		}
	}
	
	function const_cls(type){
		switch(type){
			case 'pr' : pric_a="";pric_dis="";
						break;
			case 'si' : size_a="";size_dis="";
						break;
			case 'st' : style_a="";style_dis="";
						break;
			case 'se' : season_a="";season_dis="";
						break;
			default : break;
		}
		
		$.post("/Main/client/newindex/search_result.jsp",{selLang:selLang,c_big:big,c_small:small,Keyword:keyword,pric:pric_a,size:size_a,style:style_a,season:season_a,show_style:show_style_a},function(data){
			var ser_re = data;
			document.getElementById("goodscater").innerHTML = ser_re;
			
			$("#your_select").html(pric_dis+size_dis+style_dis+season_dis);
			
			if(pric_a!=null && pric_a!=""){
				$("#li_pric").css("display","none");
			}
			
			if(size_a!=null && size_a!=""){
				$("#li_size").css("display","none");
			}
			
			if(style_a!=null && style_a!=""){
				$("#li_style").css("display","none");
			}
			
			if(season_a!=null && season_a!=""){
				$("#li_season").css("display","none");
			}
			window.location.hash= 'top_a';
		});
	}
	
	function clsValue(){
		 pric_a   = "";
		 pric_dis = "";
		 season_a = "";
		 season_dis = "";
		 size_a   = "";
		 size_dis   = "";
		 style_a  = "";
		 style_dis  = "";
		 pageNo = "";
	}
	
	//分类搜索
	function post_creaRe(c_big,c_small,Keyword){
		if(c_big!="" && c_big!=null){
			clsValue();
			big = c_big;
		}
		
		if(c_small!="" && c_small!=null){
			clsValue();
			small = c_small;
		}
		
		$.post("/Main/client/newindex/search_result.jsp",{selLang:selLang,c_big:c_big,c_small:c_small,Keyword:Keyword,pric:pric_a,size:size_a,style:style_a,season:season_a,show_style:show_style_a},function(data){
			var ser_re = data;
			document.getElementById("goodscater").innerHTML = ser_re;
			
			$("#your_select").html(pric_dis+size_dis+style_dis+season_dis);
			
			if(pric_a!=null && pric_a!=""){
				$("#li_pric").css("display","none");
			}
			
			if(size_a!=null && size_a!=""){
				$("#li_size").css("display","none");
			}
			
			if(style_a!=null && style_a!=""){
				$("#li_style").css("display","none");
			}
			
			if(season_a!=null && season_a!=""){
				$("#li_season").css("display","none");
			}
			window.location.hash= 'top_a';
		});
	}
	
	//条件组合搜索
	function post_serRe(c_big,c_small,Keyword,pageNo,pric,size,style,season,is,type){
		
		if(is!=null && is!=undefined){
			const_dis(type,is);
		}
		
		if(pric!="" && pric!=null){
			pric_a=pric;
		} 
		
		if(season!="" && season!=null){
			season_a=season;
		} 
		
		if(size!="" && size!=null){
			size_a = size;
		}
		
		if(style!="" && style!=null){
			style_a = style;
		}
		
		if(c_big!="" && c_big!=null){
			big = c_big;
		}
		
		if(c_small!="" && c_small!=null){
			small = c_small;
		}
		
		if(Keyword!="" && Keyword!=null){
			keyword = Keyword;
		}
		
		if(pageNo!="" && pageNo!=null){
			pageNo = pageNo;
		}
		
		$.post("/Main/client/newindex/search_result.jsp",{selLang:selLang,c_big:c_big,c_small:c_small,Keyword:Keyword,pageNo:pageNo,pric:pric_a,size:size_a,style:style_a,season:season_a,show_style:show_style_a,pro_sequence:pro_sequence_a},function(data){
			var ser_re = data;
			document.getElementById("goodscater").innerHTML = ser_re;
			$("#your_select").html(pric_dis+size_dis+style_dis+season_dis);
			
			if(pric_a!=null && pric_a!=""){
				$("#li_pric").css("display","none");
			}
			
			if(size_a!=null && size_a!=""){
				$("#li_size").css("display","none");
			}
			
			if(style_a!=null && style_a!=""){
				$("#li_style").css("display","none");
			}
			
			if(season_a!=null && season_a!=""){
				$("#li_season").css("display","none");
			}
			window.location.hash= 'top_a';
		});
	}
	
	function displaySty(show_style,pageNo){
		if(show_style!="" && show_style!=null){
			show_style_a = show_style;
		}
		
		$.post("/Main/client/newindex/search_result.jsp",{selLang:selLang,c_big:big,c_small:small,Keyword:keyword,pric:pric_a,size:size_a,style:style_a,season:season_a,show_style:show_style_a,pageNo:pageNo,pro_sequence:pro_sequence_a},function(data){
			var ser_re = data;
			document.getElementById("goodscater").innerHTML = ser_re;
			
			$("#your_select").html(pric_dis+size_dis+style_dis+season_dis);
			
			if(pric_a!=null && pric_a!=""){
				$("#li_pric").css("display","none");
			}
			
			if(season_a!=null && season_a!=""){
				$("#li_season").css("display","none");
			}
			
			if(size_a!=null && size_a!=""){
				$("#li_size").css("display","none");
			}
			
			if(style_a!=null && style_a!=""){
				$("#li_style").css("display","none");
			}
			window.location.hash= 'top_a';
		});
	}
	
	function sortBy(){
		var pro_sequence = $("select[name='pro_sequence']").val();
		if(pro_sequence!="" && pro_sequence!=null){
			pro_sequence_a = pro_sequence;
		}
		
		$.post("/Main/client/newindex/search_result.jsp",{selLang:selLang,c_big:big,c_small:small,Keyword:keyword,pric:pric_a,size:size_a,style:style_a,season:season_a,show_style:show_style_a,pro_sequence:pro_sequence_a},function(data){
			var ser_re = data;
			document.getElementById("goodscater").innerHTML = ser_re;
			
			$("#your_select").html(pric_dis+size_dis+style_dis+season_dis);
			
			if(pric_a!=null && pric_a!=""){
				$("#li_pric").css("display","none");
			}
			
			if(season_a!=null && season_a!=""){
				$("#li_season").css("display","none");
			}
			
			if(size_a!=null && size_a!=""){
				$("#li_size").css("display","none");
			}
			
			if(style_a!=null && style_a!=""){
				$("#li_style").css("display","none");
			}
			window.location.hash= 'top_a';
		});
	}
	
	function changepage(page,endpage){
		if(page>endpage){
			page=1;
			}
		document.getElementById("jumppage").value=page;
	}
	

	function bover(name,id){
		var sel1 = $("#"+name).find("span[class^='sel1']");
		var sel2 = $("#"+name).find("span[class^='sel2']");
		var sel3 = $("#"+name).find("span[class^='sel3']");
		$(sel1)[id].className = "sel11";
		$(sel2)[id].className = "sel22";
		$(sel3)[id].className = "sel33";
	}
	

	function bout(name,m){
		var sel1 = $("#"+name).find("span[class^='sel1']");
		var sel2 = $("#"+name).find("span[class^='sel2']");
		var sel3 = $("#"+name).find("span[class^='sel3']");
		for(var i=0;i<sel1.length;i++){
			if(i != m){
				$(sel1)[i].className = "sel1";
			}
		}
		for(var i=0;i<sel2.length;i++){
			if(i != m){
				$(sel2)[i].className = "sel2";
			}
		}
		for(var i=0;i<sel3.length;i++){
			if(i != m){
				$(sel3)[i].className = "sel3";
			}
		}
	}
	function setImg(img,width,height){
			var prod_width=$(img).width();
			var prod_height=$(img).height();
			if(prod_height<=160 && prod_width<=160){
				$(img).css("height",prod_height+"px");
				$(img).css("width",prod_width+"px");
			}else if(prod_height>=prod_width){
				$(img).css("height",height+"px");
				var n_prod_width=parseInt(prod_width*(height/prod_height));
				$(img).css("width",n_prod_width+"px");
			}else{
				$(img).css("width",width+"px");
				var n_prod_height=parseInt(prod_height*(width/prod_width));
				$(img).css("height",n_prod_height+"px");
			}	
		$(img).css("filter","Alpha(Opacity = 100)").css("opacity","1");
	}
	function setOtherImg(img,width,height){
			var prod_width=$(img).width();
			var prod_height=$(img).height();
			if(prod_height<=height && prod_width<=width){
				$(img).css("height",prod_height+"px");
				$(img).css("width",prod_width+"px");
			}else if((prod_height-20)>=prod_width){
				$(img).css("height",height+"px");
				var n_prod_width=parseInt(prod_width*(height/prod_height));
				$(img).css("width",n_prod_width+"px");
			}else{
				$(img).css("width",width+"px");
				var n_prod_height=parseInt(prod_height*(width/prod_width));
				$(img).css("height",n_prod_height+"px");
			}	
		$(img).css("filter","Alpha(Opacity = 100)").css("opacity","1");
	}

