// FONCTION POUR AFFICHER LA DIV MESSAGE ET LUI ASSIGNER UN MESSAGE
function show_message(id,message)
	{
	//document.getElementById(id).style.visibility='visible';
	document.getElementById(id+'_p').innerHTML = message;
	$("#div_message").fadeIn("slow");
	}
	
function hide_message(id)
	{
	$("#div_message").fadeOut("slow");
	}
///////////////////////////////////////	

// pour afficher les infos / commentaires d'une video
function get_video_txt(id_video,type){
	if(type == 'infos')
		{ 
		var page_php = "get-video-infos.php"; 
		if(document.getElementById("main_video_infos"))
			{ document.getElementById("main_video_infos").style.backgroundPosition = 'top'; }
		if(document.getElementById("nb_comment"))
			{ document.getElementById("nb_comment").className = 'nb_comment_white'; }
		}
	else
		{ 
		var page_php = "get-video-comments.php"; 
		if(document.getElementById("main_video_infos"))
			{ document.getElementById("main_video_infos").style.backgroundPosition = 'bottom'; }
		if(document.getElementById("nb_comment"))
			{ document.getElementById("nb_comment").className = 'nb_comment'; }
		}
		
	var xhr_object = null; 

	   
	   if(window.XMLHttpRequest) // Firefox 
	      xhr_object = new XMLHttpRequest(); 
   else if(window.ActiveXObject) // Internet Explorer 
	      xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
	   else { // XMLHttpRequest non supporté par le navigateur 
	      alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
	      return; 
		  }

	 
	   xhr_object.open("POST", page_php, true); 
	     
	   xhr_object.onreadystatechange = function() { 
	      if(xhr_object.readyState == 4) 
			 { document.getElementById("main_video_content").innerHTML = xhr_object.responseText;
			if(type == 'infos')
				{ 
				// remet les étoiles
				$(function(){ // wait for document to load 
					$('input.wow').rating(); 
					});
				}
			else
				{
				pagination_generique('first',1,id_video,'','','comments-refresh.php');	
				}
			 }
	   } 
	 
	   xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); 
	   var data = "id_video="+id_video; 
	   xhr_object.send(data);
	} 
/////////////////////////////////////////////////////////////////////

// pour ouvrir manuellement  une nyromodal
function ouvrir_nyromodal(my_url)
	{
	//alert(my_url);
	$.nyroModalManual({
	             url : my_url
	       });
		return false;
	}