	var temp;
	function get_cookie(varname){
		var tmp_ary = new Array();
		if (varname){
			a = document.cookie.indexOf(varname+"=");
			if (a != -1){
				b = document.cookie.substring((a+varname.length+1),document.cookie.length);
				c = b.split(";");
				d = c[0];
				return d;
			}
		}
	}
	
	function check_login(frm){
		if (frm.User.value.length<1) {
			alert("用户ID不能为空");
			frm.User.focus();
			return false;
		}
		else if (frm.Password.value.length<1) {
			alert("密码不能为空");
			frm.Password.focus();
			return false;
		}
		else
			frm.submit();
	}
	temp = get_cookie("ea3w_userid");
	if (document.cookie.indexOf("ea3w_userid=") == -1){
		document.write("<form name='frm_topic' method='post' action='http://user.ea3w.com/login.php' onSubmit='return check_login(this);' target=_self style='padding:0px;margin:0px;'>");
		document.write("&nbsp;用户名&nbsp;<input type=text name=User size=10 class=input_topic>&nbsp;");
		document.write("密码&nbsp;<input type=password name=Password size=10 class=input_topic maxlength=18>&nbsp;");
		
		document.write("<input type='image' style='cursor:hand;border:0' src='http://icon.ea3w.com/site/but_01.gif' align=absmiddle>&nbsp;");
		document.write("<a href='http://user.ea3w.com/register.php'><img src=http://icon.ea3w.com/site/but_02.gif align=absmiddle border=0></a>");
		document.write("</form>");
	}else{
		document.write("&nbsp;&nbsp;<font color=336699><b>欢迎您 "+temp+"！ </b></font>&nbsp;");
		document.write("<a class=a_h5 href=http://user.ea3w.com/change_pwd.php target=_self>修改密码</a>&nbsp;");
		document.write("<a class=a_h5 href=http://user.ea3w.com/change_info.php target=_self>修改注册资料</a>&nbsp;");
		document.write("<a class=a_h5 href=http://user.ea3w.com/logout.php?backurl=http://www.ea3w.com/ target=_self>退出</a>&nbsp;&nbsp;");
	}
	function SearchCheck(frm){
		var keywod=frm.kw.value;
		var flag=frm.search_flag.value;
		if(keywod==''){
			alert('搜索关键字不能为空！');
			frm.kw.focus();
			return false;
		}
		
		switch(flag){
			case "article":
				frm.action="http://search.ea3w.com/list.php?search=1&channel=article&keyword="+keywod;
				break;
			case "products":
				frm.action="http://product.ea3w.com/products/product_search.php?channel=products&keyword="+keywod;
				break;
			case "price":
				frm.action="http://product.ea3w.com/price/list.php?channel=price&locationid=1&keyword="+keywod;
				break;
			case "dealer":
				frm.action="http://product.ea3w.com/dealer/merchant_list.php?kw="+keywod;
				break;
			case "specail":
				frm.action="http://product.ea3w.com/special/list.php?kw="+keywod;
				break;
			case "market":
				frm.action="http://product.ea3w.com/market/list.php?kw="+keywod;
				break;
			case "flea":
				frm.action="http://flea.ea3w.com/list.php?searchtext="+keywod;
				break;
		}
		
		frm.submit();
	}
