function video_comment_pagination(strURL,strParameter,handler,handler_flg)
{
	if(document.getElementById("post_comment"))
		document.getElementById("post_comment").value = 'N';
	if(document.getElementById("comment_div1"))
		document.getElementById("comment_div1").innerHTML = "";
	xmlhttpPost_makerequest(strURL,strParameter,handler,handler_flg);
}

function delete_video_comment(strURL,strParameter,handler,handler_flg)
{
	if(document.getElementById("post_comment"))	
		document.getElementById("post_comment").value = 'N';
	if(document.getElementById("comment_div1"))
		document.getElementById("comment_div1").innerHTML = "";
	if(confirm("Are you sure you want to delete this video comment? "))
	{
		xmlhttpPost_makerequest(strURL,strParameter,handler,handler_flg);
	}
}

function report_abuse_video_comment(strURL,strParameter,handler,handler_flg)
{
	xmlhttpPost_makerequest(strURL,strParameter,handler,handler_flg);
}

function post_video_comments(strURL,strParameter,handler,handler_flg)
{
	var comments = document.getElementById("video_comment").value;
	if(trimAll(comments) == "")
	{
		alert("Please post your comment");
		return false;
	}
//	strParameter += "&comments="+encodeURIComponent(comments);
	strParameter += "&comments="+escape(comments);
	handler = "handlerdivInsertVideoComment('"+ handler + "')";
	xmlhttpPost_makerequest(strURL,strParameter,handler,handler_flg);
}
function handlerdivInsertVideoComment(handler) 
{
	if(xmlHttpReq.readyState == 4) 
	{
		if(xmlHttpReq.status == 200)
		{
				if(xmlHttpReq.responseText.indexOf("<!--error_login-->") == 0)
				{
					document.getElementById(handler+1).innerHTML = xmlHttpReq.responseText;
					window.setTimeout("getLogin('#post_comment')",2000);
				}
				else if(xmlHttpReq.responseText.indexOf("<!--error-->") == 0)
				{
					document.getElementById(handler+1).innerHTML = xmlHttpReq.responseText;
				}
				else
				{
					
					var str_response = xmlHttpReq.responseText;
					var pos = 0;
					pos = str_response.lastIndexOf("<!---->");
					if(pos != -1)
					{
						document.getElementById (handler).innerHTML = str_response.substring(0,pos-1);
						//document.getElementById (divTag+"1").innerHTML = str_response.substring(pos+7,str_response.length-3);
						
						document.getElementById(handler+1).innerHTML = str_response.substring(pos+7,str_response.length-3);
						
						//Quill.clearText('quillDiv1');
					}
					else
					{
						
						document.getElementById (handler).innerHTML = str_response;
						document.getElementById(handler+1).innerHTML = "";
						
					}
					document.getElementById("video_comment").value = "";
					
				}
				
				
					document.getElementById("remLen").value = 500;

		}
		else
		{
			alert("Error: While trying to fetch records, please try again later");
		}
	}
	else
	{
		document.getElementById(handler+1).innerHTML = "<span id=\"\" valign=\"middle\" align=\"center\"><img src=\"/zones-ssi/js-css-images/adding-comment.gif\" border=\"0\" alt=\"Adding Comment...\"></span>";
	}
}

function textVideoCommentCounter(field,cntfield,maxlimit) 
{
	if (field.value.length > maxlimit)
	{
		field.value = field.value.substring(0, maxlimit);
		cntfield.value = 0;
		alert ('You cannot enter more than '+maxlimit+' characters.');
	}
	else
	{
		cntfield.value = maxlimit - field.value.length;
	}
}