// JavaScript Document

	function MM_reloadPage(init) {  //reloads the window if Nav4 resized
	  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
		document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
	  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
	}
	MM_reloadPage(true);
	
    function OpenPopupWindow (sURL,w,h) {
      param="top=20,left=20,width=" + w + ",height=" + h + ",toolbar=no,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no";
  	  hWnd=window.open(sURL,"Hwnd",param);
	  hWnd.focus();
    }

    function OpenWindow (WindowID) {
      if (document.getElementById(WindowID).style.visibility != "visible") { playSound(0); }
	  document.getElementById(WindowID).style.visibility = "visible" ;
    }

    function CloseWindow (WindowID) {
      playSound(0);
	  document.getElementById(WindowID).style.visibility = "hidden" ;
    }

   function ViewLargePhoto (photo,legende) {
     OpenWindow ("ViewLargePhotoWindow");
     if (document.all) {
	   document.images.ViewPhoto.style.filter="blendTrans(duration=0.4)" ;
       document.images.ViewPhoto.filters.blendTrans.Apply() ;
       document.images.ViewPhoto.filters.blendTrans.Play() ;
	 }
     document.images.ViewPhoto.src="/mga/images/galerie/" + photo;
     document.images.ViewPhoto.alt=legende;
	 document.getElementById("TitleID").innerHTML = "# " + legende;
   }

// Gestion de la barre de status---- ----------------------------------------------------------------

   function HideStatus(){
     window.status=''
     return true
   }
    if (document.layers) document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)
    document.onmouseover=HideStatus
    document.onmouseout=HideStatus
	
    function error () { 
	  return true; 
	}
    window.onerror = error;

    var phrase="                                                               ";
    window.status="";
    transi="";
    var i=0;
    function affiche() {
      if(i>phrase.length-1) {
        window.status="";
        transi="";
        i=0;
      } 
	  else {
        transi=transi+phrase.charAt(i);
        window.status=transi;
        i=i+1;
      }
    }
    setInterval("affiche()",100);

// Gestion des fonctions sons bruitages--------------------------------------------------------------

   var aySound = new Array();
   aySound[0] = "/mga/sons/48.au";

   document.write('<BGSOUND id="auIEContainer">')
   IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
   NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
   ver4 = IE||NS? 1:0;
   onload=auPreload;

  function auPreload() {
     if (!ver4) return;
     if (NS) auEmb = new Layer(0,window);
     else {
       Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
       document.body.insertAdjacentHTML("BeforeEnd",Str);
     }
     var Str = '';
     for (i=0;i<aySound.length;i++)
       Str += "<EMBED SRC='"+aySound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>"
     if (IE) auEmb.innerHTML = Str;
     else {
       auEmb.document.open();
       auEmb.document.write(Str);
       auEmb.document.close();
     }
     auCon = IE? document.all.auIEContainer:auEmb;
     auCon.control = auCtrl;
   }

   function auCtrl(whSound,play) {
     if (IE) this.src = play? aySound[whSound]:'';
     else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
   }

   function playSound(whSound) { 
     if (window.auCon) auCon.control(whSound,true);
   }

   function stopSound(whSound) { 
    if (window.auCon) auCon.control(whSound,false);
   }

// -----------------------------------------------------------------------------------------
