function barter(o){
		if(o==1){
			 $('#goods').removeClass("son");
			$('#shop').addClass("son");
			$('#type').val("shop");			
		}else if(o==2){
		    $('#shop').removeClass("son");
			$('#goods').addClass("son");
			$('#type').val("goods");	
		}
	}
function checkTopSearchSubmit(f)
{
	if(undefined!=f.q && f.q.value.length>0 && f.q.value.indexOf('请输入')<0)
	{
		if(f.type.value=='shop')
		{
			f.action='/gouwu/mlist.htm';
		}
		else if(f.type.value=='goods')
		{
			f.action='/gouwu/glist.htm';
		}
		//f.q.value=encodeURIComponent(f.q.value);
		return true;
	}
	alert('请先输入关键字，再搜索！');
	f.q.focus();
	return false;
}


function com(o){
var q = encodeURIComponent(encodeURIComponent(o));
var type = $('#type').val();
	if(type=='shop'){
		location = "/gouwu/mlist.htm?type="+type+"&q="+q;  
	}else if(type=='goods'){
		location = "/gouwu/glist.htm?type="+type+"&q="+q;
	}
}

//加载常用位置
function loadUserMap(nowPage){
	$.ajax({
		type:"post",
		dataType:"json",
		url:"/ajax/seeLabel.htm?",
		data:"&nowPage="+nowPage,
		cache:true,
		error: function(){
			$('#load').html("<center>加载失败！可能是网络问题引起，请稍后再访问。</center>");
		},
		success:function(msg){
			var list = msg.list;
			$('#updateMapTitle').attr("href",'javascript:updateMapTitle('+msg.id+')');
			$('#hong').html(msg.title);
			$('#up').html(msg.up);
			$('#down').html(msg.down);
			$('#hi').val(msg.hi);
			if(msg.title=="(未标注地图)"){
			$('#updateMapTitle').hide();
			$('#my').hide();
			}
			if(list.length>0){
			//五条列表试的是显示
				var html=[];
				for(var i=0;i<list.length;i++){
					html.push('<li><a target="_blank" href="/m'+list[i].merid+'/index.htm">'+list[i].newtitle+'</a></li>');
				}
				$('#newlist').html(html.join(""));
			}
		}
	});
}

function switchLay(){
	jBox.open('iframe-map','iframe','/commons/user_map/index.jsp','标出您所在位置，系统帮您找到其周边商情','width=620,height=410,center=true,minimizable=false,resize=false,draggable=false,model=true,scrolling=false');
}	

var mapType = 1;//1头部,2商家店铺,3商品分店,4服务型商品分店,5搜索中部
function setLngLat(lng,lat,title)
{
	if(''==title)
	{
		title = "标注地点"
	}
	if(6==mapType)
	{
		var f = document.getElementById('searchForm');
		if(undefined != f && null != f)
		{
			f.qlat.value=lat;
			f.qlon.value=lng;
			f.q.value=encodeURIComponent(title);
			f.submit();
		}
	}
}

$(function(){
	$('.mysoding').hover(function(){
		$(this).addClass('mysoding2');
		$(this).children('.menu_list').show();
	},function(){
		$(this).removeClass('mysoding2');
		$(this).children('.menu_list').hide();
	});
});
