// JavaScript Document
function createRequestObject(){
	var request_o;
	var browser = navigator.appName;
		if(browser =="Microsoft Internet Explorer")	{
			request_o = new ActiveXObject("Microsoft.XMLHTTP");
		}//end if
		else {
			request_o = new XMLHttpRequest();
		}//end else
	return request_o;
}//end create request object


var http = createRequestObject();

var dir;
var url = window.location.href;

if(url.search('www') > 0){
	var dir = 'http://www.ionamagazine.com/';
}
else {
	var dir = 'http://ionamagazine.com/';
}





//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\\
//---------------------------------------------------- Event Functions ----------------------------------------------------||
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&//

function rateComment(id, curVote, vote, blogId, ip){
	
	//uses the xml object to open a document, using the get method
	http.open('get', dir + 'assets/ajax/intRequest.php?action=rateComment&id=' + id + '&curVote=' + curVote + '&vote=' + vote + '&blog_id=' + blogId + '&ip=' + ip);
	//checks the readystate if it changes it calls the handler associated with this event
	http.onreadystatechange = rateCommentHandler;
	http.send(null);
}//end getEvent


//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\\
//----------------------------------------------------Handler Functions-----------------------------------------------------||
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&//
function rateCommentHandler(){
	if(http.readyState == 4)	{
		
		var response = http.responseText;
		document.getElementById('comment-list').innerHTML = response;
	}//end if
}//end handleEvent