var randnum = Math.random();
var inum = 7;
var rand1 = Math.round(randnum * (inum-1)) + 1;
images = new Array
images[1] = "fd-lign1-1.jpg"
images[2] = "fd-lign1-2.jpg"
images[3] = "fd-lign1-3.jpg"
images[4] = "fd-lign1-4.jpg"
images[5] = "fd-lign1-5.jpg"
images[6] = "fd-lign1-6.jpg"
images[7] = "fd-lign1-1.jpg"

var image = images[rand1]


login_off = new Image ( );
login_off.src = "../img/invisible.gif";
login_on = new Image ( );
login_on.src = "../img/onglet-loginon-red.gif";

insc_off = new Image ( );
insc_off.src = "../img/invisible.gif";
insc_on = new Image ( );
insc_on.src = "../img/onglet-inscriptionon-red.gif";

accueil_off = new Image ( );
accueil_off.src = "../img/invisible.gif";
accueil_on = new Image ( );
accueil_on.src = "../img/onglet-accueilon-red.gif";

ecole_off = new Image ( );
ecole_off.src = "../img/invisible.gif";
ecole_on = new Image ( );
ecole_on.src = "../img/onglet-ecoleon-red.gif";

profs_off = new Image ( );
profs_off.src = "../img/invisible.gif";
profs_on = new Image ( );
profs_on.src = "../img/onglet-profson-red.gif";

instruments_off = new Image ( );
instruments_off.src = "../img/invisible.gif";
instruments_on = new Image ( );
instruments_on.src = "../img/onglet-instrumentson-red.gif";

studio_off = new Image ( );
studio_off.src = "../img/invisible.gif";
studio_on = new Image ( );
studio_on.src = "../img/onglet-studioon-red.gif";

infos_off = new Image ( );
infos_off.src = "../img/invisible.gif";
infos_on = new Image ( );
infos_on.src = "../img/onglet-infoson-red.gif";

aide_off = new Image ( );
aide_off.src = "../img/invisible.gif";
aide_on = new Image ( );
aide_on.src = "../img/onglet-aideon-red.gif";



artcours_off = new Image ( );
artcours_off.src = "../img/invisible.gif";
artcours_on = new Image ( );
artcours_on.src = "../img/onglet-artcourson.gif";

artprog_off = new Image ( );
artprog_off.src = "../img/invisible.gif";
artprog_on = new Image ( );
artprog_on.src = "../img/onglet-artprogon.gif";

artbio_off = new Image ( );
artbio_off.src = "../img/invisible.gif";
artbio_on = new Image ( );
artbio_on.src = "../img/onglet-artbioon.gif";

function button_on ( imgName )
{
    butOn = eval ( imgName + "_on.src" );
    document [imgName].src = butOn;
}

function button_off ( imgName )
  {
	butOff = eval ( imgName + "_off.src" );
	document [imgName].src = butOff;
}

function button_on2 ( imgName )
{
    butOn = eval ( imgName + "_on-red.src" );
    document [imgName].src = butOn;
}

function button_off2 ( imgName,divName )
  {
    disp = document.getElementById(divName).style.visibility;

	if (disp!="visible")
	{
		butOff = eval ( imgName + "_off.src" );
		document [imgName].src = butOff;
	}
}


function toggleLayer(whichLayer)
{
	var elem, vis;
	if( document.getElementById ) // this is the way the standards work
	elem = document.getElementById( whichLayer );
	//else if( document.all ) // this is the way old msie versions work
	//elem = document.all[whichLayer];
	//else if( document.layers ) // this is the way nn4 works
	//elem = document.layers[whichLayer];
	vis = elem.style;  // if the style.display value is blank we try to figure it out here
	if(vis.display=='' && elem.offsetWidth!=undefined && elem.offsetHeight!=undefined)
	vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
	vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}


function showcours()
  {
      document.getElementById("divcours").style.visibility = "visible";
	  document.getElementById("divcours").style.display = "block";
      document.getElementById("divprog").style.visibility = "hidden";
	  document.getElementById("divprog").style.display = "none";
      document.getElementById("divbio").style.visibility = "hidden";
	  document.getElementById("divbio").style.display = "none";
	  button_off('artprog');
	  button_off('artbio');
  }

function showprog()
  {
      document.getElementById("divprog").style.visibility = "visible";
	  document.getElementById("divprog").style.display = "block";
      document.getElementById("divcours").style.visibility = "hidden";
	  document.getElementById("divcours").style.display = "none";
      document.getElementById("divbio").style.visibility = "hidden";
	  document.getElementById("divbio").style.display = "none";
	  button_off('artcours');
	  button_off('artbio');
  }

function showbio()
  {
      document.getElementById("divbio").style.visibility = "visible";
	  document.getElementById("divbio").style.display = "block";
      document.getElementById("divcours").style.visibility = "hidden";
	  document.getElementById("divcours").style.display = "none";
      document.getElementById("divprog").style.visibility = "hidden";
	  document.getElementById("divprog").style.display = "none";
	  button_off('artcours');
	  button_off('artprog');
  }

function popup(URL, width, height,scrollbars) {
	if(!scrollbars){
		window.open(URL,'pop596','scrollbars=yes,status=no,width='+width+',height='+height);
	}else{
		window.open(URL,'pop2987','scrollbars=no,status=no,width='+width+',height='+height);
	}
}
