var myZoom;

function init(o) {
	var stretchers = document.getElementsByClassName('stretcher');
	var toggles = document.getElementsByClassName('menutitre');
	var myAccordion = new fx.Accordion(
		toggles, stretchers, {opacity: false, duration: 500, defaultStretcher: o }
	);
	
	if(document.getElementById("select")) {
		zoom = document.getElementsByClassName('zoom');
		for(i=0; i<zoom.length; i++) {
			zoom[i].onclick = function() { document.getElementById("galerie").style.backgroundImage = "url('"+this.href+"')"; return false; }
		}
	}
	
	if(document.getElementById("zoom")) {
		myZoom = new fx.Combo('zoom', {height: true, opacity: true, duration: 1000});
		myZoom.hide('height');
	}
}

function galerie() {
	if(document.getElementById("select")) {
		zoom = document.getElementsByClassName('zoom');
		for(i=0; i<zoom.length; i++) {
			zoom[i].onclick = function() { document.getElementById("galerie").style.backgroundImage = "url('"+this.href+"')"; return false; }
		}
	}	
}

function zoom() {
	myZoom.toggle();
}

function page(catid) {
	new Ajax.Updater('page', 'index.php', {parameters:'catid=' + encodeURIComponent(catid), asynchronous:true, evalScripts:true});
}

function addToFavorites() {
	if (document.all) { window.external.AddFavorite(location.href, document.title); }
	else { alert('Vous pouvez faire CTRL + D pour ajouter cette page dans vos signets, ou favoris.') }
}

function retour() {
	history.go(-1);	
}

function OpenWin(URL,width,height,nom) {
	window.open(URL,nom,"toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=" + width + ",height=" + height + ",resizable=no");
}

function OpenWin2(URL,width,height,nom) {
	window.open(URL,nom,"toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=" + width + ",height=" + height + ",resizable=yes");
}

function DisplayZoomPopUp(url) {
	window.open(url,'Zoom','height=500,width=500,left=0,top=0,scrollbars=yes');
}
