function loading() {
  xajax.callback.global.onRequest = function() {xajax.$('loading').style.display = 'block';}
  xajax.callback.global.beforeResponseProcessing = function() {xajax.$('loading').style.display='none';}
}

function pleinEcran() {
	window.onload = maxWindow;
	function maxWindow()
	{window.moveTo(0,0);
	if (document.all)
	{top.window.resizeTo(screen.availWidth,screen.availHeight);}
	else if (document.layers||document.getElementById)
	{if(top.window.outerHeight<screen.availHeight||Top.window.outerWidth<screen.availWidth)
	{top.window.outerHeight = screen.availHeight;
	top.window.outerWidth = screen.availWidth;}}}
}

function pleinEcran2(){

	var ie4 = ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ))
	var ns4 = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4 ))
	if (ie4) {
	fenetre=window.open("http://www.eclatsdenuit.com","","resizable,scrollbars")
	fenetre.moveTo(0,0)
	fenetre.resizeTo(screen.width,(screen.height-25))
	}
	else
	plecran=window.open("http://www.eclatsdenuit.com", "plecran", "height="+window.screen.availHeight+", width="+(window.screen.availWidth-10)+", top=0, left=0, toolbar=no, status=no, scrollbars=no, location=no, menubar=no, directories=no, resizable=no");

}

function refresh() {

   	xajax_introDiaporama();
  	setTimeout(refresh, 6000);
}

function disappearDesc() {

   	xajax_disappearDesc();
  	setTimeout(disappearDesc, 8000);
}



var effect = 1;
var time = 3000;

var current_image = 0;
var next_image = 1;
var image = new Array();

function init() {
	if(document.getElementsByClassName("image")) {
		image = document.getElementsByClassName("image");
		for(i=1; i < image.length; i++) {
			image[i].style.display = "none";
		}
	}
	
	if(image.length > 1) galerie();
}

function galerie() {
	self.setTimeout("nextimage()",time);	
}

function nextimage() {
	if(effect == 1) { new Effect.Fade(image[current_image]); new Effect.Appear(image[next_image]); }
	if(effect == 2) { new Effect.BlindUp(image[current_image]); new Effect.BlindDown(image[next_image]); }
	
	if(next_image == (image.length-1)) {
		current_image = next_image;
		next_image = 0;
	} else {
		current_image = next_image;
		next_image++;
	}
	galerie();
}