//////////////////////////////////////////////////////////////
/////////  AFFICHEUR de MESSAGES by Emmanuel Gaille  /////////
/////////  http://www.blancsurblanc.net              /////////
//////////////////////////////////////////////////////////////
function info(message,champ)
  {
  if(document.getElementById)
    document.getElementById(champ).innerHTML = message;
}

////////////////////////  END  ///////////////////////////////


//*******************************************************
//************     MODULEUR FOND DE PAGE     ************
//************    author: Emmanuel Gaille    ************
//************ http://www.blancsurblanc.net/ ************
//*******************************************************
//
//POSSIBLE PARAMETERS:
//
//******
//status
//******
//background <--- the image is in background
//inserted <--- the image is inserted in the page
//*****
//width
//*****
//<lenght>
//<percentage>
//******
//height
//******
//<lenght>
//<percentage>
//************
//repeat:
//************
//repeat
//repeat-x
//repeat-y
//no-repeat
//inherit  
//****************
//attachment:
//****************
//scroll
//fixed
//inherit  
//**********
//posx:
//**********
//<percentage>
//<length>
//left
//center
//right  
//**********
//posy:
//**********
//<percentage>
//<length>
//top
//center
//bottom 
//*********
//img: 
//*********
//<URL of background image>
//random <--- if checked, you need to specify image names below
//*********
//id: 
//*********
//<id of background image>
//*******************************************************
function imagefond(img,id,status,width,height,posx,posy,attachment,repeat){
function image() {
};
image = new image();
number = 0;

image[number++] = "index-titre1.jpg"
image[number++] = "index-titre2.jpg"
//etc
//...

increment = Math.floor(Math.random() * number);
if (status == 'inserted') {
	if (img == 'random') {
		if (width == '') document.write('<img id="'+id+'" src="'+image[increment]+'" height='+height+' border="0">');
		if (height =='') document.write('<img id="'+id+'" src="'+image[increment]+'" width='+width+' border="0">');
		if (height =='' && width == '') document.write('<img id="'+id+'" src="'+image[increment]+'" border="0">');
		else document.write('<img id="'+id+'" src="'+image[increment]+'" width='+width+' height='+height+' border="0">');
	}
	else {
		if (width == '') document.write('<img id="'+id+'" src="'+img+'" height='+height+' border="0">');
		if (height =='') document.write('<img id="'+id+'" src="'+img+'" width='+width+' border="0">');
		if (height =='' && width == '') document.write('<img id="'+id+'" src="'+img+'" border="0">');
		else document.write('<img id="'+id+'" src="'+img+'" width='+width+' height='+height+' border="0">');
	}
}
if (status == 'background') {
	if (img == 'random') document.write('<body background="'+image[increment]+'" style="BACKGROUND-POSITION: '+posx+' '+posy+'; BACKGROUND-ATTACHMENT: '+attachment+'; BACKGROUND-REPEAT: '+repeat+';">');
	else document.write('<body background="'+img+'" style="BACKGROUND-POSITION: '+posx+' '+posy+'; BACKGROUND-ATTACHMENT: '+attachment+'; BACKGROUND-REPEAT: '+repeat+';">');
	}
}

function setBackground(image_url) {
  if (document.body) {document.background = image_url;}
}

