/* Preload la favicon */
favicon=new Image();
favicon.src='firework.ico';

/* Blocage du clic droit */
if(window.Event) document.captureEvents(Event.MOUSEUP);
function nocontextmenu() {
 event.cancelBubble=true
 event.returnValue=false;
 return false;
}
function norightclick(e) {
 if(window.Event) {
  if(e.which==2||e.which==3) return false;
 }else if(event.button==2||event.button==3) {
  event.cancelBubble=true
  event.returnValue=false;
  return false;
 }
}
function keypressed() {
 window.external.AddFavorite("http://www.french-firework.com","French-Firework ...\\|/...");
}
document.oncontextmenu=nocontextmenu;
document.onmousedown=norightclick;
//document.onkeydown=keypressed;


/* Fonctions Macromedia */
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/* Fonction pour l'affichage de la window.status */
function InfoDate() {
  self.status=' ';
  var now=new Date();
  var valMes=0;
  var heure=now.getHours();
  var minutes=now.getMinutes();
  var secondes=now.getSeconds();
  var valEff=0;
  valEff=((now.getSeconds()/10)-Math.floor(now.getSeconds()/10))*10;
  valEff=Math.floor(valEff);
  if (minutes < 10) minutes="0"+minutes;
  if (secondes < 10) secondes="0"+secondes;
  var tabJour = new Array('dimanche','lundi','mardi','mercredi','jeudi','vendredi','samedi');
  var tabMois = new Array("janvier","fevrier","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","decembre");
  var tabMes  = new Array();
  tabMes[0] = "Il est tard passé, faut dormir...";
  tabMes[1] = "c'est le matin, bonne journée";
  tabMes[2] = "midi, il fait faim...";
  tabMes[3] = "c'est l'après-midi, BIEN !";
  tabMes[4] = "la nuit ça surfe...";
  var tabEff = new Array();
  tabEff[0] = " "+" "+" ...\\|/... "+" "+" ";
  tabEff[1] = " "+" "+" ...\\|/... "+" "+" ";
  tabEff[2] = " "+" "+" "+" ..\\|/.. "+" "+" "+" ";
  tabEff[3] = " "+" "+" "+" "+" .\\|/. "+" "+" "+" "+" ";
  tabEff[4] = " "+" "+" "+" "+" "+" \\|/ "+" "+" "+" "+" "+" ";
  tabEff[5] = " "+" "+" "+" "+" `\\|/´ "+" "+" "+" "+" ";
  tabEff[6] = " "+" "+" ¯`\\|/´¯ "+" "+" ";
  tabEff[7] = " "+" ´¯`\\|/´¯` "+" ";
  tabEff[8] = " ·´¯`\\|/´¯`· ";
  tabEff[9] = ".·´¯`\\|/´¯`·.";
  if((heure>=0)&&(heure<=6)){ValMes=0;}
  else if ((heure>=7)&&(heure<12)){ValMes=1;}
  else if (heure==12){ValMes=2;}
  else if ((heure>12)&&(heure<19)){ValMes=3;}
  else ValMes=4;
  window.status=(tabEff[valEff]+" "+heure+":"+minutes+":"+secondes+",  le "+tabJour[now.getDay()]+" "+
   now.getDate()+" "+tabMois[now.getMonth()]+" "+now.getFullYear()+",  "+tabMes[ValMes]+" "+tabEff[valEff]);
  setTimeout("InfoDate();",1000);
}

/* Fonction pour l'affichage de popup */
function Popup(adrpop,nompop){
  sw = Math.round(screen.width/6);
  sh = Math.round(screen.height/6);
  pop = window.open(adrpop,nompop,'location=0,directories=0,status=0,scrollbars=1,resizable=1,height='+4*sh+',width='+4*sw+',screenX='+sw+',left='+sw+',screenY='+sh+',top='+sh+',toolbar=0');
}

/* Jouer de la musique */
function music(fichier_son,racine) {
  var repetition,visibility,depart,fichier_son;
  fichier_son = racine + "/support/" + fichier_son;
  repetition = "0"; 
  cache_panneau = "true"; 
  depart = "true"; 
  document.write('<EMBED SRC="' + fichier_son +'" hidden=' + cache_panneau + ' autostart=' + depart + ' loop=' + repetition +'>');
}