
//////////adding new comment-start//////////////////////////////////
function addcommentdisp(id)
{

document.getElementById('commenttxt').value="";
document.getElementById('commentdiv'+id).style.visibility='visible';
}
///////////////adding new comment-end////////////////////////////////

////////////////invoked when  send button is clicked in adding new comment-start/////////////////////////////
function showdesc(pid)
{
cid=pid;
//alert(cid);
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Your browser does not support XMLHTTP!");
  return;
  }
txt=document.getElementById('commenttxt'+cid);
doc=document.getElementById('commentdoc'+cid);
vid=document.getElementById('commentvideo'+cid);
patientid=document.getElementById('patientid');
//alert(patientid);
patientid=patientid.value;
txt=txt.value;
doc=doc.value;
vid=vid.value;
var url="xml_show_comment.php?txt="+txt+"&doc="+doc+"&vid="+vid+"&pid="+cid+"&patientid="+patientid;
alert(url);
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
function stateChanged()
{
if (xmlhttp.readyState==4)
  {
  document.getElementById('commentdiv').style.visibility='hidden';
  document.getElementById("comment_disp").innerHTML=xmlhttp.responseText;
  }
}
////////////////invoked when  send button is clicked in adding new comment-end/////////////////////////////


















///////////////////invoked when reply button is clicked-start//////////////////////
function addtxt(cid,pid)
{
    //alert("Rajasekar");
sid=cid;
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Your browser does not support XMLHTTP!");
  return;
  }

var url="xml_comment_reply.php?cid="+cid+"&pid="+pid;
//alert(url);
xmlhttp.onreadystatechange=stateChanged1;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
function stateChanged1()
{
if (xmlhttp.readyState==4)
  {
   // alert(sid);
  document.getElementById("replybox"+sid).style.display="block";
  document.getElementById("replybox"+sid).innerHTML=xmlhttp.responseText;
  }
}
///////////////////invoked when reply button is clicked-end//////////////////////

/////////////////////////////
 function validatecomment(cid)
{
    //alert("Rajasekar");
    //alert(thisForm);
    //alert(thisForm.document.getElementById("commenttxt").value);
   //alert("id->"+id);
   
    if(document.getElementById("commenttxt"+cid).value=="")
	{
		alert("Please Enter Comment");
		//document.getElementById("afname").focus();
		//document.getElementById("commenttxt"+id).className='error';
		//document.getElementById("err_commenttxt"+id).style.visibility='visible';
		//document.getElementById("err_commenttxt"+id).innerHTML='<img src=images/wa.png> Enter Your Comment';
		return false;
	}
	else
	{
		//document.getElementById("commenttxt"+id).className='success';
		//document.getElementById("err_commenttxt"+id).style.visibility='hidden';
        return true;
	}
    
}
function closepost(id)
{
    document.getElementById("replybox"+sid).style.display="none";
    document.getElementById("replybox"+sid).innerHTML="";
}

