function getHTTPObject(){ 
	var xmlhttp; 
	if(window.XMLHttpRequest){ 
    	xmlhttp = new XMLHttpRequest(); 
	}else if (window.ActiveXObject){ 
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
	  	if (!xmlhttp){ 	
			xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
		} 
  } 
  return xmlhttp; 
}
////////////////// To get art comments //////////////////
function get_comment_art(artid, comment_id)
{
	get_art_comments_http=getHTTPObject();
	
	if(comment_id!=0 && comment_id!="" && comment_id!=null)
	{
		page_url="get_comment_art.php?artid="+artid+"&del="+comment_id;
	}
	else
	{
		page_url="get_comment_art.php?artid="+artid;	
	}
	get_art_comments_http.open("GET",page_url,true);
	get_art_comments_http.onreadystatechange=get_comment_art_result;
	get_art_comments_http.send(null);
}
function get_comment_art_result()
{
	if (get_art_comments_http.readyState==4)
	{ 
		output=get_art_comments_http.responseText;
		ar=output.split('#~|~#');
		document.getElementById('total_comment').innerHTML= ar[0];
		document.getElementById('comment_container').innerHTML= ar[1];
		$('#comment_container').fadeIn("slow");
	}
}
////////////////// To get art comments //////////////////

////////////////// To get artist profile comments //////////////////
function get_comment_artist(artistid, comment_id)
{
	get_artist_comments_http=getHTTPObject();
	
	if(comment_id!=0 && comment_id!="" && comment_id!=null)
	{
		page_url="get_comment_artist.php?artistid="+artistid+"&del="+comment_id;
	}
	else
	{
		page_url="get_comment_artist.php?artistid="+artistid;	
	}
	get_artist_comments_http.open("GET",page_url,true);
	get_artist_comments_http.onreadystatechange=get_comment_artist_result;
	get_artist_comments_http.send(null);
}
function get_comment_artist_result()
{
	if (get_artist_comments_http.readyState==4)
	{ 
		output=get_artist_comments_http.responseText;
		ar=output.split('#~|~#');
		document.getElementById('total_comment').innerHTML= ar[0];
		document.getElementById('comment_container').innerHTML= ar[1];
		$('#comment_container').fadeIn("slow");
	}
}
////////////////// To get art comments //////////////////

////////////////// To get news comments //////////////////
function get_comment_news(news_id, comment_id)
{
	get_news_comments_http=getHTTPObject();
	
	if(comment_id!=0 && comment_id!="" && comment_id!=null)
	{
		page_url="get_comment_news.php?news_id="+news_id+"&del="+comment_id;
	}
	else
	{
		page_url="get_comment_news.php?news_id="+news_id;	
	}
	get_news_comments_http.open("GET",page_url,true);
	get_news_comments_http.onreadystatechange=get_comment_news_result;
	get_news_comments_http.send(null);
}
function get_comment_news_result()
{
	if (get_news_comments_http.readyState==4)
	{ 
		output=get_news_comments_http.responseText;
		ar=output.split('#~|~#');
		document.getElementById('total_comment').innerHTML= ar[0];
		document.getElementById('comment_container').innerHTML= ar[1];
		$('#comment_container').fadeIn("slow");
	}
}
////////////////// To get news comments //////////////////
