function filter(path,occ,keyWords)
{
	if(conVerify())
	{
		var params="-path_"+path;
		if(occ!="")
		{
			params+="-occ_"+escape(occ);
		}
		if(keyWords!="")
		{
			params+="-keyWords_"+escape(keyWords);
		}
		var list1=document.getElementById("list1");
		var list2=document.getElementById("list2");
		var list3=document.getElementById("list3");
		if(list1.selectedIndex!=0)
		{
			params+="-loc_"+escape(list1.options[list1.selectedIndex].text+"-locPath_"+list1.options[list1.selectedIndex].value);
		}
		if(list2.selectedIndex!=0)
		{
			params+="-loc2_"+escape(list2.options[list2.selectedIndex].text+"-loc2Path_"+list2.options[list2.selectedIndex].value);
		}
		if(list3!=null)
		{
			if(list3.selectedIndex!=0)
			{
				params+="-loc3_"+escape(list3.options[list3.selectedIndex].text);
			}
		}
		var price=document.getElementById("priceText");
		if(price!=null)
		{
			if(price.value.trim().length!=0)
			{
				params+="-price_"+price.value.trim();
			}
		}
		var members=document.getElementById("membersText");
		if(members!=null)
		{
			if(members.value.trim().length!=0)
			{
				params+="-members_"+members.value.trim();	
			}
		}
		var destination=document.getElementById("destination");
		if(destination!=null)
		{
			if(destination.value.trim().length!=0)
			{
				params+="-des_"+escape(destination.value.trim());
			}
		}
		if(document.getElementById("typeCheck").checked)
		{
			params+="-type_";
		}
		if(document.getElementById("guaranteeCheck").checked)
		{
			params+="-guarantee_";
		}
		location.href=location.href.substring(0,location.href.indexOf("-/-")+2)+params.replace(/%/g,"-/")+".aspx";
	}
}

function conVerify()
{
	var price=document.getElementById("priceText");
	var members=document.getElementById("membersText");
	var destination=document.getElementById("destination");
	if(price!=null)
	{
		if(isNaN(price.value.trim()))
		{
			alert("参考报价格式不正确");
			price.focus();
			return false;
		}
		if(price.value.trim().indexOf(".")!=-1||parseInt(price.value.trim())<=0)
		{
			alert("参考报价必须为正整数");
			price.focus();
			return false;
		}
		if(parseInt(price.value.trim())>999999)
		{
			alert("请输入一个合适的服务报价");
			price.focus();
			return false;
		}
	}
	if(members!=null)
	{
		if(isNaN(members.value.trim()))
		{
			alert("团队人数格式不正确");
			members.focus();
			return false;
		}
		if(members.value.trim().indexOf(".")!=-1||parseInt(members.value.trim())<=0)
		{
			alert("团队人数必须为正整数");
			members.focus();
			return false;
		}
		if(parseInt(members.value.trim())>200)
		{
			alert("请输入一个合适的团队人数");
			members.focus();
			return false;
		}
	}
	if(destination!=null)
	{
		if(destination.value.trim().length>10)
		{
			alert("目的地最大长度限制为10个字符");
			destination.focus();
			return false;
		}
		var re=/[^\u4e00-\u9fa5a-zA-Z]/;
		if(re.test(destination.value.trim()))
		{
			alert("目的地只能包含中英文");
			destination.focus();
			return false;
		}
	}
	return true;
}

function pressEnter(e)
{
	if(e.keyCode==13)
	{
		document.getElementById("filterButton").click();
	}
}