var config1 = {
   slideshowGroup: 'group1',
   transitions: ['expand', 'crossfade']
};

var config2 = {
   slideshowGroup: 'group2',
   transitions: ['expand', 'crossfade']
};	
	
	hs.graphicsDir = 'scripts/highslide/graphics/';
	hs.align = 'center';
	hs.transitions = ['expand', 'crossfade'];
	hs.outlineType = 'rounded-white';
	hs.fadeInOut = true;
	hs.numberPosition = 'caption';
	hs.lang = {
		loadingText :     'Chargement...',
		loadingTitle :    'Cliquer pour annuler',
		focusTitle :      'Cliquer pour amener au premier plan',
		fullExpandTitle : 'Afficher à la taille réelle',
		fullExpandText :  'Taille réelle',
		creditsText : '',
		creditsTitle : 'Retour à la page d\'accueil',
		previousText :    'Précédent',
		previousTitle :   'Précédent (flèche gauche)',
		nextText :        'Suivant',
		nextTitle :       'Suivant (flèche droite)',
		moveTitle :       'Déplacer',
		moveText :        'Déplacer',
		closeText :       'Fermer',
		closeTitle :      'Fermer (esc ou Echap)',
		resizeTitle :     'Redimensionner',
		playText :        'Lancer',
		playTitle :       'Lancer le diaporama (barre d\'espace)',
		pauseText :       'Pause',
		pauseTitle :      'Suspendre le diaporama (barre d\'espace)',
		number :          '',
		restoreTitle :    'Cliquer pour fermer l\'image, cliquer et faire glisser pour déplacer, utiliser les touches flèches droite et gauche pour suivant et précédent.'
	};
	
	// Add the controlbar
	if (hs.addSlideshow) hs.addSlideshow({
		slideshowGroup: ['group1'],
		interval: 5000,
		repeat: false,
		useControls: true,
		fixedControls: 'fit',
		overlayOptions: {
			opacity: 0.75,
			position: 'bottom center',
			hideOnMouseOut: true
		}
	});	
	
jQuery().ready(function(){
	
	
	/* carto */
	if(document.getElementById('gg_search'))
	{
		var sign = '-';
		jQuery('#show_search').click(function() {
			
			jQuery('#gg_search').animate(
				{
					left: sign+'=200px'
				}, 
				1000, 
				function() {
					if(sign=='+')
						sign='-';
					else
						sign='+';
						
				}
			);
		});	
	}
	if(document.getElementById('gg_listing'))
	{	
		var sign2 ='-';
		
		if(document.getElementById("gg_listing").className.indexOf("close_listing", 0) != -1)
			sign2 ='+';
		
		jQuery('#show_listing').click(function() {
			jQuery('#gg_listing').animate(
				{
					right: sign2+'=235px'
				}, 
				1000, 
				function() {
						if(sign2=='+')
							sign2='-';
						else
							sign2='+';	
				}
			);
		
		});
	}
	/* carto */
	
	
	
	// animation selection
		if(document.getElementById('portofolio'))
		{
			var opened;
			var locked = false;
			jQuery(".a_maison").click(function() {		
				if(!locked)
				{
					locked = true;
					if(opened)
					{	
						var height = jQuery("#"+opened).height();
						jQuery("#"+opened).animate(
							{
								top: '+='+height+'px'
							}, 
							1000, 
							function() {
								opened = '';
							}
						);
					}	
					var div_id = $(this).attr('id').substr(2);	
					var height = jQuery("#"+div_id).height();	
					if( (opened=='' || !opened) || (opened!=div_id) )
					{				
						jQuery("#"+div_id).animate(
							{
								top: '-='+height+'px' 
							}, 
							1000, 
							function() {
								opened = div_id;
							}
						);			
					}
					locked = false;
				}
			});
		}
		// fondu selection
		if(document.getElementById('selections'))
		{
			jQuery('.slideshow').cycle({
				fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
				cleartypeNoBg: true,  // properties that define the initial state of the slide before transitioning in 
				timeout:5000,
				pauseOnPagerHover: true
			});
		}
	
	//lavalamp
	// ouverture
		jQuery("#open").click(function(){
			jQuery("div#panel").slideDown("slow");
		});	
		
		// fermeture
		jQuery("#close").click(function(){			
			jQuery("div#panel").slideUp("slow");				
		});	
		
		// Switch " ouvrir " / "fermer"
		jQuery("#toggle a").click(function () {
			jQuery("#toggle a").toggle();
		});	


	var query = new Object();
	window.location.search.replace(
	new RegExp( "([^?=&]+)(=([^&]*))?", 'g' ),
		function( $0, $1, $2, $3 ){
			query[ $1 ] = $3;
		}
	);
	easing = query['e'] || 'Expo';
	
	function loadEasing(e) {
		location.href = location.pathname+'?e='+e;
	}
	
	function setEasing(e) {
		loadLamps(e);
	}

// for dynamic easing changes		
	function loadLamps(easing) {
		jQuery('#lavaLampBorderOnly').lavaLamp({
			fx: 'easeInOut'+easing,
			speed: 1000,
			returnDelay:5000
		});
	}
	
		jQuery('#menu').lavaLamp({fx: 'swing', speed: 333});
		loadLamps(easing);		
		jQuery('select#easing option[value='+easing+']').attr('selected','selected');
		jQuery('.easingLabel').text(easing);
	
		if(document.getElementById('mycarousel')) {
		jQuery('#mycarousel').jcarousel({
			auto: 5,
			wrap: 'last',
			scroll: 1
		});		
		}
		
		
		if(document.getElementById('ca_banner1'))
		{
			jQuery('#ca_banner1').banner({
				steps : [
					[
						//1 step:
						[{"to" : "2"}, {"effect": "zoomOutRotated-zoomInRotated"}], // ligne pour effet sur images "products#"
						[{"to" : "2"}, {"effect": "zoomOut-zoomIn"}], // ligne pour effet "line#"
						[{"to" : "2"}, {"effect": "slideOutRight-slideInRight"}] // ligne pour effet sur "title#"
					],
					[
						//2 step:
						[{"to" : "3"}, {"effect":"slideOutTop-slideInTop"}],
						[{"to" : "3"}, {"effect": "zoomOutRotated-zoomIn"}],
						[{"to" : "3"}, {"effect": "slideOutRight-slideInRight"}]
					],
					[
						//3 step:
						[{"to" : "4"}, {"effect": "zoomOut-zoomIn"}],
						[{"to" : "4"}, {"effect": "slideOutTop-slideInBottom"}],
						[{"to" : "4"}, {"effect": "slideOutRight-slideInRight"}]
					],
					[
						//4 step
						[{"to" : "5"}, {"effect": "slideOutBottom-slideInTop"}],
						[{"to" : "5"}, {"effect": "zoomOut-zoomIn"}],
						[{"to" : "5"}, {"effect": "slideOutRight-slideInRight"}]
					],
					[
						//5 step
						[{"to" : "1"}, {"effect": "slideOutLeft-slideInLeft"}],
						[{"to" : "1"}, {"effect": "zoomOut-zoomIn"}],
						[{"to" : "1"}, {"effect": "slideOutRight-slideInRight"}]
					]
				],
				total_steps	: 5,
				speed : 5000
			});		
		}
		
});

