function OpenBigMap(id,name)
{
	tipsWindown(name,"iframe:restaurant_sr.php?shopid="+id+"&maptype=1&tips=1","800","527","false","","true","text");
}

function RankAjax(act,ranktype,type,duration)
{
	if(window.rank_type==type && window.duration==duration)
	{
		return false;
	}else
	{
		window.rank_type = type;
		window.duration = duration;
	}
	$.get("./load.php",{act:act,type:window.rank_type,ranktype:ranktype,duration:window.duration},function (data,textStatus)
																{
																	$("#rank").html(data);
																});
	
}

function searchbox(id)
{
	$(".so_fd").hide();
	var valueid = id+'value';
	var textid= id+'text';
	var value = $('#'+textid).val();
	if(!$('#'+valueid).val())
	{
		$('#'+id).show();
		return true;
	}
	$("#"+id).find(":checkbox").removeAttr("checked");
	var value_arr = value.split(',');
	for(var i=0;i<value_arr.length;i++)
	{
		$("#"+id).find(":checkbox").each(function() {
											  if($(this).attr("title")==value_arr[i])
											  {
												  $(this).attr("checked",true);
												  if($(this).val()=='all')
												  {
													  $(this).parent().parent().find(":checkbox").attr("checked",true).attr("disabled",true);
													  $(this).removeAttr("disabled");
												  }
											  }
								});
	}
	$('#'+id).show();
}

function closebox(id)
{
	$('#'+id).hide();
}

function select_submit(id)
{
	var valueid = id+'value';
	var textid= id+'text';
	var value_str = '';
	var text_str = ''
	$("#"+id).find("input:checked").each(function() {
									if($(this).val()!='all')
									{
										value_str += $(this).val()+',';
									}
									if(!$(this).attr('disabled'))
									{
										text_str += $(this).attr("title")+',';
									}
									
									});
	value_str = value_str.substr(0,value_str.length-1);
	text_str = text_str.substr(0,text_str.length-1);
	$('#'+valueid).val(value_str);
	$('#'+textid).val(text_str);
	$('#'+id).hide();
}

function chooseAll(obj)
{
	if($(obj).attr("checked"))
	{
		$(obj).parent().parent().find(":checkbox").each(function() {
											if($(this).val()!='all')
											{
												$(this).attr("checked",true).attr("disabled",true);
											}	   
										});
	}else
	{
		$(obj).parent().parent().find(":checkbox").each(function() {
											if($(this).val()!='all')
											{
												$(this).removeAttr("checked").removeAttr("disabled",true);
											}	   
										});
	}
}

function resetAll(id)
{
	$("#"+id).find("input:checked").each(function() {
												  $(this).removeAttr("checked").removeAttr("disabled");
												  });
}

function showTab(showid,hideid,css)
{
	var hidediv = hideid.split(',');
	for(var i=0;i<hidediv.length;i++)
	{
		$('#'+hidediv[i]).hide();
		$('#'+hidediv[i]+'0').removeClass(css);
	}
	$('#'+showid).show();
	//$('#'+hideid).hide();
	$('#'+showid+'0').removeClass(css).addClass(css);
	//$('#'+hideid+'0').removeClass(css);
}

function changefont(e)
{
	if(e==1)
	{
		$('.normal').addClass('large');
	}else
	{
		$('.large').removeClass('large');
	}
}

function addtomyfavor(id,type)
{
	$.get('load.php',{act:"favor",id:id,type:type},function(data)
								 {
									 alert(data);
								 });
}
