
function styledDelete(elm)
{
if (confirm("Are you sure you want to delete this?")) 
{
sqlDelete(elm);
Effect.Puff(elm);
var element=document.getElementById(elm);
element.removeNode(true);
return true;
}
}
function sqlDelete(elm)
{

		var element=document.getElementById(elm);
		var params="action=delete&id="+elm;
		var url='updates.php';
			var ajax=new Ajax.Request(
			url,{method: 'post', parameters: params//All good on the western front...
			});
			Effect.Puff(elm);
	
}
function deleteFile(elm)
{
if (confirm("Are you sure you want to delete this file?")) 
	{
		var element=document.getElementById(elm);
		var url='updates.php';
			var ajax=new Ajax.Request("updates.php", {
		            method: "post",
		            parameters: { id:elm, action:'fileDelete' }
		});
			Effect.Puff(elm);
	}
}
function insertImage(image,width,height)
{

	var textblock=tinyMCE.activeEditor.getContent({format : 'raw'});
	var alt=prompt("What would you like to be the alt text for this image?", "")
	var text="<img src=\""+image+"\" width=\""+width+"\" align=\"left\" height=\""+height+"\" alt=\""+alt+"\"/>";
	textblock+=text;
	text=unescape(textblock);
	tinyMCE.activeEditor.setContent(text,{format : 'html'});
}


function insertFile(name)
{

	var textblock=tinyMCE.activeEditor.getContent({format : 'raw'});
	var alt=prompt("What would you like to be the text for this link?", "")
	var text="<a href=\""+name+"\" title=\""+alt+"\">"+alt+"</a>";
	textblock+=text;
	text=unescape(textblock);
	tinyMCE.activeEditor.setContent(text,{format : 'html'});
}



function deletePage(name)
{
if (confirm("Are you sure you want to delete this page?")) 
	{
		var ajax=new Ajax.Request("updates.php", {
		            method: "post",
		            parameters: { name:name, action:'deletePage' }
		});
		Effect.Puff(name);
	}	
		
}

	