﻿//显示城市菜单 start
function ShowCityMenu(Flag){
	var CityMenu=document.getElementById("CityMenu");
	if(Flag){
		CityMenu.style.display="block";
		CityMenu.style.left=(window.screen.width-940)/2+165;
	}else{
		CityMenu.style.display="none";
	}
}
//显示城市菜单 end

//不是搜索商家则隐藏分类 start
function ClassHidden(Type){
	if(Type!="1"){
		document.getElementById("hBns_bclass").style.display="none";
		document.getElementById("hBns_sclass").style.display="none";
		document.getElementById("hKeyword").style.width="400px";
	}else{
		document.getElementById("hBns_bclass").style.display="inline";
		document.getElementById("hBns_sclass").style.display="inline";
		document.getElementById("hKeyword").style.width="225px";
	}
}
//不是搜索商家则隐藏分类 end

//使顶部搜索框显示搜索条件 start
function SetSearch(Num,Keyword){
	document.getElementById("hSearchType").options[Num-1].selected=true;
	document.getElementById("hKeyword").value=Keyword;
	ClassHidden(Num);
}
//使顶部搜索框显示搜索条件 end

//突出当前菜单 start
function ShowMenu(id,style){
	document.getElementById("MenuBtn_" + id).className=style;
}
//突出当前菜单 end
		function iimgFix(im,x,y){		
			y = y || 99999
			im.removeAttribute("width");
			im.removeAttribute("height");			
			if( im.width/im.height > x/y  && im.width >x ){
				im.height = im.height * (x/im.width)
				im.width = x
				im.parentNode.style.height = im.height * (x/im.width) + 'px'
			}else if( im.width/im.height <= x/y && im.height >y){
				im.width = im.width * (y/im.height)
				im.height = y
				im.parentNode.style.height = y + 'px'
			}
			
			//im.style.visibility = 'visible'	
		}