if(navigator.appName == "Microsoft Internet Explorer"){
	var comment = new ActiveXObject("Microsoft.XMLHTTP");
}else{
	var comment = new XMLHttpRequest();
}
function loading() {
		

}

function commentpage(PageName,PageNum)
{
	document.getElementById('comments').style.display  = 'none';
	document.getElementById('waitcomment').style.display  = 'block';
	comment.open('get', 'comment.php?id='+PageName+'&page='+PageNum, true);
    comment.onreadystatechange = commenthandleResponse;
    comment.send(null);
}
function sendcomment(PageName)
{
	document.getElementById('comments').style.display  = 'none';
	document.getElementById('waitcomment').style.display  = 'block';
	comment.open('get', 'sendcomment.php?id='+PageName, true);
    comment.onreadystatechange = commenthandleResponse;
    comment.send(null);
}
function docomment()
{
	var name = document.getElementById('name');
	var email = document.getElementById('email');
	var videoid = document.getElementById('videoid');
	var text = document.getElementById('text');
	var url="dosendcomment.php?"
	document.getElementById('comments').style.display  = 'none';
	document.getElementById('waitcomment').style.display  = 'block';
	comment.open("POST",url,true)
	comment.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=windows-1256');
	param="name="+encodeURIComponent(name.value)
	param=param+"&email="+encodeURIComponent(email.value)
	param=param+"&videoid="+encodeURIComponent(videoid.value)
	param=param+"&text="+text.value
	comment.onreadystatechange = commenthandleResponse;	
	comment.send(param) 
}

function commenthandleResponse() {
    if(comment.readyState == 4){
        
		document.getElementById('comments').innerHTML = comment.responseText;
		document.getElementById('waitcomment').style.display  = 'none';
		document.getElementById('comments').style.display  = 'block';
    }
}
