function eventlistener(page){
	
	$('#inline_popup').css("visibility","hidden");
	document.getElementById("popin").innerHTML = '<div id="video-flash"></div>';
	
	//backgroundPosition();
	
	// gestion de la mosaique
	animateMosaique(600,page);

	// gestion du menu (active)
	
	// Google Map
	if(maps[page]){
		gmapInit(maps[page].latitude,maps[page].longitude,maps[page].elementID);
		//setTimeout(function(){gmapInit(maps[page].latitude,maps[page].longitude,maps[page].elementID)}, 500);
	}
	
	/** EXCLUSIVES **/
	if(exclusives[page]){
		/*
		$.each(exclusives[page], function(index){
        	if(this.default_cell){
        		// on créer la vignette
        		content = '<div class="'+this.default_cell+'">';
	        		content += '<div class="bloc">';
	        		if(this.img_small){
	        			content += '<a id="switch_'+index+'" href="index.php?page='+page+'&id='+index+'"><img src="_img/'+this.img_small[0]+'" /></a>'; //switch product
	        		}
	        		content += '</div>';
        		content += '</div>';
        		
        		$('#content').append(content);
        	}
        	
    		// on créer la fiche produit
    		content = '<div id="product_'+index+'" class="cell_1_3 inline';
    		if(this.default_cell){ content += ' invisible'; } 
    		content += '">';

        		if(this.img_large){
        			content += '<img id="img_'+index+'" src="_img/'+this.img_large[0]+'" />';
        		}
        		
        		content += '<div class="detail">';
        			content += '<div class="otherview">';
	        		if(this.img_large.length > 1 && this.img_small.length > 1){
		        		content += '<a href="#" id="otherview_'+index+'"><img src="_img/'+this.img_small[1]+'" /></a>';
	        		}
	        		content += '</div>';
	        		content += '<div class="infos">';
		        		content += '<h2>'+this.title+'</h2>';
		        		content += '<span class="ref">'+this.ref+'</span>';
		        		content += '<p>'+this.description+'</p>';
		        		content += '<a href="#" class="shareBtn">SHARE</a>'; //??
		        	content += '</div>';	
	        		content += '<a href="#" class="close"></a>';
        		content += '</div>';
        		content += '<a href="#" class="actionBtn">DETAIL</a>';
        		
    		content += '</div>';

    		$('#content').append(content);
		});
		*/
		
		// current product index
		$("div[id^='product_']").each(function(){
			if($(this).css('visibility') != 'hidden'){
				currentIndex = $(this).attr('id').replace("product_","");
			}
		});
		
		//switch product
		$("a[id^='switch_']").click(function(){
			productIndex = $(this).attr('id').replace("switch_","");
			
			$(this).children('img').attr('src',"_img/"+exclusives[page][currentIndex].img_small[0]);
			$(this).attr('id',"switch_"+currentIndex);
			
			$("div[id^='product_"+productIndex+"']").css('visibility',"visible");
			$("div[id^='product_"+currentIndex+"']").css('visibility',"hidden");
			
			// on remet le produit_currentIndex a son etat initial sil a ete switche
			if(exclusives[page][currentIndex].img_large.length > 1 && exclusives[page][currentIndex].img_small.length > 1){
				currentImg = $("a[id^='otherview_"+currentIndex+"']").children('img').attr('src').replace("_img/","");
				if(currentImg == exclusives[page][currentIndex].img_small[0]){
					$("a[id^='otherview_"+currentIndex+"']").children('img').attr('src',"_img/"+exclusives[page][currentIndex].img_small[1]);
					$("img[id^='img_"+currentIndex+"']").attr('src',"_img/"+exclusives[page][currentIndex].img_large[0]);
				}
			}
			
			if(page == "shoes"){ type = "shoes"; }
			if(page == "leathergoods"){ type = "handbags"; }
			if(page == "ready-to-wear"){ type = "RTW"; }

			calltracking('Exclusives', type, type+' product page',type+' product page_'+productIndex);
			
			currentIndex = productIndex;
		//	$.address.value(page/currentIndex);
			return false;
		});
		
		// Bouton detail
		$("div[id^='product_']").children('a.actionBtn').click(function(){
			if($(".fond_gris").css('display') == "none"){
				//$("body").children(".fond_gris").css('display',"block");
				$(".fond_gris").css('display',"block");
				$(this).parent().children('div.detail').css('visibility',"visible");
			}else{
				$(".fond_gris").css('display',"none");
				$('div.detail').css('visibility',"hidden");
				$("#sharePopin").css('display',"none");
				$("#share").css('display',"block");
				$("#share_message").css('display',"none");
				document.getElementById("share_form").reset();
				$("#morePopin").css('display',"none");
			}
			return false;
		});
			
		// otherview
		$("a[id^='otherview_']").click(function(){
			productIndex = $(this).attr('id').replace("otherview_","");
			img = $(this).children('img').attr('src').replace("_img/","");
			
			if(img == exclusives[page][productIndex].img_small[1]){
				$(this).children('img').attr('src',"_img/"+exclusives[page][productIndex].img_small[0]);
				$("img[id^='img_"+productIndex+"']").attr('src',"_img/"+exclusives[page][productIndex].img_large[1]);
			}else{
				$(this).children('img').attr('src',"_img/"+exclusives[page][productIndex].img_small[1]);
				$("img[id^='img_"+productIndex+"']").attr('src',"_img/"+exclusives[page][productIndex].img_large[0]);
			}
			
			return false;
		});
		
		// Bouton more
		$("a.moreBtn").click(function(){
			$("#morePopin").fadeIn();
			return false;
		});
		
		// Bouton share
		$("a[id^='share_']").click(function(){
			document.getElementById("share_form").product_id.value = $(this).attr('id').replace("share_","");
			$("#sharePopin").fadeIn();
			return false;
		});
		
		// Slide
		$("a[id^='prevnext_']").click(function(){
			productIndex = $(this).attr('id').replace("prevnext_","");
			
			if(productIndex != "begin" && productIndex != "end"){
				$("a[id^='switch_"+productIndex+"']").children('img').attr('src',"_img/"+exclusives[page][currentIndex].img_small[0]);
				$("a[id^='switch_"+productIndex+"']").attr('id',"switch_"+currentIndex);
				
				$("div[id^='product_"+productIndex+"']").css('visibility',"visible");
				$("div[id^='product_"+productIndex+"']").children('div.detail').css('visibility',$("div[id^='product_"+currentIndex+"']").children('div.detail').css('visibility'));
				
				$("#sharePopin").css('display',"none");
				$("#share").css('display',"block");
				$("#share_message").css('display',"none");
				document.getElementById("share_form").reset();
				
				$("div[id^='product_"+currentIndex+"']").css('visibility',"hidden");
				$("div[id^='product_"+currentIndex+"']").children('div.detail').css('visibility',"hidden");
				
				// on remet le produit_currentIndex a son état initial sil a ete switche
				if(exclusives[page][currentIndex].img_large.length > 1 && exclusives[page][currentIndex].img_small.length > 1){
					currentImg = $("a[id^='otherview_"+currentIndex+"']").children('img').attr('src').replace("_img/","");
					if(currentImg == exclusives[page][currentIndex].img_small[0]){
						$("a[id^='otherview_"+currentIndex+"']").children('img').attr('src',"_img/"+exclusives[page][currentIndex].img_small[1]);
						$("img[id^='img_"+currentIndex+"']").attr('src',"_img/"+exclusives[page][currentIndex].img_large[0]);
					}
				}
				
				if(page == "shoes"){ type = "shoes"; }
				if(page == "leathergoods"){ type = "handbags"; }
				if(page == "ready-to-wear"){ type = "RTW"; }

				calltracking('Exclusives', type, type+' product page',type+' product page_'+productIndex);
			
				currentIndex = productIndex;
//				$.address.value(page/currentIndex);
			}
			
			return false;
		});
		
		$("#morePopin").children("a.closeMore").click(function(){
			$(this).parent().fadeOut();
			return false;
		});
		
		$("#sharePopin").children("a.closeShare").click(function(){
			$(this).parent().fadeOut();
			$("#share").css('display',"block");
			$("#share_message").css('display',"none");
			document.getElementById("share_form").reset();
			
			return false;
		});
		
		// share
		sendShare = function(myForm){

			if(myForm.product_type.value == "shoes"){ type = "shoes"; }
			if(myForm.product_type.value == "bags"){ type = "handbags"; }
			if(myForm.product_type.value == "wear"){ type = "RTW"; }

			calltracking('Exclusives', type, type+' product page share send',type+' product page share send_'+myForm.product_id.value);
			$.ajax({
				   type: "POST",
				   url: "share.php",
				   data: $("#share_form").serialize(),
				   success: function(){
						$("#share").css('display',"none");
						$("#share_message").css('display',"block");
						calltracking('Exclusives', type, type+' product page share thank you','');
				   }
			});
			return false;
		}
		
		//recupère id et switch
		address = $.address.value().split('/');
		if(address[2]){
			$("a[id^='switch_"+address[2]+"']").click();
		}
	}
	
	
	
	
	
	/************* FONCTION DE SLIDESHOW ***************/
	
	if(page == "information"){
		var boucleslide = 0 ;
		
		$('#slideimage').at_intervals(
			function(){
				$('#slideimage').attr('src',"_img/"+information['slide'][boucleslide]);
				
				if (information['slide'][boucleslide+1]){
					boucleslide++;
					}else{
					boucleslide = 0;
				}
			}
			,
			{ name: "slide", delay: 2000 }
		
		);
	}
	/***  ***************************************** **/
	
	
	
	
	/** EVENTS **/
	if(page == "events"){
		//function ejs_nodroit() { alert('Interdit de copier les éléments du site - Tous droits réservés.'); return(false); } 
		//document.oncontextmenu = ejs_nodroit;
		
		randomEvents();
		$(".events").css('visibility',"visible");
	}
	
	/** REGISTER **/
	if(page == "register"){
		sendRegister = function(myForm){
			if(!myForm.BOUTIQUE_SOHO.checked && !myForm.FASHION_ACCESSORIES.checked && !myForm.FRAGRANCE_BEAUTY.checked && !myForm.JEWELRY_WATCHES.checked){
				$(myForm.BOUTIQUE_SOHO).addClass('error');
				$(myForm.FASHION_ACCESSORIES).addClass('error');
				$(myForm.FRAGRANCE_BEAUTY).addClass('error');
				$(myForm.JEWELRY_WATCHES).addClass('error');
				$('#checkrequired').css('border','1px solid red');
				calltracking('Register', 'Register form error', '', '');
				return false;
				
			}
			
			//alert('plop');
			
			myf = document.getElementById('myframe2');
			myf = myf.contentWindow.document || myf.contentDocument;
			myf_form = myf.getElementById('register');
			
			register_form = document.getElementById('register');
			
			//alert(myf.getElementById('register').required.value);
			myf_form.required.value = register_form.required.value;
			myf_form.a.value = register_form.a.value;
			myf_form.n.value = register_form.n.value;
			myf_form.t.value = register_form.t.value;
			myf_form.o.value = register_form.o.value;
			myf_form.aid.value = register_form.aid.value;
			myf_form.CAMPAIGN_SOURCE.value = register_form.CAMPAIGN_SOURCE.value;
			myf_form.BOUTIQUE_SOHO.value = register_form.BOUTIQUE_SOHO.value;
			myf_form.BOUTIQUE_SOHO.checked = register_form.BOUTIQUE_SOHO.checked;
			
			
			myf_form.FNAME.value = register_form.FNAME.value;
			myf_form.FASHION_ACCESSORIES.value = register_form.FASHION_ACCESSORIES.value;
			myf_form.FASHION_ACCESSORIES.checked = register_form.FASHION_ACCESSORIES.checked;
			myf_form.LNAME.value = register_form.LNAME.value;
			myf_form.FRAGRANCE_BEAUTY.value = register_form.FRAGRANCE_BEAUTY.value;
			myf_form.FRAGRANCE_BEAUTY.checked = register_form.FRAGRANCE_BEAUTY.checked;
			myf_form.email.value = register_form.email.value;
			myf_form.JEWELRY_WATCHES.value = register_form.JEWELRY_WATCHES.value;
			myf_form.JEWELRY_WATCHES.checked = register_form.JEWELRY_WATCHES.checked;
			myf_form.ZIP.value = register_form.ZIP.value;
			myf_form.COUNTRY.value = register_form.COUNTRY.value;
			
			//document.getElementById('myframe2').contentWindow['submitForm']();
			//myf.Forms[0].submit();
			//myf.register.submit();
			//parent.myFrame.document.register_form.submit();
			//myf_form.submit();
			parent.myframe.submitForm();
			
		/*
			$.ajax({
				   type: "POST",
				   url: "index.php?p=register_submit",
				   data: $("#register").serialize(),
				   success: function(){
						$("#register2").css('display',"none");
						$("#register_thanks").css('display',"block");
						
						calltracking('Exclusives', 'Register form thank you', 'Handbag product page share send', 'Handbag product page share send');
						
				   }
			});*/
			$("#register2").css('display',"none");
			$("#register_thanks").css('display',"block");
			
			calltracking('Register', 'Register form thank you', '', '');
			
			
			return false;
		
		}
	}
	
	/** SOHO BY KARL **/
	if(page == "soho-by-karl"){
		$("#footer div.cell_1_2").removeClass("cell_1_2").addClass("cell_1_1");
	}else{
		$("#footer div.cell_1_1").removeClass("cell_1_1").addClass("cell_1_2");
	}
	
	/** GLOBAL **/
	// navigation active
	$("#nav li").children("a").each(function(){
		href = $(this).attr('rel');
		if(page == href){
			$(this).parent("li").addClass("active");
		}else{
			$(this).parent("li").removeClass("active");
		}
	});
	
	// gestion des liens ajax   
	$("a[rel]").click(function(){
		href = $(this).attr('rel');
		tagtrends = $(this).attr('tag');
		
		
		$.address.value(href);
		return false;
	});
	
	// gestion des formulaires
	$("form").submit(function(){
		if(checkForm(this)){
			if(this.action){
				var formFunction = this.action.value;
				return window[formFunction](this);
			}else{
				return true;
			}
		}else{
			if($("#register")){
				calltracking('Register', 'Register form error', '', '');
			}
			return false;
		}
	});
	
	// Croix Close
	$("a.close").click(function(){
		//$("body").children(".fond_gris").css('display',"none");
		$(".fond_gris").css('display',"none");
		$(this).parent().css('visibility',"hidden");
		return false;
	});
	
	$("a.closeVideo").click(function(){
		$(".fond_gris").css('display',"none");
		$("#inline_popup").css('visibility',"hidden");
		return false;
	});
	
	/* IE6 CSS HOVER FIX */
	if($.browser.msie && $.browser.version < 7)
	{
		//parseStylesheets('menu_top');
		fondgrisFix();
		if($('#global').height() < 580){
			$("#global").css('height',"580px");
		}else if($('#global').height() > 580){
			$("#footer").css('top',$('#global').height()-116+"px")
		}
		
		if(page == "soho-by-karl"){
			$("#footer").css('top',3016-116+"px")
		}
		
	} 
	
	try{
		calltracking ($('#cat').val(), $('#scat1').val(), $('#scat2').val(), $('#prod').val());
	}catch(e){}
	//alert($('#cat').val());
  // Danger : cufon ne supporte pas le line-height sur ie8 en doctype transitionna
  // register
  Cufon.replace('.bloc3x5', { fontFamily: 'Chanel Couture Reg', hover: true });
  // boutique info
  Cufon.replace('.bloc3x6', { fontFamily: 'Chanel Couture Reg', hover: true });
  // nav et footer
  Cufon.replace('.bloc', { fontFamily: 'Chanel Couture Smbd', hover: true });
  // texte descriptif
  Cufon.replace('.colorgrey', { fontFamily: 'Chanel Couture Reg', hover: true });
  // nav exclusive
  Cufon.replace('.exclu_bags', { fontFamily: 'Chanel Couture Smbd', hover: true });
  Cufon.replace('.exclu_shoes', { fontFamily: 'Chanel Couture Smbd', hover: true });
  Cufon.replace('.exclu_soho', { fontFamily: 'Chanel Couture Smbd', hover: true });
  Cufon.replace('.exclu_wear', { fontFamily: 'Chanel Couture Smbd', hover: true });
  // txt exclusive
  Cufon.replace('.soho_available', { fontFamily: 'Chanel Couture Reg', hover: true });
  Cufon.replace('.bloc1x2', { fontFamily: 'Chanel Couture Reg', hover: true });
  // bt detail
  Cufon.replace('.actionBtn', { fontFamily: 'Chanel Couture Smbd', hover: true });
  // txt infos detail
  Cufon.replace('.infos', { fontFamily: 'Chanel Couture Reg', hover: true });
  // Btnshare
  Cufon.replace('.moreBtn', { fontFamily: 'Chanel Couture Smbd', hover: true });
  // BtnMore
  Cufon.replace('.shareBtn', { fontFamily: 'Chanel Couture Smbd', hover: true });
  //Cufon.replace('.arialfont', { fontFamily: 'ArialFont' });
  Cufon.now();

  $('.detail').css('visibility' , 'hidden'); // on les caches ( cufont ne peut pas remplacer de textes hidden sous ie8, donc on remplace puis cache)

  //alert($(".arialfont").find("cufontext").text());
  $(".arialfont").each(function(){
	$(this).html($(this).find("cufontext").text())
	});
}

