<!-- //
function affiche_masque(id) {
	var d = document.getElementById(id);
	if (d) {
		var my_display = d.style.display;
		if (my_display == 'none') {d.style.display='block';}
		else {d.style.display='none';}
	}
}

function affiche_masque_coupon() {
	var arq = new Ajax('/front/fr/shop_coupon/async_affichecoupon/0',{
		method: 'post',
		evalScripts: true,
		update: $('coupons'),
		onComplete: function() {
			affiche_masque('coupons');
		}
	}).request();
}

function masque_zoom(id){ 
	var d = document.getElementById(id);
	if (d) 
	{
		d.style.display='none';
	}
	clearInterval();
}

function logout() {
	var arq = new Ajax('/front/fr/shop_customer/async_logout/0', {
		method: 'post',
		evalScripts: true,
		onComplete: function() {
			//document.location.href = document.location.href;
			document.location.href = "/";
		}
	}).request();
}

function updateBulle() {
	var arq = new Ajax('/front/fr/shop_customer/async_updatebulle/0', {
		method: 'post',
		evalScripts: true,
		onComplete: function() { 
			$('bulle_compte').setHTML(this.response.text);
		}
	}).request();
}

function affiche_masque_zoom(id, zoomFile, nbZoom) {
	var idZoom = '';
	for ( i=1; i<= nbZoom; i++ ) {
		if (i<10) { idZoom = 'pv00' + i;}
		else { idZoom = 'pv0' + i;}
		var e = document.getElementById(idZoom);
		if ( e.style.display == 'block' )	e.style.display='none';
	}
	
	var d = document.getElementById(id);
	if (d) {
		var my_display = d.style.display;
		if (my_display == 'none') {d.style.display='block'; setInterval(function() { d.style.display='none'; clearInterval(); },20000)}
		else {d.style.display='none';}
	}

	if (zoomFile != '') {
		var z = 'zoom_' + id;
		//alert (z + " .src = " + document.images[z].src + " => " + zoomFile);
		if (document.images[z]) {
			//zoomFile = 'ece59b7ab488f28a5664d1d812ccc45c';
			document.images[z].src = '/front/fr/storagefile/download/' + zoomFile;
		}
	}
}
function affiche_masque2(myBloc,n,prefixe) {
	var d = document.getElementById(myBloc);
	for (i=1; i<=n; i++) {
		var bloc = prefixe;
		if (prefixe == 'photo_')
		{
			bloc = bloc + i;
		} else {
			if (i<1000 && i>99)
				bloc += i;
			if (i<100 && i>9)
				bloc += '0' + i;
			else
				bloc += '00' + i;
		}
		var my_display = document.getElementById(bloc);
		if (my_display) {
			my_display.style.display='none';
		}
	}
	if (d) { d.style.display='block';}
}

// -----------------------------------------------------------------------------
// PANIER AUTO SCROLL
function init_panier() {
	var hMin = 154;
	var hScroll = window.getScrollHeight();
	var hScreen = window.getHeight();
	var vScrollTop = window.getScrollTop();
	var msg = 'DEBUGG :';
	msg += '\n hScreen = ' + hScreen;
	msg += '\n hScroll = ' + hScroll;
	msg += '\n vScrollTop = ' + vScrollTop;
	alert(msg);
}
function init_encart_commande() {
	//alert(window.getScrollTop());
	window.addEvent('scroll', function(){
		var test_val = Math.max( (window.getScrollTop() + 154), 154 );
		//alert("ScrollTop = " + window.getScrollTop() + ", test_val = " + test_val);
		$('encart_commande').setStyle('top', test_val + 'px');
	});
	
	window.addEvent('domready', function(){
		var test_val = Math.max( (window.getScrollTop() + 154), 154 );
		$('encart_commande').setStyle('top', test_val + 'px');
	});
}
// -----------------------------------------------------------------------------
// RESOLUTION D'ECRAN
function ResolutionEcran() {
	Ecran['Haut'] = screen.height;
	Ecran['Larg'] = screen.width;
	return Ecran;
}
// -----------------------------------------------------------------------------

// -->