function mouseOver (obj,tag) {
	obj.src = obj.src.replace ("-out", "-over"+tag);
}	
function mouseOut (obj,tag) {
	obj.src = obj.src.replace ("-over"+tag, "-out");
}

function login() {
	$("#login-info").hide ();
	var usr = $("[name='username']").val();
	var pwd = $("[name='password']").val();
	var params = "usr=" + encodeURIComponent (usr) + "&pwd=" + encodeURIComponent (pwd) + "&action=login";
	
	ajaxpost ('login-info', '/ajax/login', params);
	$("#login-info").fadeIn (500);

	return false;
}
function logout() {
	$("#login-info").hide ();
	var params = "action=logout";
	ajaxpost ('login-info', '/ajax/login', params);
	$("#login-info").fadeIn (500);

	return false;
}

function ajaxpost (eid, url, parameters) {
	var xmlHttp;
	
	try {
		// Firefox, Opera 8.0+, Safari
		xmlHttp = new XMLHttpRequest();
	}
	catch (e) {
		// Internet Explorer
		try {
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			try {
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e) {
				return false;
			}
		}
	}

	xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4) {
						
			obj = document.getElementById (eid);
			obj.innerHTML = xmlHttp.responseText;
			
						
			if (obj.style.display == 'none')
				obj.style.display = '';
		}
	}

	xmlHttp.open ("POST", url, true);
	xmlHttp.setRequestHeader ("Accept-encoding", "UTF-8");
	xmlHttp.setRequestHeader ("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader ("Content-length", parameters.length);
	xmlHttp.setRequestHeader ("Connection", "close");
	xmlHttp.send (parameters);
}
