var winnoticia='';

function muestraventana(url)
{
	url+= "modificararticulo.php";
	winnoticia=dhtmlwindow.open("nombre", "iframe",url, "Noticias Inedux", "width=650px,height=540px,resize=1,scrolling=0,center=1", "recal")
}

//abre la ventana para modificar la noticia
function modificarnoticia(id,url)
{

	url+= "modificararticulo.php?idnoticia="+id;
	
	winnoticia=dhtmlwindow.open("nombre", "iframe",url, "Noticias Inedux", "width=650px,height=540px,resize=1,scrolling=0,center=1", "recal")
	
}

function cerrarnoticia()
{
	winnoticia.close();
}

function conexion()
{
	var xmlhttp=false;	try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 	} catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
 	} catch (E) { xmlhttp = false; } } 
	if(!xmlhttp && typeof XMLHttpRequest!='undefined') { 
	xmlhttp = new XMLHttpRequest();
	} return xmlhttp;
}

function eliminarnoticia(id,url)
{
	if(confirm("¿Desea eliminar este articulo?"))
	{
		url+= "eliminararticulo.php?tidarticulo="+id;
		h=conexion();
		h.open("GET",url,true);
		h.onreadystatechange=
		function()
		{
			if (h.readyState==4)
			{
				document.location.reload();
			}
		}
		h.send(null);
	}
}