var httpcon=GetXmlHttpObject();
var httpcon_cnt=GetXmlHttpObject();
function favorites_video(vid)
{
		var videoid=vid;
				
	 	//alert($star_rate);
	if(vid)
	{
		var newPage = "../ajax/favorites_video.php?videoid="+videoid;
				//alert(newPage);
				//return false;
		        var obj = document.getElementById("viewresult");
				httpcon.open("GET", newPage);
				httpcon.onreadystatechange = function() 
				{
					//alert(1);
					
					//alert(httpcon.status);
					if (httpcon.readyState == 4 && httpcon.status == 200) 
					{
						//alert(httpcon.responseText);
						
					obj.innerHTML = httpcon.responseText;
					
						
					}
				}
				httpcon.send(null);
				
			  return false;
			}
}

function add_comment(video_id)
{
		var vid=video_id;	
	 	var comm=document.getElementById("txt_comment").value;
	if(vid)
	{
		var newPage = "../ajax/comment_video.php?videoid="+vid+"&comment="+comm+"&flg=add";
				//alert(newPage);
				//return false;
		        var obj = document.getElementById("result_comment");
				httpcon.open("GET", newPage);
				httpcon.onreadystatechange = function() 
				{
					//alert(1);
					
					//alert(httpcon.status);
					if (httpcon.readyState == 4 && httpcon.status == 200) 
					{
						//alert(httpcon.responseText);
						 	
					  obj.innerHTML = httpcon.responseText;
					  document.getElementById('old_comment').style.display="none";
					
						
					}
				}
				httpcon.send(null);
				
			  return false;
			}
}

function view_comment(video_id)
{
		
		var vid=video_id;
				
	 	var comm=document.getElementById("txt_comment").value;
	if(vid)
	{
		var newPage = "../ajax/comment_video.php?videoid="+vid+"&comment="+comm+"&flg=view";
				//alert(newPage);
				//return false;
		        var obj = document.getElementById("result_comment");
				httpcon.open("GET", newPage);
				httpcon.onreadystatechange = function() 
				{
					//alert(1);
					
					//alert(httpcon.status);
					if (httpcon.readyState == 4 && httpcon.status == 200) 
					{
						//alert(httpcon.responseText);
						 	
					obj.innerHTML = httpcon.responseText;
					
						
					}
				}
				httpcon.send(null);
				
			  return false;
			}
}

function rateuser(user,point,ratevid)
{
		var user=user;
		var point=point;
		var ratevid=ratevid;
		//val='user='+user+'&point='+point+'&rate='ratevid;
		//alert(val);
		var newPage1='../video/video_rate.php?user='+user+'&point='+point+'&ratevid='+ratevid;
		 var obj = document.getElementById("viewresult1"); 
		  httpcon.open("GET", newPage1);
				httpcon.onreadystatechange = function() 
				{
					//alert(1);
					
					//alert(httpcon.status);
					if (httpcon.readyState == 4 && httpcon.status == 200) 
					{
						//alert(httpcon.responseText);
						 	
					obj.innerHTML = httpcon.responseText;
					
						
					}
				}
				httpcon.send(null);
				
			 
}

