function addClipatComment(){
 _("loading").style.display = 'none'; 
 _("errorMsg").style.display = 'none'; 
   document.getElementById("comment_text").value = trim(document.getElementById("comment_text").value);	
 if(_l("comment_text") == 0 ){
 _("errorMsg").style.display = 'block'; 
_("comment_text").focus();
  return;
}
// replace special characters like '&' ...
strComments = _("comment_text").value ;
for (i=0;i<strComments.length;i++){
	strComments = handleText(strComments);
}
document.getElementById("btn").disabled = true ;	
document.getElementById("comment_text").disabled = true ;
AJAXGet(domainName+"request/addClipatComments.php?clipId="+_("clipId").value+"&m5="+_("m5").value+"&comment="+strComments+"&by="+_("comment_by").value,commentHandler,false,true);

}
function commentHandler(sText){
 if(sText == 1){
 	viewComment(sText)
 }else{
  alert(sText);
 }
}
function viewComment(sText){
 _("comment_text").value    = '';
 _("errorMsg").style.display = 'none'; 
 _("loading").style.display = 'block';
 	document.getElementById("btn").disabled = false ;
 	document.getElementById("comment_text").disabled = false ;
}
function removeClip(clipatId,videoId,groupId,data){
	if(confirm('هل انت متأكد من انك تريد حذف هذا الكليب')){
		//alert('1');
		window.location  ='deleteClip.htm?clipId='+clipatId+'&vedioId='+videoId+'&groupId='+groupId+'&data='+data;
	}
}
function getClipComments (clipId,pn,groupId,as7ab){
	AJAXGet(domainName+"request/getClipComments.php?clipId="+clipId+"&pn="+pn+"&groupId="+groupId+"&from=groups&as7abId="+as7ab,commentHandlerView,false,true);
}
function commentHandlerView(sText){
	_("response").style.display = 'none';
	_("commentDiv").innerHTML = sText ;
}
