// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;

function clickIE() {
  if (document.all) return false;
}

function clickNS(e)
{
if (document.layers||(document.getElementById&&!document.all))
  {
    if (e.which==2||e.which==3) return false;
  }
}

// Blocking context menu.
function onloadActions()
{

  if (document.layers) 
  {
    document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;
  }
  else
  {
    document.onmouseup=clickNS;document.oncontextmenu=clickIE;
  }

  document.body.oncontextmenu = function(){return false;}
}

registerOnLoadFunction(onloadActions);

function favoris()
{
    if ( navigator.appName != 'Microsoft Internet Explorer' )
    {
      window.sidebar.addPanel("Besoin de Savoir","http://www.besoindesavoir.com","");
    }
    else
    {
      window.external.AddFavorite("http://www.besoindesavoir.com","Besoin de Savoir");
    }
}

function positionnerFormulaire()
{
  document.getElementById('boutiqueAjax').style.top = document.documentElement.scrollTop + (document.documentElement.clientHeight/2) - 50 + "px";
  document.getElementById('boutiqueAjax').style.display = 'block';
  document.getElementById('toute_la_page').style.opacity = 0.5;
  document.getElementById('conteneur').style.filter = "Alpha(opacity=60)";
}

function focusOnPage()
{
  document.getElementById('boutiqueAjax').style.display = 'none';
  document.getElementById('toute_la_page').style.opacity = 1;
  document.getElementById('conteneur').style.filter = "Alpha(opacity=100)";
}

function openPopup(url)
{
  window.open(url,'popup','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=520, height=600, screenX=150, screenY=150, top=100, left=100');
}


function afficheIFrame(div, url)
{
  document.body.style.overflow = "hidden";
  document.getElementById(div).setAttribute("src", url);

  document.getElementById(div).style.display     = 'block';
  document.getElementById(div).style.visibility  = 'visible';

/*
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' )
  {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  }
  else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
  {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  }
  else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
  {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }


  document.getElementById(div).style.height      = myHeight +  'px';
  document.getElementById(div).style.width       = myWidth + 'px';

  document.getElementById(div).setAttribute("src", url);

  document.getElementById(div).style.display     = 'block';
  document.getElementById(div).style.visibility  = 'visible';
*/
}

function cacheIFrame(div)
{
        document.getElementById(div).setAttribute("src", "/white.html");
        document.getElementById(div).style.display     = 'none';
        document.getElementById(div).style.visibility  = 'hiden';
        document.body.style.overflow = "visible";
}


