window.addEvent("domready", function() {
	// Menu
	var currentPage = -1;
	if($("page-home") || $("page-tarifs") || $("page-faq"))
		currentPage = 0;
	else if($("page-pack") || $("page-privileges") || $("page-formule") || $("page-famille"))
		currentPage = 1;
	else if($("page-abonnement"))
		currentPage = 2;
	var accordionMenu = new Accordion($$('#menu .toggler'), $$('#menu .links'), {
	    show: currentPage,
	    alwaysHide: true,
	    opacity:false,
		duration:200,
		onActive:function(toggler, section) {
			var pMi = toggler.getParent(".menu-item");
			var pDiv = toggler.getParent("div");
			pMi.set('morph', {duration: 400});
			pDiv.set('morph', {duration: 400});
			toggler.set('morph', {duration: 200});
			var paddingBottom = 15;
			if(toggler == this.togglers[2])
				paddingBottom=0;
			pMi.morph({width:'187px'});
			pDiv.morph({'padding-bottom':paddingBottom+'px'});
			(function(){pDiv.morph({overflow:'visible'}) ;}).delay(200, pDiv);
			toggler.morph({'margin-left':'5px'});
		},
		onBackground:function(toggler, section) {
			var pMi = toggler.getParent(".menu-item");
			var pDiv = toggler.getParent("div");
			pMi.set('morph', {duration: 200});
			pDiv.set('morph', {duration: 200});
			toggler.set('morph', {duration: 100});
			pMi.morph({width:'160px'});
			pDiv.morph({'padding-bottom':'0',overflow:'hidden'});
			toggler.morph({'margin-left':'0px'});
		}
	});
	// Page FAQ
	if($chk("page-faq"))
	{
		var accordionFAQ = new Accordion($$('#content dt'), $$('#content dd'), {
		    display: 0,
		    alwaysHide: false,
		    opacity:false,
			duration:400,
			onActive:function(toggler) {
				toggler.getFirst(".arrow").addClass("arrow-on");
			},
			onBackground:function(toggler) {
				toggler.getFirst(".arrow").removeClass("arrow-on");
			}
		});
	}
});
function fbs_click() {
	u="http://www.abolosc.com/index.html";
	t=document.title;
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=400');
	return false;
}