// Déplie une partie du menu
function montre(id) {
	var d = document.getElementById(id);
	for ( var i = 1; i <= 15; i++) {
		if (document.getElementById('smenu' + i)) {
			document.getElementById('smenu' + i).style.display = 'none';
		}
	}
	if (d) {
		d.style.display = 'block';
	}
}

function Openwindow(page, titre, largeur, hauteur, options) {
	var top = (screen.height - hauteur) / 2;
	var left = (screen.width - largeur) / 2;
	window.open(page, titre, "top=" + top + ",left=" + left + ",width="
			+ largeur + ",height=" + hauteur + ",resizable=1,scrollbars=1,"
			+ options);
}

function showAvis(marchandRefId, type) {
	link = '/marchands/popupavis?id=' + marchandRefId + '&type=' + type;
	Openwindow(link, 'Avis', '400', '500', 'scrollbars=no');
}

function asynchronousCall(spanId, url, params) {
	jQuery.ajax( {
		type :'POST',
		processData :true,
		url :url,
		data :params,
		dataType :'html',
		success : function(data) {
			// alert(data);
		jQuery('#' + spanId).html(data);
	}
	});
}

//Ajout du plugin de recherche
function addPlugin(name, ext, cat, type) {
	if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")) {
		window.sidebar.addSearchEngine(
			"http://www.jeuxdesocietepascher.net/js/jeuxdesocietepascher.src",
			"http://www.jeuxdesocietepascher.net/images/favicon.ico",
			"JeuxdeSocietepasCher",
			"Guide d'achat de jeux de société");
	} else {
		alert("Ce plugin ne s'installe que sous Mozilla Firefox");
	}
}
