// JavaScript Document
//Function test support ajax
var spyBarreMenu;
var myVerticalSlideMenuProduits;
function myVerticalSlideMenuProduitsClose() {
	if(Browser.Platform.name != "ios" && Browser.Platform.name != "android") {
		myVerticalSlideMenuProduits.slideOut();
		$("menu_produits_a").removeClass("open");
	} else {
		$("menu_produits_a").removeClass("open");
		$("headerMenuProduits").getElement(".headerMenuContainerProduit").removeClass("headerMenuContainerProduitVisible");
	}
}
function initMenuGenerale() {
	//Menu produits
	if(Browser.Platform.name != "ios" && Browser.Platform.name != "android") {
		$("headerMenuProduits").getElement(".headerMenuContainerProduit").setStyle("visibility","hidden").setStyle("display","block");
		myVerticalSlideMenuProduits = new Fx.Slide('headerMenuProduits', {
			transition: Fx.Transitions.Circ.easeInOut	
		});
		
		myVerticalSlideMenuProduits.hide();
		$("headerMenuProduits").getElement(".headerMenuContainerProduit").setStyle("visibility","visible");
		$('menu_produits_a').addEvent('click', function(e){										
			e.stop();
			if(myVerticalSlideMenuProduits.open) {
				myVerticalSlideMenuProduits.slideOut();
				$("menu_produits_a").removeClass("open");
			} else {
				if(Browser.safari && Browser.Platform.win) {
					//Fermer la 3D
					if($("CIApplet")) fermerPopup_3d();
				}
				if(Browser.ie) {
					//Fermer la 3D
					if($("CIApplet")) fermerPopup_3d();
				}
				myVerticalSlideMenuProduits.slideIn();
				$("menu_produits_a").addClass("open");
			}
		});
		
	} else {
		
		//$("headerMenuProduits").getElement(".headerMenuContainerProduit").setStyle("visibility","hidden").setStyle("display","block");
		$('menu_produits_a').addEvent('click', function(e){										
			e.stop();
			if($("headerMenuProduits").getElement(".headerMenuContainerProduit").hasClass("headerMenuContainerProduitVisible")) {
				$("headerMenuProduits").getElement(".headerMenuContainerProduit").removeClass("headerMenuContainerProduitVisible");
				$("menu_produits_a").removeClass("open");
			} else {
				if(Browser.safari && Browser.Platform.win) {
					//Fermer la 3D
					if($("CIApplet")) fermerPopup_3d();
				}
				if(Browser.ie) {
					//Fermer la 3D
					if($("CIApplet")) fermerPopup_3d();
				}
				$("headerMenuProduits").getElement(".headerMenuContainerProduit").addClass("headerMenuContainerProduitVisible");
				$("menu_produits_a").addClass("open");
			}
		});
		/*
		 $('menu_produits_a').addEvent('click', function(e){										
			e.stop();
			if($("headerMenuProduits").getElement(".headerMenuContainerProduit").getStyle("display") == 'none') {
				$("headerMenuProduits").getElement(".headerMenuContainerProduit").setStyle("display","block");
				$("menu_produits_a").removeClass("open");
			} else {
				if(Browser.safari && Browser.Platform.win) {
					//Fermer la 3D
					if($("CIApplet")) fermerPopup_3d();
				}
				if(Browser.ie) {
					//Fermer la 3D
					if($("CIApplet")) fermerPopup_3d();
				}
				$("headerMenuProduits").getElement(".headerMenuContainerProduit").setStyle("display","none");
				$("menu_produits_a").addClass("open");
			}
		});
		 */
		
	}
}
