
function moveItem(dir,b_input,e)
{
	dontBubble(e);
	
	var r=b_input.parentNode.parentNode;
	var t=r.parentNode;
	var old_post;
	
	var next=r.nextSibling;
	while (next && next.nodeType!=1)
	{
		//alert(next.nodeType);
		next=next.nextSibling;
	}
	if(next)
	{
		next=next.nextSibling;
		while (next && next.nodeType!=1)
		{
			//alert(next.nodeType);
			next=next.nextSibling;
		}
	}
	var prev=r.previousSibling;
	while(prev.nodeType==3)
		prev=prev.previousSibling;
	//alert(prev);
	if(dir > 0)
	{
		if(countNextRows(r)>0)
		{
			old_pos=t.removeChild(r);
			t.insertBefore(old_pos,next);
		}
	}
	else if(dir < 0)
	{
		if(countPrevRows(r)>1)
		{
			old_pos=t.removeChild(r);
			t.insertBefore(old_pos,prev);
		}
	}

	document.body.style.visibility="hidden";
}

function countPrevRows(r)
{
	cnt=0;
	while(r=r.previousSibling)
	{
		if (r.nodeType!=3)
			cnt++;
	}
	//alert(cnt);
	return cnt;
}

function countNextRows(r)
{
	cnt=0;
	while(r=r.nextSibling)
	{
		if (r.nodeType!=3)
			cnt++;
	}
	//alert(cnt);
	return cnt;
}
function dontBubble(e)
{
	if (!e)
		var e = window.event
	e.cancelBubble = true;
	if (e.stopPropagation)
		e.stopPropagation();
}

function confirmDelete(e,t)
{
	dontBubble(e);
	return confirm("Really delete this "+t+"?");
}


