(function($){
$(document).ready(function(){//初始化
	$("#tab_trade").click(function(){//贸易层
		document.getElementById("tab_trade").className="s_down";
		document.getElementById("tab_shopping").className="s_up";
		document.getElementById("tab_transportation").className="s_up";
		document.getElementById("tab_travel").className="s_up";
		document.getElementById("tab_unsCard").className="s_up";
		
		$("#trade").show();
		$("#shopping").hide();
		$("#transportation").hide();
		$("#travel").hide();
		$("#unsCard").hide();
	});
	
	$("#tab_shopping").click(function(){//购物层
		document.getElementById("tab_trade").className="s_up";
		document.getElementById("tab_shopping").className="s_down";
		document.getElementById("tab_transportation").className="s_up";
		document.getElementById("tab_travel").className="s_up";
		document.getElementById("tab_unsCard").className="s_up";
		
		$("#trade").hide();
		$("#shopping").show();
		$("#transportation").hide();
		$("#travel").hide();
		$("#unsCard").hide();
	});
	
	$("#tab_transportation").click(function(){//物流层
		document.getElementById("tab_trade").className="s_up";
		document.getElementById("tab_shopping").className="s_up";
		document.getElementById("tab_transportation").className="s_down";
		document.getElementById("tab_travel").className="s_up";
		document.getElementById("tab_unsCard").className="s_up";
		
		$("#trade").hide();
		$("#shopping").hide();
		$("#transportation").show();
		$("#travel").hide();
		$("#unsCard").hide();
	});
	$("input[name='wlhy_type']").each(function(i){//物流各行业层的动作
		$(this).click(function(){
			var j = document.getElementsByName("wlhy_type").length;
			for(var x=1;x<=j;x++){
				if($(this).val()==x){
					$("#wl_form"+this.value).show();
				}else{
					$("#wl_form"+x).hide();
				}
			}
		});
	});
	$("#wlqy_form").submit(function(){//物流汽运提交
		if($("#wlqy_industryType").val()==1){
			document.getElementById("wlqy_form").action = "http://ld.uns56.com/truck/search.htm";
			document.getElementById("wlqy_form").submit();
		}
		if($("#wlqy_industryType").val()==2){
			document.getElementById("wlqy_form").action = "http://ld.uns56.com/cargo/search.htm";
			document.getElementById("wlqy_form").submit();
		}
		if($("#wlqy_industryType").val()==3){
			document.getElementById("wlqy_form").action = "http://ld.uns56.com/line/search.htm";
			document.getElementById("wlqy_form").submit();
		}
	});
	$("#wlhy_form").submit(function(){//物流海运提交
		if($("#wlhy_industryType").val()==1){
			document.getElementById("wlhy_form").action = "http://www.uns56.com/shipping/price/search.htm";
			document.getElementById("wlhy_form").submit();
		}
		if($("#wlhy_industryType").val()==2){
			document.getElementById("wlhy_form").action = "http://www.uns56.com/shipping/goods/search.htm";
			document.getElementById("wlhy_form").submit();
		}
	});
	$("#wlair_form").submit(function(){//物流空运提交
		if($("#wlair_industryType").val()==1){
			document.getElementById("wlair_form").action = "http://www.uns56.com/air/price/search.htm";
			document.getElementById("wlair_form").submit();
		}
		if($("#wlair_industryType").val()==2){
			document.getElementById("wlair_form").action = "http://www.uns56.com/air/goods/search.htm";
			document.getElementById("wlair_form").submit();
		}
	});
	$("#wltrade_form").submit(function(){//物流贸代提交
		if($("#wltrade_industryType").val()==1){
			document.getElementById("wltrade_form").action = "http://www.uns56.com/trade/afford/search.htm";
			document.getElementById("wltrade_form").submit();
		}
		if($("#wltrade_industryType").val()==2){
			document.getElementById("wltrade_form").action = "http://www.uns56.com/trade/demand/search.htm";
			document.getElementById("wltrade_form").submit();
		}
	});
	$("#wldepot_form").submit(function(){//物流仓储提交
		if($("#wldepot_industryType").val()==1){
			document.getElementById("wldepot_form").action = "http://www.uns56.com/depot/afford/search.htm";
			document.getElementById("wldepot_form").submit();
		}
		if($("#wldepot_industryType").val()==2){
			document.getElementById("wldepot_form").action = "http://www.uns56.com/depot/demand/search.htm";
			document.getElementById("wldepot_form").submit();
		}
	});
	$("#wlexpress_form").submit(function(){//物流快递提交
		if($("#wlexpress_industryType").val()==1){
			document.getElementById("wlexpress_form").action = "http://www.uns56.com/express/afford/search.htm";
			document.getElementById("wlexpress_form").submit();
		}
		if($("#wlexpress_industryType").val()==2){
			document.getElementById("wlexpress_form").action = "http://www.uns56.com/express/demand/search.htm";
			document.getElementById("wlexpress_form").submit();
		}
	});
	$("#wlrailway_form").submit(function(){//物流铁路提交
		if($("#wlrailway_industryType").val()==1){
			document.getElementById("wlrailway_form").action = "http://www.uns56.com/railage/price/search.htm";
			document.getElementById("wlrailway_form").submit();
		}
		if($("#wlrailway_industryType").val()==2){
			document.getElementById("wlrailway_form").action = "http://www.uns56.com/railage/goods/search.htm";
			document.getElementById("wlrailway_form").submit();
		}
		if($("#wlrailway_industryType").val()==3){
			document.getElementById("wlrailway_form").action = "http://www.uns56.com/railage/line/search.htm";
			document.getElementById("wlrailway_form").submit();
		}
	});
	
	
	
	$("#tab_travel").click(function(){//旅游层
		document.getElementById("tab_trade").className="s_up";
		document.getElementById("tab_shopping").className="s_up";
		document.getElementById("tab_transportation").className="s_up";
		document.getElementById("tab_travel").className="s_down";
		document.getElementById("tab_unsCard").className="s_up";
		
		$("#trade").hide();
		$("#shopping").hide();
		$("#transportation").hide();
		$("#travel").show();
		$("#unsCard").hide();
	});
	
	$("#tab_unsCard").click(function(){//商联卡层
		document.getElementById("tab_trade").className="s_up";
		document.getElementById("tab_shopping").className="s_up";
		document.getElementById("tab_transportation").className="s_up";
		document.getElementById("tab_travel").className="s_up";
		document.getElementById("tab_unsCard").className="s_down";
		
		$("#trade").hide();
		$("#shopping").hide();
		$("#transportation").hide();
		$("#travel").hide();
		$("#unsCard").show();
	});
	
	//国内外贸易关键字获得焦点时
	$("#trade_keyWord").focus(function(){
		if($("#trade_keyWord").val()=='请在此输入产品名称或公司名称'){
				$("#trade_keyWord").val("");
			}
	});
	//国内外贸易关键字失去焦点时
	$("#trade_keyWord").blur(function(){
		if($("#trade_keyWord").val()==''){
				$("#trade_keyWord").val('请在此输入产品名称或公司名称');
			}
	});
	//国内外贸易搜索提交shoppingSearchForm
    $("#tradeSearchForm").submit(function(){
		if($("select#keySearchType").val()=='S100'){
			$("#userName").val($("#keyWordsNm").val());
			$("#method").val('schByArea');
			if($("#trade_keyWord").val()=='请在此输入产品名称或公司名称'){
				$("#trade_keyWord").val('');
			}
			document.getElementById("tradeSearchForm").action="http://www.unsbiz.com/com/comChannel.do";
			document.getElementById("tradeSearchForm").submit();
		}else{
			if($("#trade_keyWord").val()=='请在此输入产品名称或公司名称'){
				$("#trade_keyWord").val('');
			}
			$("#method").val('keyWordSearch');
			document.getElementById("tradeSearchForm").action="http://www.unsbiz.com/searchGoods.do";
			document.getElementById("tradeSearchForm").submit();
		}
		return false;
	});
	
	//购物关键字获得焦点时
	$("#shopping_keyWord").focus(function(){
		if($("#shopping_keyWord").val()=='请在此输入产品名称或公司名称'){
				$("#shopping_keyWord").val("");
			}
	});
	//购物关键字失去焦点时
	$("#shopping_keyWord").blur(function(){
		if($("#shopping_keyWord").val()==''){
				$("#shopping_keyWord").val('请在此输入产品名称或公司名称');
			}
	});
	//购物搜索提交
    $("#shoppingSearchForm").submit(function(){
		if($("#shopping_keyWord").val()=='请在此输入产品名称或公司名称'){
			$("#shopping_keyWord").val('');
		}
		if($("#shopping_keyWord").val()==''){
			alert("请输入关键字后进行查询");
			return false;
		}
		document.getElementById("shoppingSearchForm").submit();
		return false;
	});
	
	//商联卡关键字获得焦点时
	$("#unsCard_keyWord").focus(function(){
		if($("#unsCard_keyWord").val()=='请在此输入产品名称或公司名称'){
				$("#unsCard_keyWord").val("");
			}
	});
	//商联卡关键字失去焦点时
	$("#unsCard_keyWord").blur(function(){
		if($("#unsCard_keyWord").val()==''){
				$("#unsCard_keyWord").val('请在此输入产品名称或公司名称');
			}
	});
	//商联卡搜索提交
    $("#unsCardSearchForm").submit(function(){
		if($("#unsCard_keyWord").val()=='请在此输入产品名称或公司名称'){
			$("#unsCard_keyWord").val('');
		}
		document.getElementById("unsCardSearchForm").submit();
		return false;
	});	
});
})(jQuery)
