/**
 * @author PacMan / Bob
 */

var xmlhttp_dn;

function dn_AJAX(id){
//	alert('hi'); 
	if(!confirm('Are you sure you wish to delete this news article? This action cannot be undone.')){
		return false;
	}
	
	xmlhttp_dn = null;
	if(window.XMLHttpRequest){// code for all new browsers
		xmlhttp_dn = new XMLHttpRequest();
	}else if(window.ActiveXObject){// code for IE5 and IE6
		xmlhttp_dn = new ActiveXObject("Microsoft.XMLHTTP");
	}
	if(xmlhttp_dn!=null){		
		url = "js/AJAX/deleteNews.php?id=" + id;
		xmlhttp_dn.onreadystatechange=state_Change_dn;
		xmlhttp_dn.open("GET",url,true);
		xmlhttp_dn.send(null);
	}else{
		alert("Your browser does not support XMLHTTP.");
	}
}

function state_Change_dn(){
	if (xmlhttp_dn.readyState == 4) {// 4 = "loaded"
		if (xmlhttp_dn.status == 200) {// 200 = "OK"
			eval(xmlhttp_dn.responseText)
		}
		else {
			alert("Problem retrieving XML data:" + xmlhttp_dn.statusText);
		}
	}
}	