/*
Copyright © 2003-2004 JeanneInThePress
http://www.jeanneinthepress.com
Le site non officiel sur la carrière de Jeanne Mas à travers la presse
*/

var cestOk = 0;
var iFirefox = 0;
var iMSIE = 0;
var iNetscape = 0;
var iSafari = 0;

function GetNavigator ()
{
  var indexMSIE = navigator.appVersion.indexOf ("MSIE");
  if (indexMSIE > 0)
  {
    var msieVersion = parseInt (navigator.appVersion.substring (indexMSIE + 5,  indexMSIE + 6));
    if (msieVersion >= 4)
    {
      if (navigator.userAgent.indexOf ("Opera") < 0)
      {
        cestOk = 1;
        iMSIE = 1;
      }
    }
  }
  else if (navigator.userAgent.indexOf ("Firefox") > 0)
  {
    cestOk = 1;
    iFirefox = 1;
  }
  else if (navigator.userAgent.indexOf ("Netscape") > 0)
  {
    cestOk = 0;
    iNetscape = 1;
  }
  else if (navigator.userAgent.indexOf ("Safari") > 0)
  {
    cestOk = 0;
    iSafari = 1;
  }
//  else
//    alert (navigator.userAgent);
//  cestOk = 1;
}


function ShowCopyright ()
{
  var laDate = new Date ();
  var y = laDate.getFullYear ().toString ();
  alert ("Copyright © 2003-" + y + " JeanneInThePress.com sauf D.R.");
  return false;
}


function NoSelection ()
{
  return false;
}


function RemoveImage ()
{
  var urlBase;
  GetNavigator ();
  var urlObj = top.frames["frameAnnee"].document.getElementById ("baseURL");
  if (urlObj != null)
  {
    if (iMSIELocal == 1)
      urlBase = urlObj.value;
    else
      urlBase = urlObj.getAttribute ("value", 2);
  }
  var theFrame = top.frames['framePrincipal'];
  if (typeof (theFrame) != "undefined")
  {
    var theDoc = theFrame.document;
    if (typeof (theDoc) != "undefined")
    {
      var nbImages = theDoc.images.length;
      for (var j = 0; j < nbImages; j ++)
      {
        var theImg = theDoc.images[j];
        if (typeof (theImg) != "undefined")
        {
          theImg.width = 227;
          theImg.height = 85;
          theImg.src = urlBase + 'Commun/images/Copyright.gif';
        }
      }
    }
  }
}

function InitCopyright ()
{
  if (document.location.pathname.indexOf ("CreationNewsletter.php") == -1)
  {
    document.onselectstart = NoSelection
    document.oncontextmenu = ShowCopyright
    window.onbeforeprint   = RemoveImage
    var theFrame = top.frames['framePrincipal'];
    if (typeof (theFrame) != "undefined")
    {
      var theDoc = theFrame.document;
      if (typeof (theDoc) != "undefined")
      {
        theDoc.onselectstart = NoSelection
        theDoc.oncontextmenu = ShowCopyright
      }
    }
  }
}

InitCopyright ();

