var xmlHttpComment

var boxName;
var divId;

function getCommentValue(news_id)
{
var val1, val2;

divId = news_id;
boxName = news_id+'_comment_box';

var author_id= news_id + "_comment_author";
var comment= news_id + "_comment";

val1 = document.getElementById(author_id).value;
val2 = document.getElementById(comment).value;

//document.write(val2);
//document.getElementById(news_id).innerHTML=val1;
putComment(news_id,val1,val2);
}

function putComment(news_id,comment_author,comment)
{	
xmlHttpComment=GetXmlHttpObjectComment()
if (xmlHttpComment==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
var url="_pages/_home/_code/putComment.php"
url=url+"?news_id="+news_id
url=url+"&comment_author="+comment_author
url=url+"&comment="+comment
url=url+"&sid="+Math.random()
xmlHttpComment.onreadystatechange=stateCommentChanged 
xmlHttpComment.open("GET",url,true)
xmlHttpComment.send(null)
} 


function stateCommentChanged() 
{ 
 if (xmlHttpComment.readyState==4 || xmlHttpComment.readyState=="complete")
 { 
 document.getElementById(boxName).
 innerHTML=xmlHttpComment.responseText;
   var reactBox=divId+'9999';
	 var commentBox=divId+'8888';
	 //document.write(reactBox);
  var o = document.getElementById(reactBox);
  if (o){
	NewSetupHide(commentBox)
	toggleHide(reactBox);

	}
 } 

} 

function GetXmlHttpObjectComment()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
 {
 objXMLHttp=new XMLHttpRequest()
 }
else if (window.ActiveXObject)
 {
 objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
 }
return objXMLHttp
}

//------------------------------------------------------------------------------------------------
