// Marque page et favoris
function bookmarksite(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}
// Alternative valide W3C _blank
function lien(monLien) {
window.open(monLien, '_blank');
return false;
}
// Plan
function depli(idBloc)
{
  obj = document.getElementById(idBloc);
  obj.style.display = obj.style.display==''?'none':'';
  return false;
}


//******************************************************************************
var xhr_object = null;
var lastobj = null;

function getNextCallback()
{
  if ((xhr_object.readyState == 4))
  {
    //showVote(null, '', '', false);
    document.body.style.cursor = 'default';
    texte = xhr_object.responseText.split('#');
    if (texte[0] == '')
    {
      document.getElementById('tnote').innerHTML = texte[2];
      alert('Votre note a bien été prise en compte');
    }
    else
      alert(texte[0]);
  }
}

//******************************************************************************
function appelAjax(obj, url)
{
  if (xhr_object == null)
    if(window.XMLHttpRequest)
      xhr_object = new XMLHttpRequest();
    else if(window.ActiveXObject)
      xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
    else
      return true;

  xhr_object.open("GET", url, true);
  xhr_object.onreadystatechange = getNextCallback;
  xhr_object.send(null);

  document.body.style.cursor = 'wait';
  return false;
}

//******************************************************************************
function NoteVideo(idVideo, note)
{
  appelAjax(null, 'ajax_note.php?idVideo=' + idVideo + '&note=' + note);
  return true;
}