function doAction(login_status)
{
	if(login_status==1)
	{
		document.getElementById("share_link").style.display = "none";
		document.getElementById("share_comments").style.display = "block";
	}
	else
	{
		alert('You need to login to post your comments');
	}
}
//------------------------------------------------------------------------------------------------------
function doCancel()
{
	document.getElementById("share_link").style.display = "block";
	document.getElementById("share_comments").style.display = "none";
}
//------------------------------------------------------------------------------------------------------
function getConnection(sendUrl,frm,article,userid,flag)
{
	article = URLencode(article);

	if(flag == "1")
		comment = URLencode(frm.comments.value);
	else
		comment = "";

	if (window.ActiveXObject) 
	{
		HttpSendRating = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else 
	{
		HttpSendRating = new XMLHttpRequest;
	}
	fields = "article="+article+"&comment="+comment+"&userid="+userid+"&flag="+flag;

	SendMyRatingUrl = encodeURI(sendUrl+"/inc_pillowtalk.php");
	HttpSendRating.open("POST", SendMyRatingUrl, true);
	HttpSendRating.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	HttpSendRating.onreadystatechange = setComments;
	HttpSendRating.send(fields);
}
//------------------------------------------------------------------------------------------------------
function URLencode(sStr) {
   return escape(sStr).replace(/\+/g, '%2B').replace(/\"/g,'%22').replace(/\'/g, '%27').replace(/\//g,'%2F');
}
//------------------------------------------------------------------------------------------------------
function setComments() {
		
	var article;
	if (HttpSendRating.readyState == 4)
	{
		var response;
		response=HttpSendRating.responseText;

		document.pillowTalkForm.comments.value="";
		document.getElementById("show_comment").innerHTML = response;
		document.getElementById("share_link").style.display = "block";
		document.getElementById("share_comments").style.display = "none";
		document.getElementById("hide_comment").style.display = "none";
	}

  }
  //------------------------------------------------------------------------------------------------------