/* ** scrollbar ** */
function makeScrollbar(content,scrollbar,handle,inside_scrollbar,horizontal,ignoreMouse, hidden){
		
		//if((inside_scrollbar.getSize().y > content.getSize().y) || (hidden == false)){
			
			var steps = (horizontal?(content.getScrollSize().x - content.getSize().x):(content.getScrollSize().y - content.getSize().y))
			var slider = new Slider(scrollbar, handle, {	
				steps: steps,
				mode: (horizontal?'horizontal':'vertical'),
				onChange: function(step){
							var x = (horizontal?step:0);
							var y = (horizontal?0:step);
							content.scrollTo(x,y);
				}
			}).set(0);
			if( !(ignoreMouse) ){
							$$(content, scrollbar).addEvent('mousewheel', function(e){	
								e = new Event(e).stop();
								var step = slider.step - e.wheel * 30;	
								slider.set(step);					
							});
			}
			$(document.body).addEvent('mouseleave',function(){slider.drag.stop()});
		//}else{ 
		//	scrollbar.setStyle('display', 'none');
		//}
}



/* ** recup param GET ** */
function $get(key,url){  
    if(arguments.length < 2) url =location.href;  
    if(arguments.length > 0 && key != ""){  
        if(key == "#"){  
            var regex = new RegExp("[#]([^$]*)");  
        } else if(key == "?"){  
            var regex = new RegExp("[?]([^#$]*)");  
        } else {  
            var regex = new RegExp("[?&]"+key+"=([^&#]*)");  
        }  
        var results = regex.exec(url);  
        return (results == null )? "" : results[1];  
    } else {  
        url = url.split("?");  
        var results = {};  
            if(url.length > 1){  
                url = url[1].split("#");  
                if(url.length > 1) results["hash"] = url[1];  
                url[0].split("&").each(function(item,index){  
                    item = item.split("=");  
                    results[item[0]] = item[1];  
                });  
            }  
        return results;  
    }  
}  


/* ** la var isLoaded permet de bloquer l'affichage de la sous nav tant que le flash de home n'est pas charg�. ** */
var isLoaded = false;
function swfLoaded(){ isLoaded = true; }




/* ** insertion Flash Sound ** */
var flashvarsSound =	{};
var paramsSound = { bgcolor : "#000000", allowScriptAccess:"always" }
var attributesSound = {};

swfobject.embedSWF("../scripts/swf/sound.swf", "flashSound", "51", "13", "9.0.0", "expressInstall.swf", flashvarsSound, paramsSound, attributesSound);




/* ** Google Analytics ** */
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

try {
	var pageTracker = _gat._getTracker("UA-7625923-2");
	pageTracker._trackPageview();
} catch(err) {}






window.addEvent('domready', function(){	
	
	ajaxEverybody();
    fbfriends();
    
	/* ** update mootools du coeur de page ** */
	
	/***************************************************/
	/* ** Ajax Part  ** */
	/***************************************************/
	
	function updateContent(url, tracker, hash){
		var req = new Request.HTML({
			evalScripts : true,
			evalResponse : true,
			url:url, 
			
			
			onRequest: function(){
				if(Browser.Engine.name != 'gecko'){ window.location.hash = hash;}
				$('content').getElement('div').set('html', '<div class="height522" style="margin-top:2px;"><div id="decoration"></div><p class="txtC"><img src="/images/loading.gif" class="marginT85"/></p></div>');
			},
			
			onSuccess: function(response) {
				$('content').getElement('div').set('text', '');
				var elt = new Element('div', {id : 'container'});
				elt.adopt(response);
				var clone = elt.getElement('.clone');
				$('content').getElement('div').adopt(clone);
				
				updateContent = function(){};
				if((hash != '') && (Browser.Engine.name == 'gecko')) window.location.hash = hash;
				
				window.removeEvent('domready');
				window.fireEvent('domready');
				
				if(tracker == "interview") displayLayer($('interview'));
				if(tracker == "backstage") displayLayer($('backstage'));
				if(tracker == "pre-collection") displayLayer($('precollection'));
				
				var pageTracker = _gat._getTracker("UA-7625923-2");
				pageTracker._trackPageview('/'+tracker);
				
			},
			
			onFailure: function() {
				//$('content').set('text', 'The request failed.');
				var pageTracker = _gat._getTracker("UA-7625923-2");
				pageTracker._trackPageview('/'+tracker);
				
				window.location = url+""+hash;
			}
		}).send();
	}
	
	
	
	/* affichage layer auto  */
	function displayLayer(elt){ 
		elt.getElement('a').fireEvent('click');
	}
	
	
	
	
	/* ** event perso pour relancer le son ** */
	window.addEvent('playSound', function(){
		try{
			$('flashSound').playSound();
		}catch(e) {}
		return false;
	});
	
	
	
	
	
	var flashDita = $('flashDita');
	
	/* ** blocage de la nav  ** */
	!flashDita ? isLoaded = true : isLoaded = true;
	
	
	/* ** insertion Flash Home ** */
	var urlFlash = "";

	var flashvars =	{
		xmlFile:"../scripts/xml/es.xml",
		pathSWF:"../scripts/swf/",
		wait:"7"
	};

	var params = {
		bgcolor:"#000000",
		wmode : "transparent"
	}

	var attributes = {
		id:"flashDita",
		name:"flashDita"
	};

	if(flashDita) swfobject.embedSWF("../scripts/swf/loading.swf", "flashDita", "980", "524", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
	
	
	/* ** target blank javascript ** */
	$$(".external").set("target","_blank");

	
	
	/* **  custom implementation : fadein/out  ** */
	Element.implement({
        show: function() { this.setStyle('display',''); },
        hide: function() { this.setStyle('display','none'); },
		fadeIn: function() {this.fade('in'); },
        fadeOut: function() { this.fade('out'); }
    });
	
	
	
	
	
	
	
	
	/***************************************************/
	/* ** Behind the scenes  ** */
	/***************************************************/
	
	/* ** behind the Scenes ** */
	var behind = $('behind');
	
	if(behind){
		
		/*
		var share = $$('.share');
		
		var elt = new Element('script', {
											src : 'http://w.sharethis.com/button/sharethis.js#publisher=90e4a14f-969d-4c71-9250-dd3e4ca729a7&amp;type=website&amp;popup=true&amp;embeds=true&amp;send_services=email',
											type : 'text/javascript'
		});
		
		//share.set("html", unescape("%3Cscript src='' type='text/javascript'%3E%3C/script%3E"));
		share.inject(elt);
		*/
		
		var timerLayerFunction = function(url){
			subnavBehind.fadeOut();
			//$clear(timerLayer);
			
			TB_init();
			TB_show("", url, "");
			
			try{
				$('flashSound').stopSound();
			}catch(e) {}
			return false;
		}
		
		var timerLayer;
		
		$('precollection').getElement('a').addEvents({
				'click' : function(e){ 
					//timerLayer = timerLayerFunction.periodical(500, this, "layer-collection.html?keepThis=true&TB_iframe=true&height=567&width=764"); 
					timerLayerFunction("layer-collection.html?keepThis=true&TB_iframe=true&height=567&width=764");
				}
		});
		
		$('backstage').getElement('a').addEvents({
				'click' : function(e){ 
					//timerLayer = timerLayerFunction.periodical(500, this, "layer-backstage.html?keepThis=true&TB_iframe=true&height=567&width=764"); 
					timerLayerFunction("layer-backstage.html?keepThis=true&TB_iframe=true&height=567&width=764");
				}
		});
		
		$('interview').getElement('a').addEvents({
				'click' : function(e){ 
					//timerLayer = timerLayerFunction.periodical(500, this, "layer-interview.html?keepThis=true&TB_iframe=true&height=567&width=764"); 
					timerLayerFunction("layer-interview.html?keepThis=true&TB_iframe=true&height=567&width=764");
				}
		});
		
	}
	
	
	
	
	
	
	
	
	/***************************************************/
	/* ** Nav Part  ** */
	/***************************************************/
	
	var nav = $('nav');
	
	var subnavCollection = $('subnavCollection');
	var subnavBehind = $('subnavBehind');
	
	var handlerSubnavCollection = $$(".collection");
	var handlerSubnavBehind = $$(".behind");
	
	subnavCollection.hide();
	subnavBehind.hide();
	
	
	
	
	if(handlerSubnavCollection && handlerSubnavBehind){
		
		nav.getElements('li > a').each(function(li){
			li.addEvents({
				'mouseenter' : function(){ 
					$clear(timerBehind);
					$clear(timerCollection);
					if(!this.hasClass('behind') && !this.hasClass('collection')){
						subnavCollection.fadeOut();
						subnavBehind.fadeOut();
					}
				},
				
				'click' : function(){
					nav.getElements('li > a').each(function(li){  (li.getParent().hasClass('active')) ? li.getParent().removeClass('active') : null; });
					li.getParent().addClass('active');
				}
			});
		});
		
		
		handlerSubnavCollection.addEvents({
			'mouseenter' : function(){ 
				if(isLoaded == true){
					subnavCollection.show();
					subnavCollection.set('opacity', '0');
					subnavCollection.fadeIn(); 
					subnavBehind.fadeOut();
				}
			}
		});
		
		
		handlerSubnavBehind.addEvents({
			'mouseenter' : function(){ 
				if(isLoaded == true){
					subnavBehind.show();
					subnavBehind.set('opacity', '0');
					subnavBehind.fadeIn(); 
					subnavCollection.fadeOut(); 
				}
			}
		});
		
		
		//subnavCollection.addEvents({ 'mouseleave' : function(){ this.fadeOut(); } });
		//subnavBehind.addEvents({ 'mouseleave' : function(){ this.fadeOut(); } });
		
		/* ** Timer ** */
		var timerBehindFunction = function(){
			subnavBehind.fadeOut();
			$clear(timerBehind);
		}
		
		var timerCollectionFunction = function(){
			subnavCollection.fadeOut();
			$clear(timerCollection);
		}
		
		var timerBehind = timerBehindFunction.periodical(1000);
		var timerCollection = timerCollectionFunction.periodical(1000);
		$clear(timerBehind);
		$clear(timerCollection);
		
		subnavCollection.addEvents({ 
			'mouseenter' : function(){ $clear(timerCollection); }, 
			'mouseleave' : function(){ timerCollection = timerCollectionFunction.periodical(1000); }
		});
		subnavBehind.addEvents({ 
			'mouseenter' : function(){ $clear(timerBehind); }, 
			'mouseleave' : function(){ timerBehind = timerBehindFunction.periodical(1000); } 
		});

		
		
		
		/* ** Flash communication ** */
	
		/* ** removeEvents si passage home ** */
		nav.getElements('a').each(function(a){
			a.removeEvents('mouseover');
			a.removeEvents('mouseleave');
		});
		
		subnavCollection.getElements('a').each(function(a){
			a.removeEvents('mouseover');
			a.removeEvents('mouseleave');
		});
		
		subnavBehind.getElements('a').each(function(a){
			a.removeEvents('mouseover');
			a.removeEvents('mouseleave');
		});
	
		if(flashDita && ((window.location.hash == "") || (window.location.hash == "#/_"))){
			$$('.mauveSatine').addEvents({ 'mouseover' : function(){$('flashDita').animNav(1); return false; }, 'mouseleave' : function(){ $('flashDita').animNavOut(1); return false; } });
			$$('.redSatine').addEvents({ 'mouseover' : function(){ $('flashDita').animNav(4); return false; }, 'mouseleave' : function(){ $('flashDita').animNavOut(4); return false; } });
			$$('.sparkleTeese').addEvents({ 'mouseover' : function(){ $('flashDita').animNav(3); return false; }, 'mouseleave' : function(){ $('flashDita').animNavOut(3); return false;} });
			$$('.multiTeese').addEvents({ 'mouseover' : function(){  $('flashDita').animNav(2); return false; }, 'mouseleave' : function(){ $('flashDita').animNavOut(2); return false; } });
			$$('.where').addEvents({ 'mouseover' : function(){ $('flashDita').animNav(6); return false; }, 'mouseleave' : function(){ $('flashDita').animNavOut(6); return false; } });
			$$('.goodies').addEvents({ 'mouseover' : function(){ $('flashDita').animNav(7); return false; }, 'mouseleave' : function(){ $('flashDita').animNavOut(7); return false; } });
			$$('.news').addEvents({ 'mouseover' : function(){ $('flashDita').animNav(5); return false; }, 'mouseleave' : function(){ $('flashDita').animNavOut(5); return false;} });
			$$('.behind').addEvents({ 'mouseover' : function(){  $('flashDita').animNav(8); return false; }, 'mouseleave' : function(){ $('flashDita').animNavOut(8); return false; } });
		}
	
	
	}
	
	
	
	
	
	/***************************************************/
	/* ** Scrollbars  ** */
	/***************************************************/
	
	/* ** custom scroll everybody part  ** */
	var scrollbarFriends = $('scrollbarFriends');
	
	if(scrollbarFriends) makeScrollbar( $('friends'), $('scrollbarFriends'), $('handle-scrollbarFriends'), $('inside_scrollFriends') );
	
	/* ** custom scroll Mentions ** */
	var scrollbarMentions = $('mentionsScrollbar');
	
	if(scrollbarMentions) makeScrollbar( $('mentionsScrollable'), $('mentionsScrollbar'), $('handle-mentionsScrollbar'), $('mentionsInsideScroll') );
	
	/* ** custom scroll spotlight ** */
	var scrollbarSpotlight = $('spotlightScrollbar');
	
	if(scrollbarSpotlight) makeScrollbar( $('spotlightScrollable'), $('spotlightScrollbar'), $('handle-spotlightScrollbar'), $('spotlightInsideScroll') );
	
	/* ** custom scroll where ** */
	var scrollbarWhere = $('whereScrollbar');
	
	if(scrollbarWhere) makeScrollbar( $('whereScrollable'), $('whereScrollbar'), $('handle-whereScrollbar'), $('whereInsideScroll') );
	
	
	
	/***************************************************/
	/* ** Countries list  ** */
	/***************************************************/
	
	/* ** Countries Part  ** */
	var countries = $('countries');
	var handlerCountries = $('countriesHandler');
	
	
	if(handlerCountries){
		handlerCountries.addEvents({
			'mouseenter' : function(){ 
				countries.show(); 
				countries.set('opacity', '0'); 
				countries.fadeIn(); 
			}
		});
		
		countries.addEvents({
			'mouseleave' : function(){ 
				countries.hide(); 
			}
		});
		
	}
	
	countries.hide();
	
	
	
	
	/***************************************************/
	/* ** tabs  ** */
	/***************************************************/
	
	/* ** tabs ** */
	var tab = $('tabs');
	var tabs = tab.getElements('ul li a');
	
	tabs.each(function(tab){
		tab.addEvents({
			'click' : function(){
				$$('.tab').addClass('dNone');
				$$('ul li a').removeClass('active');
				this.addClass('active');
				$(this.get('rel')).removeClass('dNone');
			}
		});
	});
	
	
	
	/***************************************************/
	/* ** Collection  ** */
	/***************************************************/
	
	/* **  collection rollovers ** */
	var mirrors = $$('.mirror');
	
	if(mirrors){
		
		$$('#range1', '#range2', '#range3', '#range4').hide();
		
		mirrors.each(function(mirror){
			
			var a = mirror.getElement('a');
			
			a.addEvents({
				'mouseover' : function(){
					$(this.get('rel')).show();
					//$(this.get('rel')).set('opacity', '0');
					//$(this.get('rel')).fadeIn();
				},
				'mouseout' : function(){
					//$(this.get('rel')).fadeOut();
					$(this.get('rel')).hide();
				}
			});
		});
	}
	
	
	
	
	/***************************************************/
	/* ** Goodies  ** */
	/***************************************************/
	
	/* ** goodies part  ** */
	var goodies = $('goodies');
	var rolls = $$('.roll');
	var wallpapers = $$('#wallpaper1, #wallpaper2, #wallpaper3, #wallpaper4');
	var portraits = $$('#frise a');
	var iteese = $('iteeseOn');
	
	if(goodies){
		
		rolls.hide();
		iteese.hide();
		
		$('iteeseBlock').getElement('a').addEvents({
			'mouseenter' : function(){
					iteese.show();
					iteese.set('opacity', '0');
					iteese.fadeIn();
			},
			'mouseleave' : function(){
					iteese.fadeOut();
			}
		});
		
		wallpapers.each(function(wallpaper){
			
			wallpaper.addEvents({
				'mouseenter' : function(){
					this.getElement('.roll').show();
					this.getElement('.roll').set('opacity', '0');
					this.getElement('.roll').fadeIn();
				},
				'mouseleave' : function(){
					this.getElement('.roll').fadeOut();
				}
			});
		});
		
		
		if ((Browser.Engine.trident) && (Browser.Engine.version == 4)){
			var cpt = -1.3;
		}else{
			var cpt = 0;
		}

		
		portraits.each(function(portrait){
			
			portrait.setStyles({
				'position' : 'absolute',
				'left' : cpt*48+"px", 
				'top' : '0px',
				'z-index' : 100-cpt
			});
			
			cpt++;
			
			var left = portrait.getStyle('left').toInt();
			
			portrait.addEvents({
				'mouseenter' : function(){
					var myEffect = new Fx.Morph(this.getElement('img'), {duration: 'short', transition: Fx.Transitions.Sine.easeOut});
					var myEffectContainer = new Fx.Morph(this, {duration: 'short', transition: Fx.Transitions.Sine.easeOut});
					myEffectContainer.start({ 'top': -3,  'left': left-4 });
					myEffect.start({ 'height': 60,  'width': 50 });

				},
				'mouseleave' : function(){
					var myEffect = new Fx.Morph(this.getElement('img'), {duration: 'short', transition: Fx.Transitions.Sine.easeOut});
					var myEffectContainer = new Fx.Morph(this, {duration: 'short', transition: Fx.Transitions.Sine.easeOut});
					myEffectContainer.start({ 'top': 0,  'left': left });
					myEffect.start({ 'height': 56,  'width': 43 })
				}
			
			});
			
		});
		
	}
	
	
	
	
	
	
	
	
	
	
	
	/* ** handler pour lancer les request ** */
	
	/* Nav */
	$('nav').getElement('li').getElement('a').addEvent('click', function(e) { new Event(e).stop(); updateContent('home.html', 'home', '#/_'); });
	$$('.collection').addEvent('click', function(e) { new Event(e).stop(); updateContent('the-collection.html', 'the-collection', ''); });
	$$('.behind').addEvent('click', function(e) { new Event(e).stop(); updateContent('behind-the-scene.html', 'behind-the-scene', ''); });
	$$('.news').addEvent('click', function(e) { new Event(e).stop(); updateContent('in-the-news.html', 'in-the-news', ''); });
	$$('.goodies').addEvent('click', function(e) { new Event(e).stop(); updateContent('goodies.html', 'goodies', ''); });
	$$('.where').addEvent('click', function(e) { new Event(e).stop(); updateContent('where-to-buy.html', 'where-to-buy', ''); });
	if($('wonderbra')) $('wonderbra').getElement('a').addEvent('click', function(e) { new Event(e).stop(); updateContent('home.html', 'home-logo-wonderbra', '#/_'); });
	
	
	$('iteeseDiscover').addEvent('click', function(e) { 
		new Event(e).stop();
		nav.getElements('a').each(function(li){  (li.getParent().hasClass('active')) ? li.getParent().removeClass('active') : null; });
		$$('.goodies').getParent().addClass('active');
		updateContent('goodies.html', 'discover-iTeese', ''); 
	});
	
	/* Sous nav collection */
	$$('.mauveSatine').addEvent('click', function(e) { 
		new Event(e).stop(); 
		nav.getElements('a').each(function(li){  (li.getParent().hasClass('active')) ? li.getParent().removeClass('active') : null; });
		$$('.collection').getParent().addClass('active');
		updateContent('home.html', 'mauve-satine', '#/mauveSatineTeese'); 
	});
	$$('.redSatine').addEvent('click', function(e) { 
		new Event(e).stop(); 
		nav.getElements('a').each(function(li){  (li.getParent().hasClass('active')) ? li.getParent().removeClass('active') : null; });
		$$('.collection').getParent().addClass('active');
		updateContent('home.html', 'red-satine', '#/satineTeeseRed'); 
	});
	$$('.sparkleTeese').addEvent('click', function(e) { 
		new Event(e).stop(); 
		nav.getElements('a').each(function(li){  (li.getParent().hasClass('active')) ? li.getParent().removeClass('active') : null; });
		$$('.collection').getParent().addClass('active');
		updateContent('home.html', 'sparkling-teese', '#/sparklingTeese'); 
	});
	$$('.multiTeese').addEvent('click', function(e) { 
		new Event(e).stop(); 
		nav.getElements('a').each(function(li){  (li.getParent().hasClass('active')) ? li.getParent().removeClass('active') : null; });
		$$('.collection').getParent().addClass('active');
		updateContent('home.html', 'multi-teese', '#/multiTeese'); 
	});
	
	
	/* Sous nav behind the scene  */
	$$('.preCollection').addEvent('click', function(e) { 
		new Event(e).stop(); 
		nav.getElements('a').each(function(li){  (li.getParent().hasClass('active')) ? li.getParent().removeClass('active') : null; });
		$$('.behind').getParent().addClass('active');
		updateContent('behind-the-scene.html', 'pre-collection', ''); 
	});
	$$('.backstage').addEvent('click', function(e) { 
		new Event(e).stop(); 
		nav.getElements('a').each(function(li){  (li.getParent().hasClass('active')) ? li.getParent().removeClass('active') : null; });
		$$('.behind').getParent().addClass('active');
		updateContent('behind-the-scene.html', 'backstage', ''); 
	});
	$$('.interview').addEvent('click', function(e) { 
		new Event(e).stop(); 
		nav.getElements('a').each(function(li){  (li.getParent().hasClass('active')) ? li.getParent().removeClass('active') : null; });
		$$('.behind').getParent().addClass('active');
		updateContent('behind-the-scene.html', 'interview', ''); 
	});
	$$('.spotlight').addEvent('click', function(e) { 
		new Event(e).stop(); 
		nav.getElements('a').each(function(li){  (li.getParent().hasClass('active')) ? li.getParent().removeClass('active') : null; });
		$$('.behind').getParent().addClass('active');
		updateContent('in-the-spotlight.html', 'spotlight', ''); 
	});
	
	
	
	
	/* mentions  */
	$$('.mentionsHome').addEvent('click', function(e) { 
		new Event(e).stop(); 
		nav.getElements('a').each(function(li){  (li.getParent().hasClass('active')) ? li.getParent().removeClass('active') : null; });
		updateContent('home.html', 'mentions-home', '#/_'); 
	});
	$$('.mentionsMauveSatine').addEvent('click', function(e) { 
		new Event(e).stop(); 
		nav.getElements('a').each(function(li){  (li.getParent().hasClass('active')) ? li.getParent().removeClass('active') : null; });
		$$('.collection').getParent().addClass('active');
		updateContent('home.html', 'mentions-mauve-satine', '#/mauveSatineTeese'); 
	});
	$$('.mentionsredSatine').addEvent('click', function(e) { 
		new Event(e).stop(); 
		nav.getElements('a').each(function(li){  (li.getParent().hasClass('active')) ? li.getParent().removeClass('active') : null; });
		$$('.collection').getParent().addClass('active');
		updateContent('home.html', 'mentions-red-satine', '#/satineTeeseRed'); 
	});
	$$('.mentionsSparkleTeese').addEvent('click', function(e) { 
		new Event(e).stop(); 
		nav.getElements('a').each(function(li){  (li.getParent().hasClass('active')) ? li.getParent().removeClass('active') : null; });
		$$('.collection').getParent().addClass('active');
		updateContent('home.html', 'mentions-sparkling-teese', '#/sparklingTeese'); 
	});
	$$('.mentionsMultiTeese').addEvent('click', function(e) { 
		new Event(e).stop(); 
		nav.getElements('a').each(function(li){  (li.getParent().hasClass('active')) ? li.getParent().removeClass('active') : null; });
		$$('.collection').getParent().addClass('active');
		updateContent('home.html', 'mentions-multi-teese', '#/multiTeese'); 
	});
	$$('.mentionsBehind').addEvent('click', function(e) { 
		new Event(e).stop(); 
		nav.getElements('a').each(function(li){  (li.getParent().hasClass('active')) ? li.getParent().removeClass('active') : null; });
		$$('.behind').getParent().addClass('active');
		updateContent('behind-the-scene.html', 'mentions-behind', ''); 
	});
	$$('.mentionsGoodies').addEvent('click', function(e) { 
		new Event(e).stop(); 
		nav.getElements('a').each(function(li){  (li.getParent().hasClass('active')) ? li.getParent().removeClass('active') : null; });
		$$('.goodies').getParent().addClass('active');
		updateContent('goodies.html', 'mentions-goodies', ''); 
	});
	
	
	
	/* footer */
	$('sitemapLink').addEvent('click', function(e) { new Event(e).stop(); updateContent('sitemap.html', 'sitemap', ''); });
	$('mentionsLink').addEvent('click', function(e) { new Event(e).stop(); updateContent('mentions.html', 'mentions', ''); });
	
	/* interview block */
	$('interviewLink').addEvent('click', function(e) { new Event(e).stop(); updateContent('behind-the-scene.html', 'interview', ''); });
	
	/* page in the spotlight  */
	if($('spotlightInterview')) $('spotlightInterview').addEvent('click', function(e) { new Event(e).stop(); updateContent('behind-the-scene.html', 'interview', ''); });

	
	/* page sitemap */
	if($('sitemap')){
		$$('.sitemapCollection').each(function(a){ a.addEvent('click', function(e) { new Event(e).stop(); updateContent('the-collection.html', 'sitemap-collection', ''); }); });
		$$('.sitemapRedSatine').each(function(a){ a.addEvent('click', function(e) { new Event(e).stop(); updateContent('home.html', 'sitemap-red-satine', '#/satineTeeseRed'); }); });
		$$('.sitemapMauveSatine').each(function(a){ a.addEvent('click', function(e) { new Event(e).stop(); updateContent('home.html', 'sitemap-mauve-satine', '#/mauveSatineTeese'); }); });
		$$('.sitemapMulti').each(function(a){ a.addEvent('click', function(e) { new Event(e).stop(); updateContent('home.html', 'sitemap-multi-teese', '#/multiTeese');  }); });
		$$('.sitemapSparkling').each(function(a){ a.addEvent('click', function(e) { new Event(e).stop(); updateContent('home.html', 'sitemap-sparkling-teese', '#/sparklingTeese');  }); });
		$$('.sitemapBehind').each(function(a){ a.addEvent('click', function(e) { new Event(e).stop(); updateContent('behind-the-scene.html', 'sitemap-behind', '');  }); });
		$$('.sitemapNews').each(function(a){ a.addEvent('click', function(e) { new Event(e).stop(); updateContent('in-the-news.html', 'sitemap-news', '');  }); });
		$$('.sitemapGoodies').each(function(a){ a.addEvent('click', function(e) { new Event(e).stop(); updateContent('goodies.html', 'sitemap-goodies', '');  }); });
		$$('.sitemapWhere').each(function(a){ a.addEvent('click', function(e) { new Event(e).stop(); updateContent('where-to-buy.html', 'sitemap-where', '');  }); });
	}
	
	
	/* page collection */
	if($('collection')){
		$('range1Link').addEvent('click', function(e) { new Event(e).stop(); updateContent('home.html', 'collection-multiTeese', '#/multiTeese'); });
		$('range2Link').addEvent('click', function(e) { new Event(e).stop(); updateContent('home.html', 'collection-satineTeesered', '#/satineTeeseRed'); });
		$('range3Link').addEvent('click', function(e) { new Event(e).stop(); updateContent('home.html', 'collection-satineTeeseMauve', '#/mauveSatineTeese'); });
		$('range4Link').addEvent('click', function(e) { new Event(e).stop(); updateContent('home.html', 'collection-sparkleTeese', '#/sparklingTeese'); });
	}
	
	
	/* page behind */
	if($('behind')){
		$('inspotlight').getElement('a').addEvent('click', function(e) { new Event(e).stop(); updateContent('in-the-spotlight.html', 'behind-in-the-spotlight', ''); });
	}
	
	
	
	
	
	
	
	
	
	
});






