/**
 * @author PacMan / Bob
 */

var xmlhttp_dc;

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

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