// JavaScript Document
function GrandePhoto(titre,photo,W,H) {
  myWin=open("","newin","width="+W+",height="+H+",resizable=1,scrollbars=0,status=0");
  myWin.document.open();
  if (myWin.blur) myWin.focus();
  myWin.resizeTo(W+8,H+56);
  myWin.document.write('<html><head><title>'+titre+'</title></head><body BGCOLOR="#ffffff" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">');
  myWin.document.write('<table border="0" cellspacing="0" cellpadding="0"><tr><td>');
  myWin.document.write('<a href="javascript:window.close();" alt="Cliquez pour fermer">');  
  myWin.document.write('<img src="'+photo+'" width="'+W+'" height="'+H+'" border="0" />');
  myWin.document.write('</a>');
  myWin.document.write("</table></tr></td>");
  myWin.document.write("</body></html>");
  myWin.document.close();  
}

function Doc () {
	alert('Cliquez sur le bouton ENREGISTRER dans la fenêtre suivante');
	var lien = "dossier_pdf.php";
	var window2=window.open(lien,"Doc",'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=550,height=210,top=0,left=0');
}

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_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_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];}
}

/*SPLASH*/
window.addEvent('domready', function() {
  var  splash = new SplashScreen('splash',{'delay':'10000','showOnce':true});
  document.id('btCloseSplash').addEvent('click',function(){
    splash.closeSplash();
  });
});

var SplashScreen = new Class({
  Implements: Options,
  options: {
    'delay':5000 ,
    'showOnce':false
  },
  initialize: function(element, options){
    this.setOptions(options);
    this.splash=document.id(element);
    if(this.options.showOnce){
      // check cookie to see if splash has been shown in this session
      var splashCookie = Cookie.read('showSplashCookie') || 'yes';
      if(splashCookie=='yes'){
        this.showSplash();
        Cookie.write('showSplashCookie', 'no');
      }
    }else{
      this.showSplash();
    }
  },
  showSplash:function(){
    this.splash.setStyles({
      'height':window.getScrollHeight(),
      'display':'block',
	  'opacity':'1'
    });
    // iframe for ie6 <Bah! Humbug!>
    if(Browser.Engine.trident4){
      var iframe2 = new Element('iframe',{
        styles:{'position':'absolute','width':'120%','height':'120%','top':'-10%','left':'-10%'},
    height:'100%',
    width:'100%',
        frameborder:0
      }).setOpacity(0).inject(this.splash,'top');
    }
    this.closeSplash.delay(this.options.delay, this);
  },
  closeSplash: function(){
    this.splash.fade('out');
  }
});
