// JavaScript Document
var couleur_svg = '#666666' ;
function getImgW(imgSrc)
{
var newImg = new Image();
newImg.src = imgSrc;
var height = newImg.height;
var width = newImg.width;
return width ;
}
function getImgH(imgSrc)
{
var newImg = new Image();
newImg.src = imgSrc;
var height = newImg.height;
var width = newImg.width;
return height ;
}

function texte_svg(canevas,texte,x,y,fs)
{
	var t = canevas.text(x, y, texte);
	t.attr({'font-size':fs});
	t.attr({fill: couleur_svg});	
	t.translate(t.getBBox().width/2, t.getBBox().height/2); 
	
	return(t);
}

function img_svg(canevas,f,x,y)
{
	var i = canevas.image(f, x, y, getImgW(f),getImgH(f));	
	return(i);
}

var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = window.open(URLStr,'popUpWin','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+width+',height='+height+',left='+left+', top='+top+'');
}

var popUpWinCSS=0;

function popUpWindowCSS(URLStr, left, top, width, height)
{
  if(popUpWinCSS)
  {
    if(!popUpWinCSS.closed) popUpWinCSS.close();
  }
  popUpWinCSS = open(URLStr, 'popUpWinCSS', 'alwaysRaised=1,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

var popUpWinIMG=0;
function popUpWindowIMG(URLStr, left, top, width, height)
{
  if(popUpWinIMG)
  {
    if(!popUpWinIMG.closed) popUpWinIMG.close();
  }
  popUpWinIMG = open(URLStr, 'popUpWinIMG', 'alwaysRaised=1,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;


<!-- DEBUT DU SCRIPT PHOTO -->

//Example: preloadImages('file.gif', 'http://www.x.com/y.gif');
function preloadImages()
{
  if(document.images)
  {
    if(!document.imageArray) document.imageArray = new Array();
    var i,j = document.imageArray.length, args = preloadImages.arguments;

    for(i=0; i<args.length; i++)
    {
      if (args[i].indexOf("#")!=0)
      {
        document.imageArray[j] = new Image;
        document.imageArray[j++].src = args[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;
}


// Example: obj = findObj("image1");
function findObj(theObj, theDoc)
{
  var p, i, foundObj;

  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++)
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);

  return foundObj;
}

// * Dependencies *
// this function requires the following snippets:
// JavaScript/readable_MM_functions/findObj
//
// Accepts a variable number of arguments, in triplets as follows:
// arg 1: simple name of a layer object, such as "Layer1"
// arg 2: ignored (for backward compatibility)
// arg 3: 'hide' or 'show'
// repeat...
//
// Example: showHideLayers(Layer1,'','show',Layer2,'','hide');
function showHideLayers()
{
  var i, visStr, obj, args = showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3)
  {
    if ((obj = findObj(args[i])) != null)
    {
      visStr = args[i+2];
      if (obj.style)
      {
        obj = obj.style;
        if(visStr == 'show') visStr = 'visible';
        else if(visStr == 'hide') visStr = 'hidden';
      }
      obj.visibility = visStr;
    }
  }
}

<!-- DEBUT DU SCRIPT DATE -->

function VersionNavigateur(Netscape, Explorer) {
  if ((navigator.appVersion.substring(0,3) >= Netscape && navigator.appName == 'Netscape') ||
      (navigator.appVersion.substring(0,3) >= Explorer && navigator.appName.substring(0,9) == 'Microsoft'))
    return true;
else return false;
}
function Semaine(lang){
    if (lang=='en')
    {
       this[0] = "Sunday";  this[1] = "Monday";
       this[2] = "Tuesday";     this[3] = "Wednesday";
       this[4] = "Thursday";     this[5] = "Friday";
       this[6] = "Saturday";
    }
    else
    {
       this[0] = "Dimanche";  this[1] = "Lundi";
       this[2] = "Mardi";     this[3] = "Mercredi";
       this[4] = "Jeudi";     this[5] = "Vendredi";
       this[6] = "Samedi";
    }
}

function Mois(lang){
    if (lang=='en')
    {
           this[0] = "January";    this[1] = "February";
           this[2] = "March";       this[3] = "April";
           this[4] = "May";        this[5] = "June";
           this[6] = "July";    this[7] = "August";
           this[8] = "September";  this[9] = "October";
           this[10] = "November";  this[11] = "December";
    }
    else
    {
           this[0] = "Janvier";    this[1] = "F&eacute;vrier";
           this[2] = "Mars";       this[3] = "Avril";
           this[4] = "Mai";        this[5] = "Juin";
           this[6] = "Juillet";    this[7] = "Ao&ucirc;t";
           this[8] = "Septembre";  this[9] = "Octobre";
           this[10] = "Novembre";  this[11] = "D&eacute;cembre";
    }
}
today = new Date;
function date(lang){
        var semaine=new Semaine(lang);
        var mois=new Mois(lang);
        var myDate=new Date();
        annee = today.getFullYear();

        var result=myDate.getDate()+" "+mois[myDate.getMonth()]+" "+annee;
        document.writeln(result);
    }
<!-- FIN DU SCRIPT DATE -->

<!-- FIN DU SCRIPT PHOTO -->
function SetOpacity(elem, opacityAsInt)
{
     var opacityAsDecimal = opacityAsInt;

     if (opacityAsInt > 100)
         opacityAsInt = opacityAsDecimal = 100;
     else if (opacityAsInt < 0)
         opacityAsInt = opacityAsDecimal = 0;

    opacityAsDecimal /= 100;
    if (opacityAsInt < 1)
        opacityAsInt = 1; // IE7 bug, text smoothing cuts out if 0

    elem.style.opacity = (opacityAsDecimal);
    elem.style.filter  = "alpha(opacity=" + opacityAsInt + ")";
}

function setOpacity_cacher()
{
  var args = setOpacity_cacher.arguments;
  var obj;
  var i ;
  for (i=0; i<args.length; i++)
  {
    if ((obj = findObj(args[i])) != null)
    {
    	obj.style.opacity = .2;
        obj.style.filter = 'alpha(opacity=20)';
    }
  }
}

function Opacity()
{
  var args = Opacity.arguments;
  var obj;
  var i ;
  for (i=0; i<args.length; i=i+2)
  {
	obj = document.getElementById(args[i]);
    //if ((obj = findObj(args[i])) != null)
    //{
		//if (args[i+1] == 100)
    		//obj.style.opacity = 1;		
		//else
    	obj.style.opacity = args[i+1]/100;
        obj.style.filter = 'alpha(opacity='+args[i+1]+')';
    //}
  }
}



function hide()
{
  var i;
  var args = hide.arguments;
  var ele;
  for (i=0; i<args.length; i++)
  {
	ele = document.getElementById(args[i]);
    ele.style.display = "none";
  }
}



function show()
{
  var i;
  var args = show.arguments;
  var ele;
  for (i=0; i<args.length; i++)
  {
	ele = document.getElementById(args[i]);
    ele.style.display = "block";
	Opacity(args[i],100);
  }
}

function switchImage(imgName, imgSrc)
{
  if (document.images)
  {
    if (imgSrc != "none")
    {
      document.images[imgName].src = imgSrc;
    }
  }
}


