var mess_id = null;
function removeMessage(id){
	var node = document.getElementById(id);
	if(node.style.display){
		node.style.display = "none";
		node.id = mess_id;
	}
	else{
		var pn = node.parentNode;
		pn.removeChild(node);
		if(document.all && pn.lastChild.tagName == "BR")
			pn.removeChild(pn.lastChild);
	}
}

function handlePO(m, obj){
	if(document.getElementById('ms')){
		clearTimeout(timer);
		removeMessage('ms');
	}
	var ms = document.createElement('div');
	ms.id = "ms";
	ms.innerHTML = "Processing...";
	if(document.all)
		obj.parentNode.appendChild(document.createElement('br'));
	obj.parentNode.appendChild(ms);
	ajax.callurl("process.php?action=po1&t="+obj.id+"&m="+m, "po");
	ajax.obj = obj;
}

function popImg(iref){
	var src = null;
	var pop = document.createElement('img');
	if(location.href.indexOf('/index.php') > 0 || location.href.indexOf('.php') == -1){
		var o = iref.parentNode.nextSibling;
		if(o){
			src = o.firstChild.src;
			with(pop.style){
				marginTop = "110px";
				zIndex = 3;
			}
		}
	}
	else{
		src = iref.src;
		with(pop.style){
			marginTop = "95px";
			marginLeft = "-120px";
		}
	}
	
	if(src && src.indexOf('images/') == -1){
		pop.id = "popImg";
		pop.src = src.replace('/thumb/', '/small/');
		with(pop.style){
			position = 'absolute';
			border = "1px solid #6d0b0c";
		}
		iref.parentNode.parentNode.appendChild(pop);
		iref.onmouseout = removePopup;
	}
}

function removePopup(e){
	var node = document.getElementById('popImg');
	node.parentNode.removeChild(node);
}

