var itime = new Date();
randtime = itime.getTime();
document.getElementById("loginOrnot").src="headerchecklogin.asp?"+randtime;
//addLoadEvent(login_register);
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	}
	else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}
function readCookie(name){
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++){
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
function login_register() {
	if(isloggedin==false) {
		var loginandreginner = '<div class="h_login"><a href="javascript:et.login(0);">登录</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="javascript:et.register(0);">注册</a></div>';
	} else {
		var loginandreginner ='<div class="h_login_on">欢迎您,'+usernick+'&nbsp;&nbsp;<a href="mymolihe.asp">管理中心</a> '+
	' <a href="index.asp?action=logout">退出</a>&nbsp;&nbsp;</div>';
	}
	document.getElementById("newuser").innerHTML = loginandreginner;
}

function login_register2() {
	if(isloggedin==false) {
		var loginandreginner = '<div class="h_login"><a href="javascript:et.login(0);">登录</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="javascript:et.register(0);">注册</a></div>';
	} else {
		var loginandreginner ='<div class="h_login_on">欢迎您,'+decodeURI(readCookie("user_nick"))+'&nbsp;&nbsp;<a href="mymolihe.asp">管理中心</a> '+
	' <a href="index.asp?action=logout">退出</a>&nbsp;&nbsp;</div>';
	}
	document.getElementById("newuser").innerHTML = loginandreginner;
}



