﻿/*
	\\\\---------------------------------------------
	//// 	Default javascript SHARED functions based on jquery
	\\\\ 	2008 © Coded by : Damien Virot - Certifié Conforme
	////---------------------------------------------
*/

function pagedata() {
	$('#page-ombre').animate({top:'285px',left:'507px'},500);
	$('#page-data').animate({top:'320px',left:'544px'},500, function() {
		$('#page-ombre').css('z-index','22');
		$('#page-data').css('z-index','27');
		$('#page-ombre').animate({top:'283px',left:'467px'},800);
		$('#page-data').animate({top:'320px',left:'504px'},800, function() {
			$('#tape2').show('blind',{direction:'horizontal',duration:200});
			$('#page-data').css('overflow','hidden');
		});
	});
}

function appear(i) {
	//alert(i);
	if(i!=24){
		$('#roadlegendes').css('height',''+i*50+'px');
		i++;
		setTimeout("appear("+i+")",50);
		if(i==18){
			$('#wrapper').animate({top:'-1150px'},1500,'jswing', function() { $('html').css('overflow','auto'); } );
		}
	}
}

function disappear(i) {
	//alert(i);
	if(i!=24){
		var sz = 1150-(i*50);
		$('#roadlegendes').css('height',''+sz+'px');
		i++;
		setTimeout("disappear("+i+")",20);
	}else{
		$('#maplegendes,#titrelegendes,.backlegendes').hide();
		$('html').css('overflow','auto');
	}
}

function replaceAll(str, search, repl) {
	while (str.indexOf(search) != -1)
	str = str.replace(search, repl);
	return str;
}

function AccentToNoAccent(str) {
	var norm = new Array('À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï', 'Ð','Ñ','Ò','Ó','Ô','Õ','Ö','Ø','Ù','Ú','Û','Ü','Ý','Þ','ß', 'à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ð','ñ', 'ò','ó','ô','õ','ö','ø','ù','ú','û','ü','ý','ý','þ','ÿ');
	var spec = new Array('A','A','A','A','A','A','A','C','E','E','E','E','I','I','I','I', 'D','N','O','O','O','0','O','O','U','U','U','U','Y','b','s', 'a','a','a','a','a','a','a','c','e','e','e','e','i','i','i','i','d','n', 'o','o','o','o','o','o','u','u','u','u','y','y','b','y');
	for (var i = 0; i < spec.length; i++)
		str = replaceAll(str, norm[i], spec[i]);
	return str;
}

function fifiche(author) {
	$('.sheet').html('<div id="loading"><p>&nbsp;</p><p>Recherche de la fifiche...</p><img src="../medias/core/imgs/ajax-loader.gif" width="220" height="19" alt="" /></div>');
	$.ajax({
		method: "get",url: "lanfeust.php",data: "page=inc_auteur&id_article="+author,
		success: function(html){
			$('#whos-page-slider #handle-container').slider('destroy');
			if($('#front-whos').css('left')=='289px') {
				//alert('ok');
				$(".sheet").html(html);
				$('#back-whos').animate({left:'177px'},500);
				$('#front-whos').animate({left:'189px'},500);
				$('#auteurs').animate({left:'290px'},500);
				$('#page-whos').animate({left:'565px'},500);
				$('.steel-whos').animate({left:'665px'},500);
				$('#whos-page-slider').animate({left:'925px'},500);
				$('#whos-auteurs-slider').animate({left:'565px'},500);
				$('#alphabet').animate({left:'290px'},500);
				$('#speller').animate({left:'535px'},500);
				$('.sheet').animate({left:'640px'},510, function() { 
					$('.closefile').show();
					if($('#sheetcontent').height()>355) {
						$('#whos-page-slider').fadeIn();
						var diff = $('#sheetcontent').height()-355;
						//alert(diff);
						$('#whos-page-slider #handle-container').slider({
							min: 0,
							max: diff,
							axis: 'vertical',
							handle: '.handle',
							stop: function (event, ui) {
								$('#sheetcontent').animate({'top' : ui.value * -1}, 500);
							},
							slide: function (event, ui) {
								$('#sheetcontent').css('top', ui.value * -1);
							}
						});
					}
				});
			}else{
				$('.closefile').hide();
				$('#whos-page-slider').hide();
				$('#back-whos').animate({left:'277px'},500);
				$('#front-whos').animate({left:'289px'},500);
				$('#auteurs').animate({left:'394px'},500);
				$('#page-whos').animate({left:'335px'},500);
				$('.steel-whos').animate({left:'485px'},500);
				$('#whos-page-slider').animate({left:'695px'},500);
				$('#whos-auteurs-slider').animate({left:'670px'},500);
				$('#alphabet').animate({left:'394px'},500);
				$('#speller').animate({left:'635px'},500);
				$('.sheet').animate({left:'415px'},510, function() {
					$(".sheet").html(html);
					$('#back-whos').animate({left:'177px'},500);
					$('#front-whos').animate({left:'189px'},500);
					$('#auteurs').animate({left:'290px'},500);
					$('#page-whos').animate({left:'565px'},500);
					$('.steel-whos').animate({left:'665px'},500);
					$('#whos-page-slider').animate({left:'925px'},500);
					$('#whos-auteurs-slider').animate({left:'565px'},500);
					$('#alphabet').animate({left:'290px'},500);
					$('#speller').animate({left:'535px'},500);
					$('.sheet').animate({left:'640px'},510, function() {  
						$('.closefile').show();
						if($('#sheetcontent').height()>355) {
							$('#whos-page-slider').fadeIn();
							var diff = $('#sheetcontent').height()-355;
							//alert(diff);
							$('#whos-page-slider #handle-container').slider({
								min: 0,
								max: diff,
								axis: 'vertical',
								handle: '.handle',
								stop: function (event, ui) {
									$('#sheetcontent').animate({'top' : ui.value * -1}, 500);
								},
								slide: function (event, ui) {
									$('#sheetcontent').css('top', ui.value * -1);
								}
							});
						}
					});
				});
			}
		}
	});
}

// Put all your code in your document ready area
jQuery(document).ready(function($){
								
	/*$('#galaxy-relative img').each( function() {
		$(this).hide();
		var thisw = $(this).metadata().w;
		var thish = $(this).metadata().h;
		$(this).css({width:thisw+'px',height:thish+'px'});
	});*/

	$('.fixme, .imgin em').ifixpng();
	
	if($('#drafts').size()>0) { swfobject.embedSWF('medias/flash/flashdrafts.swf', "drafts", '210', '300', "9.0.0", false, false, {wmode:'transparent'}); }
	
	$('.newstitre:eq(0)').css('color','');
	function onBefore() {
		$('.newsintro').hide();
		$('.'+$(this).metadata().shwn).show('blind',{direction:'vertical'});
	}
	$('#news-imgs').cycle({
		fx: 'shuffle',
		before: onBefore,
		timeout: 0, 
		pager:  '#news', 
		pagerAnchorBuilder: function(idx, slide) { 
			// return selector string for existing anchor 
			return '#news a.newstitre:eq(' + idx + ')'; 
		}
	});
	$('#lasts-imgs').cycle({
		fx: 'shuffle',
		before: onBefore,
		timeout: 0, 
		pager:  '#lasts', 
		pagerAnchorBuilder: function(idx, slide) { 
			// return selector string for existing anchor 
			return '#lasts a.newstitre:eq(' + idx + ')'; 
		}
	});
	/*$('.newsintro a,.allnews').click( function() {
		$('#backnews, #blocnews, #blocnews .newsdate, #blocnews .newstext').show();
		$('#wrapper-home,#wrapper').animate({top:'-1200px'},500, function() {
		});
	});*/
	
	$('#backnews a').click( function() {
		$('html').css('overflow','hidden');
		$('#wrapper-home,#wrapper').animate({top:'0'},500, function() {
			$('#backnews, #blocnews,.newsdate,.newstext').hide();
			$('html').css('overflow','auto');
		});
	});
	
	$('#galaxy-news-text a, #mag-news-text a').click( function() {
		$('.newsintro').hide();
		$(this).next('.newsintro').show('blind',{direction:'vertical'});
	});
	
	if($('#page-data').size()>0) {
		setTimeout("pagedata()", 100);
	}
		
	$('.reveal').click( function() {
		if($('#wrapper').css('top')=='0px') {
			$('#wrapper').animate({top:'230px'},500);
			$('.reveal').removeClass('reveal').addClass('closereveal');
		}else{
			$('#wrapper').animate({top:0},500);
			$('.closereveal').removeClass('closereveal').addClass('reveal');
		}
	});
	
	$('#galaxy-relative a').not('.legendes').hover( function() {
		var myimg = $(this).find('img');
		var thisleft = Math.round($(this).width()/2);
		myimg.css({width:myimg.metadata().w,height:myimg.metadata().h,top:'-54px',left:thisleft+'px'}).show();
	},function() {
		var myimg = $(this).find('img');
		myimg.css({width:1,height:1,top:0,left:0}).hide();
	});
	
	/*$('.ddd').click( function() {
		$('html').css('overflow','hidden');
		var docheight = $(document).height()+7;
		$('#wrapper').prepend('<div id="zoom_overlay" style="height:3000px;filter:alpha(opacity=40);-moz-opacity:0.4;opacity:0.4;background-color:#FFFFFF;position:absolute; top:-600px; left:-800px; width:5000px; z-index:90;"></div><a href="javascript:void(0)" id="closeseries" style="display:none;position:absolute;z-index:10000;top:130px;left:50px"><img src="medias/core/imgs/closemodal.gif" width="20" height="20" alt="" /></a>');
		$('#series-galaxy').animate({top:'120px'},1000,function() {	$('#closeseries').show(); });
		$('#closeseries').click( function() {
			$(this).remove();
			$('#series-galaxy').animate({top:'-700px'},1000, function() {
				$('#zoom_overlay').remove();
				$('html').css('overflow','auto');
			});
		});
	});*/
	
	$('#choose-stick .stickgalaxie').click( function() {
		$('#wrapper').prepend('<a href="javascript:void(0)" id="closeseries" style="display:none;position:absolute;z-index:10000;top:130px;left:50px"><img src="medias/core/imgs/closemodal.gif" width="20" height="20" alt="" /></a>');
		$('#back-series-galaxy').animate({top:'105px'},2000,'easeOutElastic');
		$('#series-galaxy').animate({top:'120px'},2000,'easeOutElastic',function() { $('#closeseries').show(); });
		$('#closeseries, .legendes').click( function() {
			$('#closeseries').remove();
			$('#back-series-galaxy').animate({top:'-796px'},1500,'easeInOutElastic');
			$('#series-galaxy').animate({top:'-780px'},1500,'easeInOutElastic');
		});
	});
	$('#choose-stick .sticklegendes, .legendes').click( function() {
		$('#wrapper').prepend('<a href="javascript:void(0)" id="closelegendes" style="display:none;position:absolute;z-index:10000;top:115px;left:20px"><img src="medias/core/imgs/closemodal.gif" width="20" height="20" alt="" /></a>');
		$('html').css('overflow','hidden');
		$('#piquet-legendes').show().animate({top:'30px'},2000,'easeInOutBounce');
		$('#series-maplegendes').show().animate({top:'110px'},2000,'easeInOutBounce',function() { $('#closelegendes').show(); });
		$('#closelegendes').click( function() {
			$(this).remove();
			$('#piquet-legendes').animate({top:'2500px'},1500,'easeOutQuad',function() { $(this).hide(); });
			$('#series-maplegendes').animate({top:'2580px'},1500,'easeOutQuad',function() { $(this).hide(); $('html').css('overflow','auto'); });
		});
	});
	
	$('.couv').hover( function() {
		$('.titre',this).show();
	}, function() {
		$('.titre',this).hide();
	});
	$('.showcv').mouseover( function() {
		$('.cvitae').hide();
		$(this).next().show();
	});
	$('.showcv').mouseout( function() {
		$(this).next().hide();
	});
	$('.closecv').click( function() {
		$('.cvitae').hide();
	});
	
	if($('.bboard div').size()>1) {
		$('.bboard').cycle();
	}else{
		$('.bboard div:first').show();
	}
	
		
//================ VISIONNEUSE DES PLANCHES DE LA SERIE ================	
//INIT toutes les planches en bas
	$('div.planche_couvs').css({position:'absolute',top:'1500px'});
//PREMIERCLICK SUR  VOIR LES PLANCHES toutes les planches en bas et affiche la premiere
	$('a.voir_planches').click(function() {
	$('div.planches_series').hide();	
	$('div.pages_book div.planche_couvs').css({position:'absolute',top:'1500px'});
	$('div.pages_book').show();
	num_planche=1;
	rel_idarticle = $(this).attr('rel'); 
	$('div.pages_book div.planche'+rel_idarticle+'-'+num_planche).show();
	$('div.pages_book div.planche'+rel_idarticle+'-'+num_planche).animate({top:'0'},1000,function() { $('div.quitter_planches_haut').show();$('div.quitter_planches_bas').show();});
	})
//DERNIER CLICK alors cache visionneuse
	$('div.pages_book div.planche_last a').click(function() {
	  $('div.pages_book').hide();
	  $('div.planches_series').show();	
	})
//ENCHAINEMENT anims des planches au click
	$('div.pages_book a').click(function() {
	  $('div.pages_book div.planche'+rel_idarticle+'-'+num_planche).animate({top:'1500'},1000);
	  num_planche++;
	  $('div.pages_book div.planche'+rel_idarticle+'-'+num_planche).animate({top:'0'},1000);
	})
//FERMER la visionneuse en cliquant sur fermer
	$('div.quitter_planches_haut a.fermer_planches').click(function() {
	  $('div.pages_book').hide();
	  $('div.planches_series').show();	
	})
//FERMER la visionneuse en cliquant sur fermer
	$('div.quitter_planches_bas a.fermer_planches').click(function() {
	  $('div.pages_book').hide();
	  $('div.planches_series').show();	
	})
//====================================================================
	
	
		
//================ VISIONNEUSE DES PLANCHES DE LA SERIE etoiles================	
//INIT toutes les planches en bas
	$('div.planche_couvsb').css({position:'absolute',top:'2500px'});
//PREMIERCLICK SUR  VOIR LES PLANCHES toutes les planches en bas et affiche la premiere
	$('a.voir_planchesb').click(function() {
	$('div.planches_series').hide();	
	$('div.pages_bookb div.planche_couvsb').css({position:'absolute',top:'2500px'});
	$('div.pages_bookb').show();
	num_planche=1;
	rel_idarticle = $(this).attr('rel'); 
	$('div.pages_bookb div.planche'+rel_idarticle+'-'+num_planche).show();
	$('div.pages_bookb div.planche'+rel_idarticle+'-'+num_planche).animate({top:'0'},1000,function() { $('div.quitter_planches_haut').show();$('div.quitter_planches_basb').show();});
	})
//DERNIER CLICK alors cache visionneuse
	$('div.pages_bookb div.planche_last a').click(function() {
	  $('div.pages_bookb').hide();
	  $('div.planches_series').show();	
	})
//ENCHAINEMENT anims des planches au click
	$('div.pages_bookb a').click(function() {
	  $('div.pages_bookb div.planche'+rel_idarticle+'-'+num_planche).animate({top:'2500'},1000);
	  num_planche++;
	  $('div.pages_bookb div.planche'+rel_idarticle+'-'+num_planche).animate({top:'0'},1000);
	})
//FERMER la visionneuse en cliquant sur fermer
	$('div.quitter_planches_haut a.fermer_planches').click(function() {
	  $('div.pages_bookb').hide();
	  $('div.planches_series').show();	
	})
//FERMER la visionneuse en cliquant sur fermer
	$('div.quitter_planches_basb a.fermer_planches').click(function() {
	  $('div.pages_bookb').hide();
	  $('div.planches_series').show();	
	})
//====================================================================
	
	
	
	
	
	
	
	
	
	
	

	

	//4 LIGNES POUR VOIR LES PRODUITS DERIVES AU DEPART DE LA PAGE PRODUITS DERIVES
	$('div#mot41').show();
	$('div#mot41 .pola').show();
	$('a.mot41').css('color','#666666');
	
	
	/*$('.proderives_series a').click( function() {
		alert($(this).attr('href'));
	});*/
	
	

	//4 LIGNES POUR VOIR LES CLIN DOEIL AU DEPART
	$('div.art121').show();
	$('div.art121 .pola').show();
	//$('a.art121').removeClass('galselect').addClass('galover');
	
	
	
	$('.proderives-data a').click( function() {
		$('#galery .interview_proderives:visible').hide();
		$('#'+$(this).attr('rel')).show();
		$('.pola').show();
		$('ul.liste_arts_mdt a').css('color','#000000');
		$(this).css('color','#666666');
	});


	
	//$('.art129').show();
	
	
	$('.galselect').click( function() {
		$('.galover').removeClass('galover').addClass('galselect');
		$('.link-showall').show();
		$('.pola').show();
		$(this).removeClass('galselect').addClass('galover');
		$('.pola').hide();
		$('.'+$(this).attr('rel')).show();
		//$('.art129').show();
	});
	
	$('.link-showall').click( function() {
		$('.galover').removeClass('galover').addClass('galselect');
		$('.pola').show();
		$(this).hide();
	});
	
	$('#page-data .titre').css('background-color',$('#tetiere').css('background-color'));
	
	$('.couv').not('.ecouv').click( function() {
		$('.couv').not(this).hide();
		$(this).addClass('actualcouv').css({width:'400px',height:'567px'});
		$('.cover',this).css({width:'400px',height:'567px'});
		$('.titre',this).removeClass('titre').hide();
		$('.etoiles').hide();
		$(this).prev().show();
		$('div.planches_series').hide();	
	});
	
	$('.coverdata .close').click( function() {
		$('.actualcouv .cover').css({width:'120px',height:'170px'});
		$('.actualcouv').css({width:'120px',height:'200px'}).removeClass('actualcouv');
		$('a[@name='+$(this).attr('href').substr(1,100)+']').children('span').addClass('titre');
		$(this).parent().hide();
		$('.couv,.etoiles').show();
		$('div.planches_series').show();
	});
	
	$('.pola').click( function() {
		$('.zoom').hide();
		$('.link-showall:visible').addClass('bugshow').hide();
		var lft = (900-$(this).metadata().l)/2;
		$('#wrapper').append('<div style="width:'+$(this).metadata().l+'px;display:block;position:absolute;top:180px;left:'+lft+'px;"><a href="#'+$(this).attr('name')+'" class="zoomback" style="display:block;padding:5px 0;text-transform:uppercase;font-weight:bold;color:#000000;text-align:center;">Retour &agrave; la galerie</a><div style="text-align:center;margin:0 auto 10px;padding:5px; background:#FFFFFF; border:#000000 3px solid;">'+$(this).find('.legend').html()+'</div><a href="#'+$(this).attr('name')+'" class="zoomback"><img src="'+$(this).find('img').attr('src')+'" style="border:3px #000000 solid;" /></a></div>');
		$('.zoomback').click( function() {
			$(this).parent().remove();
			$('.zoom').show();
			$('.bugshow').show().removeClass('bugshow');
		});
	});
	
	/*$('.pola').click( function() {
		$('.zoom').hide();
		$('.link-showall:visible').addClass('bugshow').hide();
		var lft = (900-$('.tipspic',this).metadata().l)/2;
		$('#wrapper').append('<div style="width:'+$('.tipspic',this).metadata().l+'px;display:block;position:absolute;top:130px;left:'+lft+'px;"><a href="#'+$('.tipspic',this).attr('name')+'" class="zoomback" style="display:block;padding:5px 0;text-transform:uppercase;font-weight:bold;color:#000000;text-align:center;">Retour &agrave; la galerie</a><div style="text-align:center;margin:0 auto 10px;padding:5px; background:#FFFFFF; border:#000000 3px solid;">'+$('.tipspic',this).next('.legend').html()+'</div><a href="#'+$('.tipspic',this).attr('name')+'" class="zoomback"><img src="'+$('.tipspic',this).prev('img').attr('src')+'" style="border:3px #000000 solid;" /></a></div>');
		$('.zoomback').click( function() {
			$(this).parent().remove();
			$('.zoom').show();
			$('.bugshow').show().removeClass('bugshow');
		});
	});*/
	
	$('#auteurs a').click( function() {
		fifiche($(this).metadata().ath);
	});
	
	$('.closefile').click( function() {
		$('.closefile').hide();
		$('#back-whos').animate({left:'277px'},500);
		$('#front-whos').animate({left:'289px'},500);
		$('#auteurs').animate({left:'394px'},500);
		$('#page-whos').animate({left:'335px'},500);
		$('.steel-whos').animate({left:'485px'},500);
		$('#whos-page-slider').animate({left:'695px'},500);
		$('#whos-auteurs-slider').animate({left:'670px'},500);
		$('#alphabet').animate({left:'394px'},500);
		$('#speller').animate({left:'635px'},500);
		$('.sheet').animate({left:'415px'},510,function() {
			$('#whos-page-slider').hide();
		});
	});
	
	$('.pager a').click( function() {
		var myparent = $(this).parent().parent();
		myparent.find('.pager a').css('background','none');
		var eqn = new Number($(this).text())-1;
		myparent.find('.pages:visible').fadeOut(500, function() {
			myparent.find('.pages:eq('+eqn+')').fadeIn();
		});
		myparent.find('.pager a:eq('+eqn+')').css('background-color','#CCCCCC');
	});
	
	
	//4 LIGNES POUR VOIR LA BIO AU DEPART DE LA PAGE WHOSWHO
	
	//$('.whoswho-main-text_1 .interview:visible').hide();
	$('.whoswho-main-text_1').css({height:'680px',overflow:'hidden'});
	//$('div.bio269texte').show();
	//$('.whoswho-main-text_2 .interview:visible').hide();
	$('.whoswho-main-text_2').css({height:'680px',overflow:'hidden'});
	//$('div.bio269image').show();
	
	
	//si click sur coloriste
	/*$('div#projslist a.prj15').click(function() {
	$('a.nom269').css('text-decoration','underline');
	});*/
	
	//si click sur dessinateur
	/*$('div#projslist a.prj12').click(function() {
	$('a.nom316').css('text-decoration','underline');
	});*/
	
	//si click sur scenariste
	/*$('div#projslist a.prj9').click(function() {
	$('a.nom247').css('text-decoration','underline');
	});*/
	
	
	//4 LIGNES POUR VOIR LES COLORISTES AU DEPART DE LA PAGE WHOSWHO
	$('.whoswho-data .interview:visible').hide();
	$('div#prj15').show();
	$('.whoswho-data').css({height:'600px',overflow:'hidden'});
	
	$('a.prj15').css('color','#666666');
	$('a.nom269').css('text-decoration','underline');
	
	
	//4 LIGNES POUR VOIR La premiere interview AU DEPART DE LA PAGE ARLESTON
	$('#arleston-data .interview:visible').hide();
	$('div#int147').show();
	/*$('#arleston-data').css({height:'450px',overflow:'auto'});*/
	$('#arleston-data').css({height:'450px'});
	$('a.int147').css('text-decoration','underline');
	
	//click carte
	$('div#carte_mdt a').click(function() {
		$('div#carte_big').show();								
		$('div#carte_mdt').hide();								
	});
	$('div#carte_big a').click(function() {
		$('div#carte_mdt').show();								
		$('div#carte_big').hide();								
	});
	
	
	
	
	
	//4 LIGNES POUR VOIR Le premier projet AU DEPART DE LA PAGE MONDE DE TROIE
	$('#mondetroie-data .interview_mdt:visible').hide();
	$('div#mdt36').show();
	$('#mondetroie-data').css({height:'470px',overflow:'auto'});
	$('a.mdt36').css('color','#666666');
	
	
	
	//4 LIGNES POUR VOIR LES COLABORATEURS AU DEPART DE LA PAGE LINKS
	$('#links-data .interview_links:visible').hide();
	$('div#prjl19').show();
	$('#links-data').css({height:'600px',overflow:'hidden'});
	$('a.prjl19').css('color','#666666');
	
	
	$('div.whoswho-data a').click(function() {
										   
		$('.whoswho-main-text_1').css({height:'0',overflow:'hidden'});
		$('.whoswho-main-text_1 .interview:visible').hide();
		$('.'+$(this).attr('rel')+'texte').show();
		$('.whoswho-main-text_1').css({height:'680px',overflow:'hidden'});
		
		$('.whoswho-main-text_2').css({height:'0',overflow:'hidden'});
		$('.whoswho-main-text_2 .interview:visible').hide();
		$('.'+$(this).attr('rel')+'image').show();
		$('.whoswho-main-text_2').css({height:'680px',overflow:'hidden'});
		
		$('ul.liste_arts_mdt a').css('text-decoration','none');
		$(this).css('text-decoration','underline');
	});
	
	/*
	
		$('ul.liste_arts_mdt a').css('text-decoration','none');
		$(this).css('text-decoration','underline');
		*/
	
	$('div#presslist a').click(function() {
		$('#arleston-data').css({height:'0'});
		$('#arleston-data .interview:visible').hide();
		$('#'+$(this).attr('rel')).show();
		$('#arleston-data').css({height:'450px'});
	})
	$('div#projslist a').click(function() {
		$('.whoswho-data').css({height:'0',overflow:'hidden'});
		$('.whoswho-data .interview:visible').hide();
		$('#'+$(this).attr('rel')).show();
		$('.whoswho-data').css({height:'600px',overflow:'hidden'});
		$('ul.liste_rubs_mdt a').css('color','#000000');
		$(this).css('color','#666666');
	});
	$('div#projslistb a').click(function() {
		$('#arleston-data').css({height:'0',overflow:'hidden'});
		$('#arleston-data .interview:visible').hide();
		$('#'+$(this).attr('rel')).show();
		$('#arleston-data').css({height:'300px',overflow:'auto'});
	});
	
	
	$('div#projslistc a').click(function() {
		$('#links-data').css({height:'0',overflow:'hidden'});
		$('#links-data .interview_links:visible').hide();
		$('#'+$(this).attr('rel')).show();
		$('#links-data').css({height:'4000px',overflow:'hidden'});
		$('ul.liste_rubs_mdt a').css('color','#000000');
		$(this).css('color','#666666');
	})
		
	$('div#projslist_mdt a').click(function() {
		$('#mondetroie-data').css({height:'0',overflow:'hidden'});
		$('#mondetroie-data .interview_mdt:visible').hide();
		$('#'+$(this).attr('rel')).show();
		$('#mondetroie-data').css({height:'470px',overflow:'auto'});
		$('ul.liste_arts_mdt a').css('color','#000000');
		$(this).css('color','#666666');
	})
	
	
	$('#titrelegendes').hide();
	
	$('#galaxy .legendes').click( function() {
		$('html').css('overflow','hidden');
		$('#maplegendes,#titrelegendes,.backlegendes').show();
		setTimeout("appear(1)",1);
	});
	
	$('.backlegendes').click( function() {
		$('html').css('overflow','hidden');
		$('#wrapper').animate({top:'0'},1500,'jswing', function() { setTimeout("disappear(1)",1); });
		
	});
	
	var hgnms = $('#auteurs-content').height()-355;
	$('#whos-auteurs-slider #handle-container').slider({
		min: 0,
		max: hgnms,
		axis: 'vertical',
		handle: '.handle',
		stop: function (event, ui) {
			$('#auteurs-content').animate({'top' : ui.value * -1}, 500);
		},
		slide: function (event, ui) {
			$('#auteurs-content').css('top', ui.value * -1);
		}
	});
	
	$('#keys a').click( function() {
		if($(this).hasClass('backactif')) {
			$(this).removeClass('backactif');
			$('#auteurs-content a').removeClass('backactif');
		}else{
			$('#keys a').removeClass('backactif');
			$(this).addClass('backactif');
			$('#auteurs-content a').removeClass('backactif');
			var checkey =  new RegExp("("+$(this).attr('rel')+")","g");
			$('#auteurs-content a').each( function() {
				if($(this).attr('rel').match(checkey)!=null) {
					$(this).addClass('backactif');
				}
			});
		}
	});
	
	$('.erase').click( function() {
		$('#alphabet a').removeClass('backactif');
		$('#speller').text('');
		$('#auteurs-content a').show();
		$('.erase').hide();
		$('#whos-auteurs-slider').show();
	});
	
	$('#linksoleil input').focus( function() { $(this).val(''); });
	$('#linksoleil a').click( function() {
		if($('#linksoleil input').val()!='') {
			var str = encodeURI($('#linksoleil input').val().split(' ').join('+'));
			window.open ("http://www.soleilprod.com/index.php?page=Recherche&mc="+str,"Soleil Search");
		}
	});
	
	$('#mdranim img:eq(0)').fadeIn(500, function() { $('#mdranim').cycle(); });
	
	/*$('.sticker').hover( function() {
		$(this).animate({top:$(this).css('top').replace('px','')-30+'px'},200,'easeOutQuad');
	},function() {
		var tp = $(this).metadata().topi;
		$(this).animate({top:new Number($(this).css('top').replace('px',''))+30+'px'},200,'easeOutElastic',function() { $(this).css('top',tp); });
	});*/
	
	$('.linkstick').hoverIntent( function() {
		$(this).prevAll().each( function() {
			$(this).animate({top:$(this).css('top').replace('px','')-60+'px',left:$(this).css('left').replace('px','')-60+'px'},200,'easeOutQuad');	
		});
		$(this).nextAll().each( function() {
			$(this).animate({top:new Number($(this).css('top').replace('px',''))+60+'px',left:new Number($(this).css('left').replace('px',''))+60+'px'},200,'easeOutQuad');
		});
		/*tp = new Number($(this).css('top').replace('px',''));
		lf = new Number($(this).css('left').replace('px',''));
		$(this).prevAll().animate({top:tp+'px',left:lf+'px'},200,'easeOutQuad');
		$(this).nextAll().animate({top:tp+'px',left:lf+'px'},200,'easeOutQuad');*/
	},function() {
		//$(this).animate({top:(tp+it)+'px'},200,'easeOutElastic');
		$(this).prevAll().each( function() {
			$(this).animate({top:new Number($(this).css('top').replace('px',''))+60+'px',left:new Number($(this).css('left').replace('px',''))+60+'px'},200,'easeOutQuad');
		});
		$(this).nextAll().each( function() {
			$(this).animate({top:$(this).css('top').replace('px','')-60+'px',left:$(this).css('left').replace('px','')-60+'px'},200,'easeOutQuad');
		});
	});
	
	$('#sticks-relative').hoverIntent( function() {
		$(".stickmdr").animate({top:'105px',left:'75px'},200,'easeOutQuad');	
		$(".sticklegendes").animate({top:'35px',left:'-40px'},200,'easeOutQuad');	
		$(".stickgalaxie").animate({top:'-35px',left:'35px'},200,'easeOutQuad');	
	},function() {
		$(".stickmdr").animate({top:'90px',left:'70px'},200,'easeOutQuad');	
		$(".sticklegendes").animate({top:'30px',left:0},200,'easeOutQuad');	
		$(".stickgalaxie").animate({top:0,left:'30px'},200,'easeOutQuad');	
	});
	
	$('.closedbd').click(function(){
		$('.closed').hide();
		$('html').css('overflow','hidden');
		$('#wrapper-home,#wrapper').animate({top:'600px'},1000);
		$('#closedback').animate({top:'0'},1000);
	});
	$('.backclosed').click(function(){
		$('#wrapper-home,#wrapper').animate({top:'0'},1000);
		$('#closedback').animate({top:'-1200px'},1000,function() {
			$('.closed').show();
			$('html').css('overflow','auto');
		});
	});
	
	$('a[href="-Le-monde-de-Troy-"]').bind('click',function(){
		return false;
	});
	$('a[href="-Le-monde-de-Troy-"]').hover(function(){
		$('#monde-troy').animate({left:'780px'},500);
	},function(){
		$('#monde-troy').animate({left:'548px'},500);
	});
	
});