function gebid(id) {
	return document.getElementById(id);
}

function add_item(nid, title) {
	gebid('lBoxClick-' + nid).innerHTML = '<div><img width="7" height="7" src="images/add_anim.gif" /> Hold on...</div>';
	if (!document.lBoxUserLoggedIn) {
		window.location = 'http://' + document.lBoxURL + '/user/login';
		return true;
	}
	new_item(nid, title);
}

function new_item(nid, title) {
	document.lBoxXMLCommand = 'new item';
	document.lBoxXMLNewNid = nid;
	document.lBoxXMLTitle = title;
	xml_request('http://' + document.lBoxURL + '/lightbox/add/' + nid);
}

function ProcessStateChange() {
	switch(document.lBoxXMLCommand) {
		case 'new item':
			if(req.readyState == 4) {
				gebid('lBoxClick-' + document.lBoxXMLNewNid).innerHTML = '<div><i>Added</i></div>';
			}
			break;
	}
}



