function editCategory( Name, ID )
{
	document.categoryForm.addCategory.value = "edit category";
	document.categoryForm.categoryname.value = Name;
	document.categoryForm.categoryid.value = ID;
}

function deleteCategory( Name, ID )
{
	if ( confirm("Do you want delete category " + Name + "?" ) ) 
	{
		window.location = "postcat.php?delete=cat&catid=" + ID;
	}
}

function clearData()
{
	document.categoryForm.addCategory.value = "add category";
	document.categoryForm.reset();
}

function editBookmark( Name, Link, ID, Index )
{
	document.bookmarkForm.addLink.value = "edit bookmark";
	document.bookmarkForm.linkname.value = Name;
	document.bookmarkForm.linklink.value = Link;
	document.bookmarkForm.catselect.selectedIndex = Index;
	document.bookmarkForm.linkid.value = ID;
}

function deleteBookmark( Name, ID )
{
	if ( confirm("Do you want delete " + Name + "?" ) ) 
	{
		window.location = "postbook.php?delete=book&bookid=" + ID;
	}
}

function clearLinkData()
{
	document.bookmarkForm.addLink.value = "add bookmark";
	document.bookmarkForm.reset();
}

function twist( sid )
{
	imgobj = document.getElementById( "img_"+sid );
	divobj = document.getElementById( sid );
	if ( imgobj.src.match( "images/up_arrow.png" ) )
	{
		imgobj.src = "images/down_arrow.png";
		divobj.style.display = "block";
	}
	else	
	{
		imgobj.src = "images/up_arrow.png";
		divobj.style.display = "none";
	}
}