﻿/*
* 设置选中的菜单
*/
function setHeadMenuIndex(headMenuIndex) {
	var headMenuIndex = headMenuIndex * 2 + 1;
	$("#nav li:eq(" + --headMenuIndex + ")").attr("class", "focus_r");
	$("#nav li:eq(" + headMenuIndex + ")").html("&nbsp;");
	$("#nav li:eq(" + --headMenuIndex + ")").attr("class", "focus");	
	$("#nav li:eq(" + --headMenuIndex + ")").attr("class", "focus_l");
	$("#nav li:eq(" + headMenuIndex + ")").html("&nbsp;");	
};


$(document).ready(function() {
	//设置搜索选项
	$("#left > .cont2 li").click(function() {
		if($(this).attr("class") != "focus") {
			$("#left > .cont2 li").removeAttr("class");
			$(this).attr("class", "focus");
		}
	});
	$("#btnRegister").click(function() {
		top.window.location.href = "/en/attend/register.htm";																 
	});
	
	$("#imgSearch").click(function() {
		var keyword = $("#txtKeyword").val();
		//判断搜索类型
		switch($(".cont2 .focus").text()) {
			case "Products":
				if(keyword == "") {
					top.window.location.href = "/en/hall/pro.htm";
				} else {
					top.window.location.href = "/en/hall/pro_1_" + encodeURI(keyword) + "_1.htm";
				}
				break;
			case "Booth No.":
				if(keyword == "") {
					window.location.href = "/en/hall/";
				} else {
					window.location.href = "/en/hall/index_1_" + encodeURI(keyword) + "_1.htm";					
				}
				break;
			default : //exhibitor
				if(keyword == "") {
					window.location.href = "/en/hall/";
				} else {
					window.location.href = "/en/hall/index_0_" + encodeURI(keyword) + "_1.htm";										
				}
				break;
		}
		
	});

});



