function OpenPopup(IdC)
{
	if(IdC) 
	{
		switch(IdC)
		{
			case "CreatedBy": var OpenPopupUrl="../sitio/AcercaDe.php"; var Title="Acerca de..."; WindowName="PopupCopy"; break;
		}
		var OpenPopupWidth=500; var OpenPopupHeight=400;
		PopupName=dhtmlwindow.open(WindowName, "iframe", OpenPopupUrl, ""+Title+"", "width="+ OpenPopupWidth +"px,height="+OpenPopupHeight+"px,resize=1,scrolling=1,center=1", "recal");
	}
}

function GenericDeleteCurrentImage(ImgName, Table, Id, Key)
{
	if(confirm("Realmente desea eliminar esta imagen? \nSi pulsa aceptar no podrá recuperarla!"))
	{
		var Type='GenericDeleteImage';
		var archivo_ajax="../admin/TE_Ajax.php?Type="+Type;
		if((ImgName) && (Table) && (Key) && (Id))
		{
			var ajax=funcionnuevoAjax();
			ajax.open("POST", archivo_ajax, true);
			ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			ajax.send("ImgName="+ImgName+"&Table="+Table+"&Key="+Key+"&Id="+Id);
			ajax.onreadystatechange=function()
			{
				if (ajax.readyState==1) { } 
				if (ajax.readyState==4)
				{
					//alert(ajax.responseText);
					if(ajax.responseText==1) { document.location=location.href; }
				}
			}
		}
	}
}

function ViewCurrentImage(IMAGEN)
{
	if(IMAGEN) { window.open('../sitio/popup_image.php?image='+IMAGEN+'','Imagen','height=50, width=50,top=0,left=0, scrollbars=no, resizable=no'); }
}
