//ALL VARIOUS AJAX SCRIPTS

/*
		####### SCRIPT BEING CALLED INITIALLY IS UNIQUE EVERY TIME
*/

var xmlHttp = "";

function ajaxComment(Opt, dID, blogCom, commName) {
	xmlHttp = GetXmlHttpObject();
	if (xmlHttp == null) {
		alert("You really ought to update your browser!");
		return;
	}
	
	var url = "";
	url = "inc/comment_proc.php?opt=" + Opt + "&dID=" + dID;
	if (blogCom != 0) {
		url = url + "&bComm=" + blogCom;
	}
	if (commName != 0) {
		url = url + "&cName=" + commName;
	}

	xmlHttp.onreadystatechange = function() { if ((xmlHttp.readyState == 4) || (xmlHttp.readyState == "complete")) { document.getElementById("comment" + dID).innerHTML = xmlHttp.responseText;	} }
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function GetXmlHttpObject() {
	var xmlHttp = null;
	try {
		//FF, Opera, Safari
		xmlHttp = new XMLHttpRequest();
	}
	catch(e) {
		//IE
		try {
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e) {
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}
