var Cookie = Class.create();
Cookie.prototype = {initialize:function () {
}, get:function (_1) {
	var _2 = document.cookie;
	var _3 = _2.indexOf(_1 + "=");
	if (_3 != -1) {
		_3 += _1.length + 1;
		last = _2.indexOf("%7C%7C%7C", _3);
		if (last == -1) {
			last = _2.length;
		}
		return decodeURIComponent(_2.substring(_3, last));
	}
	return null;
}, set:function (_4, _5, _6, _7) {
	_7 = (_7 == undefined) ? ".56pin.com" : _7;
	_6 = (_6 == undefined) ? 86400 * 30 : _6;
	var _8 = new Date();
	_8.setDate(_8.getDate() + _6);
	document.cookie = _4 + "=" + encodeURIComponent(_5) + "; domain=" + _7 + "; path=/" + "; expires=" + _8.toGMTString();
}};
var cookie = new Cookie();
function loginStatus() {
	var n = cookie.get("56pinUser");
	var _a = '您好, <a href="/user/wo.php" target="_top">' + n + '</a> <span id="notify"></span> | <a href="/page/pay/charge.php" target="_blank">充值</a>  | <a href="/user/bye.php" target="_top">退出</a>';
	var _b = '<a href="/user/zhuce.php" target="_top">注册</a> | <a href="/user/denglu.php" target="_top">登录</a>';
	if (n) {
		document.write(_a);
/*
		var _c = (cookie.get("__notes"));
		if (_c) {
			if (_c != 0) {
				$("notify").innerHTML = ' | <a href="#" onclick="delCookie("__notes");" target="_blank"> <font color="red"> 您有' + _c + '条新消息</font></a> ';
			}
		} else {
			new Ajax.Request("/services/unreadMessages", {onSuccess:function (_d) {
				var _e = _d.responseText;
				if (!_e) {
					_e = 0;
				}
				var _f = new Date();
				_f.setTime(_f.getTime() + 120000);
				document.cookie = "__notes" + "=" + encodeURIComponent(_e) + ";path=/;expires=" + _f.toGMTString();
				if (_e != 0) {
					$("notify").innerHTML = ' | <a href="#" onclick="delCookie("__notes");" target="_blank"> <font color="red"> 您有' + _e + '条新消息</font></a> ';
				}
			}});
		}
*/
	} else {
		document.write(_b);
	}
}
function delCookie(_10) {
	var exp = new Date();
	exp.setTime(exp.getTime() - 1);
	var _12 = readCookie(_10);
	if (_12 != null) {
		document.cookie = _10 + "=" + _12 + ";path=/;expires=" + exp.toGMTString();
	}
}
var cateArray = new Array();
function AjaxCategoryBox(v, _14, c) {
	var _16 = $("ajaxCategoryBox");
	var dt = _16.getElementsByTagName("dt")[0];
	var dd = _16.getElementsByTagName("dd")[0];
	var _19 = $("categoryId");
	if (_14 == 2) {
		v.className = "out";
		return;
	} else {
		if (_14 == 3) {
			v.className = "move";
			return;
		} else {
			if (_14 == 1) {
				$("categoryId").value = cateArray[c][0];
				dt.innerHTML = cateArray[c][1];
				dd.style.display = "none";
				dd.innerHTML = "";
				return;
			}
		}
	}
	function showSelectBox() {
		var _1a = "";
		for (var i = 0; i < cateArray.length; i++) {
			if (_19.value == cateArray[i][0]) {
				dt.innerHTML = cateArray[i][1];
			} else {
				var jj = "+ ";
				if (cateArray[i][2] == 2) {
					jj = "\u3000-- ";
				}
				_1a = _1a + '<span onclick="AjaxCategoryBox(this,1,i);" onmouseout="AjaxCategoryBox(this,2,cateArray[i][0]);" onmousemove="AjaxCategoryBox(this,3,cateArray[i][0]);">' + jj + cateArray[i][1] + '</span>';
			}
		}
		if (_1a != "") {
			dd.innerHTML = _1a;
			dd.style.display = "block";
		}
		dd.onmouseover = function () {
			dd.style.display = "block";
		};
		_16.onmousedown = function () {
			dd.style.display = "block";
		};
		_16.onmouseout = function () {
			dd.style.display = "none";
		};
		return;
	}
	if (cateArray.length < 3) {
		dt.innerHTML = "数据加载中..";
		var url = "/services/ajaxCategory?c=" + _19.value;
		new Ajax.Request(url, {onComplete:function (_1e, _1f) {
			var _20 = _1e.responseText.evalJSON(true);
			for (var i = 0; i < _20.length; i++) {
				cateArray[i] = new Array(_20[i][0], _20[i][1], _20[i][2]);
			}
			showSelectBox();
		}});
	} else {
		showSelectBox();
	}
}

