
var DHTML = (document.getElementById || document.all || document.layers);
var crossFadeDuration = 1; /* Duration of crossfade (seconds) */


var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

if (checkIt('konqueror'))
{
      browser = "Konqueror";
      OS = "Linux";
}
else if (checkIt('safari')) browser = "Safari"
else if (checkIt('omniweb')) browser = "OmniWeb"
else if (checkIt('opera')) browser = "Opera"
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab"
else if (checkIt('msie')) browser = "msie"
else if (!checkIt('compatible'))
{
      browser = "Netscape Navigator"
      version = detect.charAt(8);
}
else browser = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);

if (!OS)
{
      if (checkIt('linux')) OS = "Linux";
      else if (checkIt('x11')) OS = "Unix";
      else if (checkIt('mac')) OS = "Mac"
      else if (checkIt('win')) OS = "Windows"
      else OS = "an unknown operating system";
}

function checkIt(string)
{
      place = detect.indexOf(string) + 1;
      thestring = string;
      return place;
}





var bWin32IE;
if ((browser=="msie") && (navigator.platform == "Win32")) {
     bWin32IE = true;
} else {
     bWin32IE = false;
}

var playstatus=true;

function startplay(){
   if (bWin32IE == true) {
      auctrl.CurrentPosition = 0;
       auctrl.play();
   } else {
      document.auctrl.Play();   
   }
}

function stopplay(){
   if (bWin32IE == true) {
      auctrl.stop();
   } else {
      document.auctrl.Stop();
   }
}

function swapaudio() {
   if (playstatus == true) {
       window.document.images["aucontrol"].src= "start.gif";
       stopplay();
       playstatus=false;
   }
   else {
       window.document.images["aucontrol"].src= "stop.gif";
       startplay();
       playstatus=true;
   }
   
}



var ns = (navigator.appName.indexOf("Netscape") != -1);
var doc = document;
var px = document.layers ? "" : "px";

function floatDiv(id, sx, sy)
{
	var el=doc.getElementById?doc.getElementById(id):doc.all?doc.all[id]:doc.layers[id];
	window[id + "_obj"] = el;
	if(doc.layers)el.style=el;
	el.cx = el.sx = sx;el.cy = el.sy = sy;
	el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px;};
	el.flt=function()
	{
		var pX, pY;
		pX = (this.sx >= 0) ? 0 : ns ? innerWidth : 
		document.documentElement && document.documentElement.clientWidth ? 
		document.documentElement.clientWidth : document.body.clientWidth;
		pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? 
		document.documentElement.scrollTop : document.body.scrollTop;
		if(this.sy<0) 
		pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ? 
		document.documentElement.clientHeight : document.body.clientHeight;
		this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8;
		this.sP(this.cx, this.cy);
		setTimeout(this.id + "_obj.flt()", 40);
	}
	return el;
}

function d(texte)
	{
	document.write(texte);
	}



function ejs_scroll_start()
	{
	if(ejs_scroll_mode == 1)
		{
		ejs_scroller_haut = "ejs_scroller_1";
		ejs_scroller_bas = "ejs_scroller_2";
		ejs_scroll_mode = 0;
		}
	else
		{
		ejs_scroller_bas = "ejs_scroller_1";
		ejs_scroller_haut = "ejs_scroller_2";
		ejs_scroll_mode = 1;
		}
	ejs_scroll_nb_message = ejs_scroll_message.length-1;
	if(ejs_scroll_actuel == ejs_scroll_nb_message)
		ejs_scroll_suivant = 0;
	else
		ejs_scroll_suivant = ejs_scroll_actuel+1;
	if(document.getElementById)
		document.getElementById(ejs_scroller_bas).innerHTML = ejs_scroll_message[ejs_scroll_suivant];
	ejs_scroll_top = 0;
	if(document.getElementById)
		setTimeout("ejs_scroll_action()",ejs_scroll_pause_seconde*1000)
	}

function ejs_scroll_action()
	{
	ejs_scroll_top -= 1;
	document.getElementById(ejs_scroller_haut).style.top = ejs_scroll_top;
	document.getElementById(ejs_scroller_bas).style.top = ejs_scroll_top+ejs_scroll_hauteur;
	if((ejs_scroll_top+ejs_scroll_hauteur) > 0)
		setTimeout("ejs_scroll_action()",10)
	else
		ejs_scroll_stop()
	}

function ejs_scroll_stop()
	{
	ejs_scroll_actuel = ejs_scroll_suivant;
	ejs_scroll_start()
	}




var posT =0;
var posL =0;
var active_note = -1;

var menu_note_dyn= new Array();
var menu_note_stat= new Array();
var menu_livre_dyn= new Array();
var menu_livre_stat= new Array();
var clear_timer = null;
var clearinterv = 1000;
var img_timer = null;
var imginterv = 1000;
var move_timer = null;
var moveinterv = 500;
var div_timer = null;
var divinterv = 100;


menu_note_stat[1]="note1-off.gif";
menu_note_stat[2]="note2-off.gif";
menu_note_stat[3]="note3-off.gif";
menu_note_stat[4]="note4-off.gif";
menu_note_stat[5]="note5-off.gif";
menu_note_stat[6]="note6-off.gif";
menu_note_stat[7]="note7-off.gif";
menu_note_stat[8]="note8-off.gif";
menu_note_stat[9]="note9-off.gif";
menu_note_stat[10]="note10-off.gif";

menu_livre_dyn[0]="contact.gif";
menu_livre_stat[0]="contact-stat.gif";
menu_livre_dyn[1]="extraits.gif";
menu_livre_stat[1]="extraits-stat.gif";


preLoadNote = new Array();
preLoadNote[1] = new Image();
preLoadNote[1].src = "note1-on.gif";
preLoadNote[2] = new Image();
preLoadNote[2].src = "note2-on.gif";
preLoadNote[3] = new Image();
preLoadNote[3].src = "note3-on.gif";
preLoadNote[4] = new Image();
preLoadNote[4].src = "note4-on.gif";
preLoadNote[5] = new Image();
preLoadNote[5].src = "note5-on.gif";
preLoadNote[6] = new Image();
preLoadNote[6].src = "note6-on.gif";
preLoadNote[7] = new Image();
preLoadNote[7].src = "note7-on.gif";
preLoadNote[8] = new Image();
preLoadNote[8].src = "note8-on.gif";
preLoadNote[9] = new Image();
preLoadNote[9].src = "note9-on.gif";
preLoadNote[10] = new Image();
preLoadNote[10].src = "note10-on.gif";

preLoadFrame = new Array();
preLoadFrame[1] = new Image();
preLoadFrame[1].src = "frame1.gif";
preLoadFrame[2] = new Image();
preLoadFrame[2].src = "frame2.gif";
preLoadFrame[3] = new Image();
preLoadFrame[3].src = "frame3.gif";
preLoadFrame[4] = new Image();
preLoadFrame[4].src = "frame4.gif";
preLoadFrame[5] = new Image();
preLoadFrame[5].src = "frame5.gif";
preLoadFrame[6] = new Image();
preLoadFrame[6].src = "frame6.gif";
preLoadFrame[7] = new Image();
preLoadFrame[7].src = "frame7.gif";

preLoadPict = new Array();
preLoadPict[1] = new Image();
preLoadPict[1].src = "romy.gif";
preLoadPict[2] = new Image();
preLoadPict[2].src = "frederic.gif";
preLoadPict[3] = new Image();
preLoadPict[3].src = "lyou.gif";
preLoadPict[4] = new Image();
preLoadPict[4].src = "samantha.gif";
preLoadPict[5] = new Image();
preLoadPict[5].src = "audrey.gif";
preLoadPict[6] = new Image();
preLoadPict[6].src = "bess.gif";
preLoadPict[7] = new Image();
preLoadPict[7].src = "esther.gif";
preLoadPict[8] = new Image();
preLoadPict[8].src = "priscille.gif";
preLoadPict[9] = new Image();
preLoadPict[9].src = "lyn.gif";
preLoadPict[10] = new Image();
preLoadPict[10].src = "melissa.gif";
preLoadPict[11] = new Image();
preLoadPict[11].src = "nathan.gif";
preLoadPict[12] = new Image();
preLoadPict[12].src = "lili.gif";
preLoadPict[13] = new Image();
preLoadPict[13].src = "vae.gif";
preLoadPict[14] = new Image();
preLoadPict[14].src = "olivier.gif";
preLoadPict[15] = new Image();
preLoadPict[15].src = "julie.gif";
preLoadPict[16] = new Image();
preLoadPict[16].src = "evamandine.gif";


function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

function invi(id,flag)
{
	if (!DHTML) return;
	var x = new getObj(id);
	x.style.visibility = (flag) ? 'hidden' : 'visible'
}



function move(id,noteL,noteT,amountL,amountT)
{
	if (!DHTML) return;
	var x = new getObj(id);
	var T = noteT + amountT;
	var L = noteL + amountL;

	x.style.top = T;
	x.style.left = L;

	x.style.posTop = T;
	x.style.posLeft = L;
}

function clicked() {

  if (active_note==-1) {return};
  switch ( active_note ) {

    case 0 : 
       window.open("contact.html","_parent");
       break;

    case 1 : 
       window.open("frame1.html","_parent");
       break;

    case 2 : 
       window.open("frame2.html","_parent");
       break;

    case 3 : 
       window.open("frame3.html","_parent");
       break;

    case 4 : 
       window.open("frame4.html","_parent");
       break;

    case 5 : 
       window.open("frame5.html","_parent");
       break;

    case 6 : 
       window.open("frame6.html","_parent");
       break;

    case 7 : 
       window.open("frame7.html","_parent");
       break;

    case 8 : 
       window.open("frame8.html","_parent");
       break;

    case 9 : 
       window.open("frame9.html","_parent");
       break;

    case 10 : 
       window.open("frame10.html","_parent");
       break;

    case 11 : 
       window.open("frame11.html","_parent");
       break;

    case 12 : 
       window.open("frame12.html","_parent");
       break;

    case 13 : 
       window.open("frame13.html","_parent");
       break;

    case 14 : 
       window.open("frame14.html","_parent");
       break;

    case 15 : 
       window.open("frame15.html","_parent");
       break;

    case 16 : 
       window.open("frame16.html","_parent");
       break;

    case 99 : 
       window.open("extraits.html","_parent");
       break;


    default : 
       window.alert("An unexpected error occurred");
  }

}



function reset() {

       window.document.images["imgnote"].src= "no-frame.gif";
       window.document.images["imgnote2"].src= "no-pict.gif";
       clearInterval(move_timer);
//       move_timer=setInterval('move("divnote",0,0,0,-1000);clearInterval(move_timer);',moveinterv);        
       move("divnote",0,0,0,-1000);
       move("pict",0,0,0,-1000);
}

function clear() {
       clearInterval(clear_timer);
       clearInterval(div_timer);
       reset();
       active_note=-1;

}

function display_pict(id){
       clearInterval(img_timer);
//       if (active_note==-1) {return};

       if ((document.all) && (browser=="msie")){ 
          document.images["imgnote2"].style.filter="blendTrans(duration=crossFadeDuration)";
          document.images["imgnote2"].filters.blendTrans.Apply();
       }
       document.images["imgnote2"].src = preLoadPict[id].src;
       if (document.all){document.images["imgnote2"].filters.blendTrans.Play();}
}

function display_frame(id){
       clearInterval(div_timer);
//       if (active_note==-1) {return};
       window.document.images["imgnote"].src= preLoadFrame[id].src;

}

function dispImageDyn (m,Ln,Tn,L,T,Li,Ti) {
  reset();
  active_note = m;
  clearInterval(clear_timer);


  switch ( m ) {

    case 0 : 
       window.document.images["contactimg"].src = menu_livre_dyn[0];
       break;

    case 1 : 
       move("divnote",Ln,Tn,L, T);
       move("pict",0,0,Li, Ti);
       window.document.images["rollover-note1"].src = preLoadNote[m].src;
//       div_timer=setInterval('display_frame(1);',divinterv);
       window.document.images["imgnote"].src= preLoadFrame[1].src;
       clearInterval(img_timer);
       img_timer=setInterval("display_pict(1)",imginterv);
       break;

    case 2 : 
       move("divnote",Ln,Tn,L, T);
       move("pict",0,0,Li, Ti);
       window.document.images["rollover-note2"].src = preLoadNote[m].src;
       window.document.images["imgnote"].src= preLoadFrame[6].src;
       clearInterval(img_timer);
       img_timer=setInterval("display_pict(2)",imginterv);
       break;

    case 3 : 
       move("divnote",Ln,Tn,L, T);
       move("pict",0,0,Li, Ti);
       window.document.images["rollover-note3"].src = preLoadNote[m].src;
       window.document.images["imgnote"].src= preLoadFrame[2].src;
       clearInterval(img_timer);
       img_timer=setInterval("display_pict(3)",imginterv);
       break;

    case 4 : 
       move("divnote",Ln,Tn,L, T);
       move("pict",0,0,Li, Ti);
       window.document.images["rollover-note4"].src = preLoadNote[m].src;
       window.document.images["imgnote"].src= preLoadFrame[2].src;
       clearInterval(img_timer);
       img_timer=setInterval("display_pict(4)",imginterv);
       break;

    case 5 : 
       move("divnote",Ln,Tn,L, T);
       move("pict",0,0,Li, Ti);
       window.document.images["rollover-note5"].src = preLoadNote[m].src;
       window.document.images["imgnote"].src= preLoadFrame[3].src;
       clearInterval(img_timer);
       img_timer=setInterval("display_pict(5)",imginterv);
       break;

    case 6 : 
       move("divnote",Ln,Tn,L, T);
       move("pict",0,0,Li, Ti);
       window.document.images["rollover-note6"].src = preLoadNote[m].src;
       window.document.images["imgnote"].src= preLoadFrame[4].src;
       clearInterval(img_timer);
       img_timer=setInterval("display_pict(6)",imginterv);
       break;

    case 7 : 
       move("divnote",Ln,Tn,L, T);
       move("pict",0,0,Li, Ti);
       window.document.images["rollover-note7"].src = preLoadNote[m].src;
       window.document.images["imgnote"].src= preLoadFrame[4].src;
       clearInterval(img_timer);
       img_timer=setInterval("display_pict(7)",imginterv);
       break;

    case 8 : 
       move("divnote",Ln,Tn,L, T);
       move("pict",0,0,Li, Ti);
       window.document.images["rollover-note8"].src = preLoadNote[m].src;
       window.document.images["imgnote"].src= preLoadFrame[5].src;
       clearInterval(img_timer);
       img_timer=setInterval("display_pict(8)",imginterv);
       break;

    case 9 : 
       move("divnote",Ln,Tn,L, T);
       move("pict",0,0,Li, Ti);
       window.document.images["rollover-note9"].src = preLoadNote[m].src;
       window.document.images["imgnote"].src= preLoadFrame[4].src;
       clearInterval(img_timer);
       img_timer=setInterval("display_pict(9)",imginterv);
       break;

    case 10 : 
       move("divnote",Ln,Tn,L, T);
       move("pict",0,0,Li, Ti);
       window.document.images["rollover-note10"].src = preLoadNote[m].src;
       window.document.images["imgnote"].src= preLoadFrame[5].src;
       clearInterval(img_timer);
       img_timer=setInterval("display_pict(10)",imginterv);
       break;

    case 11 : 
       move("divnote",Ln,Tn,L, T);
       move("pict",0,0,Li, Ti);
       window.document.images["rollover-note11"].src = preLoadNote[8].src;
       window.document.images["imgnote"].src= preLoadFrame[2].src;
       clearInterval(img_timer);
       img_timer=setInterval("display_pict(11)",imginterv);
       break;

    case 12 : 
       move("divnote",Ln,Tn,L, T);
       move("pict",0,0,Li, Ti);
       window.document.images["rollover-note12"].src = preLoadNote[7].src;
       window.document.images["imgnote"].src= preLoadFrame[4].src;
       clearInterval(img_timer);
       img_timer=setInterval("display_pict(12)",imginterv);
       break;

    case 13 : 
       move("divnote",Ln,Tn,L, T);
       move("pict",0,0,Li, Ti);
       window.document.images["rollover-note13"].src = preLoadNote[10].src;
       window.document.images["imgnote"].src= preLoadFrame[6].src;
       clearInterval(img_timer);
       img_timer=setInterval("display_pict(13)",imginterv);
       break;

    case 14 : 
       move("divnote",Ln,Tn,L, T);
       move("pict",0,0,Li, Ti);
       window.document.images["rollover-note14"].src = preLoadNote[1].src;
       window.document.images["imgnote"].src= preLoadFrame[1].src;
       clearInterval(img_timer);
       img_timer=setInterval("display_pict(14)",imginterv);
       break;

    case 15 : 
       move("divnote",Ln,Tn,L, T);
       move("pict",0,0,Li, Ti);
       window.document.images["rollover-note15"].src = preLoadNote[1].src;
       window.document.images["imgnote"].src= preLoadFrame[4].src;
       clearInterval(img_timer);
       img_timer=setInterval("display_pict(15)",imginterv);
       break;

    case 16 : 
       move("divnote",Ln,Tn,L, T);
       move("pict",0,0,Li, Ti);
       window.document.images["rollover-note16"].src = preLoadNote[6].src;
       window.document.images["imgnote"].src= preLoadFrame[4].src;
       clearInterval(img_timer);
       img_timer=setInterval("display_pict(16)",imginterv);
       break;

    default : 
       window.alert("An unexpected error occurred");
  }

}



function dispImageStat (m) {

  active_note=-1;
  switch ( m ) {

    case 0 : 
       window.document.images["contactimg"].src = menu_livre_stat[0];
       break;

    case 1 : 
       window.document.images["rollover-note1"].src = menu_note_stat[m];
      break;

    case 2 : 
       window.document.images["rollover-note2"].src = menu_note_stat[m];
       break;

    case 3 : 
       window.document.images["rollover-note3"].src = menu_note_stat[m];
      break;

    case 4 : 
       window.document.images["rollover-note4"].src = menu_note_stat[m];
      break;

    case 5 : 
       window.document.images["rollover-note5"].src = menu_note_stat[m];
      break;

    case 6 : 
       window.document.images["rollover-note6"].src = menu_note_stat[m];
      break;

    case 7 : 
       window.document.images["rollover-note7"].src = menu_note_stat[m];
       break;

    case 8 : 
       window.document.images["rollover-note8"].src = menu_note_stat[m];
      break;

    case 9 : 
       window.document.images["rollover-note9"].src = menu_note_stat[m];
      break;

    case 10 : 
       window.document.images["rollover-note10"].src = menu_note_stat[m];
      break;

    case 11 : 
       window.document.images["rollover-note11"].src = menu_note_stat[8];
      break;

    case 12 : 
       window.document.images["rollover-note12"].src = menu_note_stat[7];
      break;

    case 13 : 
       window.document.images["rollover-note13"].src = menu_note_stat[10];
      break;

    case 14 : 
       window.document.images["rollover-note14"].src = menu_note_stat[1];
      break;

    case 15 : 
       window.document.images["rollover-note15"].src = menu_note_stat[1];
      break;

    case 16 : 
       window.document.images["rollover-note16"].src = menu_note_stat[6];
      break;

    case 99 : 
       window.document.images["extraitsimg"].src = menu_livre_stat[1];
       break;

    default : 
       window.alert("An unexpected error occurred");
  }

  clearInterval(div_timer);
  clearInterval(clear_timer);
  clear_timer=setInterval("clear()",clearinterv);
}

function start_note (_menu_id,_Ln,_Tn,_L,_T,_Li,_Ti) {

  if (document.images) {dispImageDyn(_menu_id,_Ln,_Tn,_L,_T,_Li,_Ti);}
}

function stop_note (_menu_id) {
  dispImageStat(_menu_id);
}

function start_livre (_menu_id,_T,_L) {
  if (document.images) {dispImageDyn(_menu_id,_L,_T);}
}

function stop_livre (_menu_id) {
  dispImageStat(_menu_id);
}

