// copyright.js

// Get navigator name
function lib_bwcheck(){ //Browsercheck (needed)  
    this.ver=navigator.appVersion  
    this.agent=navigator.userAgent  
    this.dom=document.getElementById?1:0  
    this.opera5=this.agent.indexOf("Opera 5")>-1  
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;  
    this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;  
    this.ie4=(document.all && !this.dom && !this.opera5)?1:0;  
    this.ie=this.ie4||this.ie5||this.ie6  
    this.mac=this.agent.indexOf("Mac")>-1  
    this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;  
    this.ns4=(document.layers && !this.dom)?1:0;  
    this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)  
    return this  
}  
var bw=new lib_bwcheck() 

// Disable right mouse click

var message="Toute reproduction non autorisée de ce document est interdite !";
function noclick(e) {
  if (document.all) {
    if (event.button==2) {
      alert(message);
      return false;
    }
  }
  else if (document.layers||document.getElementById) {
    if (e.which==3) {
      window.onmouseup=noup;
      alert(message);
      return false;
    }
  }
}

function noup(e) {  /* Required for Netscape 6 */
  return false;
}

if (document.layers) {  /* Required for Netscape 4 */
  document.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
}

document.onmousedown=noclick;

// Set cookie to the current page URL and Title

dateExp = new Date(2020,11,11);
dateExp = dateExp.toGMTString();

function PageLoad() {
  PageURL = escape(document.URL);
  PageTitle = escape(document.title);
  PageDomain = document.domain;
  PageLastDate = document.lastModified;
  tmpdom = PageDomain.toLowerCase();
  place = tmpdom.indexOf("www.",0);
  if (place <= -1) {
    PageDomain = tmpdom;
  }
  else {
    endc = tmpdom.indexOf(".",place);
    if (endc <= -1) {
      PageDomain = tmpdom;
    }
    else {
      PageDomain = tmpdom.substring(place+4,tmpdom.length);
    }
  }
  PagePath = "/";
  document.cookie = 'visitURL=' + PageURL + '; expires=' + dateExp + '; path=' + PagePath +'; domain=' + PageDomain + ';';
  document.cookie = 'visititle=' + PageTitle + '; expires=' + dateExp + ' path=' + PagePath +'; domain=' + PageDomain + ';';
  document.cookie = 'visitddate=' + PageLastDate + '; expires=' + dateExp + ' path=' + PagePath +'; domain=' + PageDomain + ';';
}

// Popup a new window

function popup(name,width,height) {
  var options = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width="+width+",height="+height;
  Cal2=window.open(name,"popup",options);
}
