function postlist_joinKeyDown(e) {
	if(!e) e = window.event;
	var self = e.srcElement;
	if(! self) self = e.target;
	if(! self) return false;

	if(e.keyCode == 13) {
		postlist_joinList();
		return false;
	}
	return true;
}

function postlist_joinList() {
	var el = document.getElementById("postlist_joinBox");
	var email = el.value;
	sendXMLHttp("POST", "index.php?action=postlist&postlist-action=joinList&postlist-email="+email, postlist_joinCallback, "0");
	return false;
}

function postlist_resignList() {
	var el = document.getElementById("postlist_joinBox");
	var email = el.value;
	sendXMLHttp("POST", "index.php?action=postlist&postlist-action=resignList&postlist-email="+email, postlist_resignCallback, "0");
	return false;
}

function postlist_joinCallback(response, param) {
	if(response.responseText != "") {
		alert(response.responseText);
	} else {
		var el = document.getElementById("postlist_joinBox");
		el.value="";
		alert(locale.postlist_joined);
	}
}

function postlist_resignCallback(response, param) {
	if(response.responseText != "") {
		alert(response.responseText);
	} else {
		var el = document.getElementById("postlist_joinBox");
		el.value="";
		alert(locale.postlist_resigned);
	}
}

