function closeErrorMsgDiv(ObjId)
{
	$("#"+ObjId).slideUp(2000,function() {
		$("#"+ObjId).remove(); 
	})
}

function AjaxDeleteItemObject(DelUrl,ObjId,ConfirmMsg,contentObjId)
{
	if( confirm(ConfirmMsg) )
	{
		$.ajax({
			type: "GET",
			url: DelUrl,
			beforeSend: function() {
				$("#"+ObjId).css({opacity:'0.5'});
			},
			success: function(DataRet) {
		   		if( DataRet == "OK" )
		   		{
	   				$("#"+ObjId).slideUp(500,function() {
						$("#"+ObjId).remove(); 
					})
		   		}
		   		else
		   		{
					$("#"+ObjId).css({opacity:'1'});
		   			$("#"+contentObjId).prepend("<div id='"+contentObjId+"ErrorMsg' class='ContentErrorMsg'></div>");
		   			$("#"+contentObjId+"ErrorMsg").html( DataRet );
					TO = setTimeout('closeErrorMsgDiv("'+contentObjId+'ErrorMsg")',6000);
		   		}
			}
			   
		 });
		// {AccountDir}/contenidos/index.php?Mode=C_Y_Action=D_Y_Id={Id}
		
//		$("#"+ObjDiv).remove();
	}	
}

function AjaxDeleteAndRedirect(DelUrl,ObjId,ConfirmMsg,redirectUrl)
{
	if( confirm(ConfirmMsg) )
	{
		$.ajax({
			type: "GET",
			url: DelUrl,
			beforeSend: function() {
				$("#"+ObjId).css({opacity:'0.5'});
			},
			success: function(DataRet) {
		   		if( DataRet == "OK" )
		   		{
		   			window.location = redirectUrl;
		   		}
		   		else
		   		{
					$("#"+ObjId).css({opacity:'1'});
		   			$("#"+ObjId).prepend("<div id='"+ObjId+"ErrorMsg' class='ContentErrorMsg'></div>");
		   			$("#"+ObjId+"ErrorMsg").html( DataRet );
					TO = setTimeout('closeErrorMsgDiv("'+ObjId+'ErrorMsg")',6000);
		   		}
			}
			   
		 });
		// {AccountDir}/contenidos/index.php?Mode=C_Y_Action=D_Y_Id={Id}
		
//		$("#"+ObjDiv).remove();
	}	
}
