window.addEvent('domready', function() {

	/********** SmoothScoll sur clic : **************/
		new SmoothScroll({wait:false, duration:1500, transition:Fx.Transitions.Back.easeInOut});
	/************************************************/	


	/*************** Soumettre le formulaire au changement **************/
	if ( $('one') ) {
	
		$$('form#one select').addEvent('change', function(obj) {
			$('one').submit() ;	
		});
	
	}
	/*************** Fin Soumettre le formulaire au changement **************/
	
	
	
	/*************** Défilement noobslide / mix mf **************/
	if ( $('mixbox')) {
		if( $('mixhandles') ) {
			// si handles présents
			var defilenews = new noobSlide({
				box: $('mixbox'),
				startItem: 0,
				items: $$('#mixbox div'),
				size: 200,
				handles: $$('#mixhandles span'),
				fxOptions: {
					duration: 1000,
					transition: Fx.Transitions.Back.easeInOut, 
					wait: false
				},
				onWalk: function(currentItem,currentHandle){
					this.handles.removeClass('active');
					currentHandle.addClass('active');
				},
				addButtons: {
					previous: $('prev'),
					next: $('next')
				}
				
			});
		}
		else {
			// sinon...
			var defilenews = new noobSlide({
				box: $('mixbox'),
				startItem: 0,
				items: $$('#mixbox div'),
				size: 200
			});
		}
		// Lance le défilement auto. La première valeur est correspond au temps
		defilenews.play(6000,"next",1);	
	}
	/*************** Fin Défilement noobslide / mix mf **************/
	
	/* news slide */
	if($("testMoisScroll") && $$(".oneTestMois").length>1) {
		if($('testMoisHandles')) {
			// si handles présents
			var defilenews = new noobSlide({
				box: $('testMoisScroll'),
				startItem: 0,
				items: $$('.oneTestMois'),
				size: 450,
				handles: $$('#testMoisHandles span'),
				fxOptions: {
					duration: 1000,
					transition: Fx.Transitions.Back.easeInOut, 
					wait: false
				},
				onWalk: function(currentItem,currentHandle){
					this.handles.removeClass('active');
					currentHandle.addClass('active');
				},
				addButtons: {
					previous: $('testMoisPrev'),
					next: $('testMoisNext')
				}
				
			});
		}
		defilenews.play(6000,"next",1);	
	}
	
	
	/**********liste des critères supplémentaires pour les fichers ***************/
	
	if ( $('criteresfiche') ) {

		// Slide sur le menu	
		var slideCriteres = new Fx.Slide('criteresfiche', {
			duration:1500, 
			mode: 'vertical', 
			transition: Fx.Transitions.Back.easeInOut, 
			wait:false
		}).hide();
	
		$$('span.criteresAffiche').addEvent('click', function(e) {
			slideCriteres.toggle().chain(function(){
	
				if ( $('imageCriteres') ) {
					if ( slideCriteres.open ) 
						$('imageCriteres').src = 'images/btn-up.gif' ;
					else 
						$('imageCriteres').src = 'images/btn-down.gif' ;
				}
			});	
		});
	}
	
	
	/********** FIN liste des critères supplémentaires pour les fichers ***************/
	
	
	/****************** Infobulles ***********************/
	
	// infobulle bestproduct : 
	var infobulle3 = new Tips($$('.infobulleBestproduct'), {
		className: 'bulleBestproduct',
		fixed: false,
		offsets: {'x': 20, 'y': -100},
		hideDelay: 200
	});
	infobulle3.addEvent('show', function(tip){
		tip.set('morph', {duration: 500, transition: Fx.Transitions.linear, wait:false });
	    tip.morph({
			'opacity': [0.1,1],
			'margin-top': [20,1]
		});
	});
	infobulle3.addEvent('hide', function(tip){
	    tip.morph({
	    	'opacity': [1,0],
			'margin-top': [1,20]
		});
	});

	$$('.infobulleBestproduct').store('tip:title', '<strong>BEST PRODUCT</strong>');
	$$('.infobulleBestproduct').store('tip:text', 'Le Best Product signale un produit franchement au dessus du lot, dont les qualit&eacute;s ne se discutent pas : c\'est la r&eacute;f&eacute;rence pour tous.');
	
	//

	// infobulle bestdeal : 
	var infobulle3 = new Tips($$('.infobulleBestdeal'), {
		className: 'bulleBestdeal',
		fixed: false,
		offsets: {'x': 20, 'y': -100},
		hideDelay: 200
	});
	infobulle3.addEvent('show', function(tip){
		tip.set('morph', {duration: 500, transition: Fx.Transitions.linear, wait:false });
	    tip.morph({
			'opacity': [0.1,1],
			'margin-top': [20,1]
		});
	});
	infobulle3.addEvent('hide', function(tip){
	    tip.morph({
	    	'opacity': [1,0],
			'margin-top': [1,20]
		});
	});

	$$('.infobulleBestdeal').store('tip:title', '<strong>GOOD DEAL</strong>');
	$$('.infobulleBestdeal').store('tip:text', 'Le Good Deal met en lumi&egrave;re un rapport qualit&eacute;/prix.');
	
	//

	// infobulle myfavorite : 
	var infobulle3 = new Tips($$('.infobulleMyfavorite'), {
		className: 'bulleMyfavorite',
		fixed: false,
		offsets: {'x': 20, 'y': -100},
		hideDelay: 200
	});
	infobulle3.addEvent('show', function(tip){
		tip.set('morph', {duration: 500, transition: Fx.Transitions.linear, wait:false });
	    tip.morph({
			'opacity': [0.1,1],
			'margin-top': [20,1]
		});
	});
	infobulle3.addEvent('hide', function(tip){
	    tip.morph({
	    	'opacity': [1,0],
			'margin-top': [1,20]
		});
	});

	$$('.infobulleMyfavorite').store('tip:title', '<strong>MY FAVORITE</strong>');
	$$('.infobulleMyfavorite').store('tip:text', 'My Favorite r&eacute;compense un produit pour lequel nous avons eu un coup de coeur.');
	
	//
	
	// infobulle note
	var infobulle3 = new Tips($$('.note-1'), {
		className: 'bulleNote1',
		fixed: false,
		offsets: {'x': 20, 'y': -15},
		hideDelay: 200
	});
	infobulle3.addEvent('show', function(tip){
		tip.set('morph', {duration: 500, transition: Fx.Transitions.linear, wait:false });
	    tip.morph({
			'opacity': [0.1,1],
			'margin-top': [20,1]
		});
	});
	infobulle3.addEvent('hide', function(tip){
	    tip.morph({
	    	'opacity': [1,0],
			'margin-top': [1,20]
		});
	});

	$$('.note-1').store('tip:title', '<strong>1/5</strong>');
	$$('.note-1').store('tip:text', '');
	
	//
	
	// infobulle note
	var infobulle3 = new Tips($$('.note-1demi'), {
		className: 'bulleNote1demi',
		fixed: false,
		offsets: {'x': 20, 'y': -15},
		hideDelay: 200
	});
	infobulle3.addEvent('show', function(tip){
		tip.set('morph', {duration: 500, transition: Fx.Transitions.linear, wait:false });
	    tip.morph({
			'opacity': [0.1,1],
			'margin-top': [20,1]
		});
	});
	infobulle3.addEvent('hide', function(tip){
	    tip.morph({
	    	'opacity': [1,0],
			'margin-top': [1,20]
		});
	});

	$$('.note-1demi').store('tip:title', '<strong>1,5/5</strong>');
	$$('.note-1demi').store('tip:text', '');
	
	//
	
	// infobulle note
	var infobulle3 = new Tips($$('.note-2'), {
		className: 'bulleNote2',
		fixed: false,
		offsets: {'x': 20, 'y': -15},
		hideDelay: 200
	});
	infobulle3.addEvent('show', function(tip){
		tip.set('morph', {duration: 500, transition: Fx.Transitions.linear, wait:false });
	    tip.morph({
			'opacity': [0.1,1],
			'margin-top': [20,1]
		});
	});
	infobulle3.addEvent('hide', function(tip){
	    tip.morph({
	    	'opacity': [1,0],
			'margin-top': [1,20]
		});
	});

	$$('.note-2').store('tip:title', '<strong>2/5</strong>');
	$$('.note-2').store('tip:text', '');
	
	//
	
	// infobulle note
	var infobulle3 = new Tips($$('.note-2demi'), {
		className: 'bulleNote2demi',
		fixed: false,
		offsets: {'x': 20, 'y': -15},
		hideDelay: 200
	});
	infobulle3.addEvent('show', function(tip){
		tip.set('morph', {duration: 500, transition: Fx.Transitions.linear, wait:false });
	    tip.morph({
			'opacity': [0.1,1],
			'margin-top': [20,1]
		});
	});
	infobulle3.addEvent('hide', function(tip){
	    tip.morph({
	    	'opacity': [1,0],
			'margin-top': [1,20]
		});
	});

	$$('.note-2demi').store('tip:title', '<strong>2,5/5</strong>');
	$$('.note-2demi').store('tip:text', '');
	
	//
	
	// infobulle note
	var infobulle3 = new Tips($$('.note-3'), {
		className: 'bulleNote3',
		fixed: false,
		offsets: {'x': 20, 'y': -15},
		hideDelay: 200
	});
	infobulle3.addEvent('show', function(tip){
		tip.set('morph', {duration: 500, transition: Fx.Transitions.linear, wait:false });
	    tip.morph({
			'opacity': [0.1,1],
			'margin-top': [20,1]
		});
	});
	infobulle3.addEvent('hide', function(tip){
	    tip.morph({
	    	'opacity': [1,0],
			'margin-top': [1,20]
		});
	});

	$$('.note-3').store('tip:title', '<strong>3/5</strong>');
	$$('.note-3').store('tip:text', '');
	
	//
	
	// infobulle note
	var infobulle3 = new Tips($$('.note-3demi'), {
		className: 'bulleNote3demi',
		fixed: false,
		offsets: {'x': 20, 'y': -15},
		hideDelay: 200
	});
	infobulle3.addEvent('show', function(tip){
		tip.set('morph', {duration: 500, transition: Fx.Transitions.linear, wait:false });
	    tip.morph({
			'opacity': [0.1,1],
			'margin-top': [20,1]
		});
	});
	infobulle3.addEvent('hide', function(tip){
	    tip.morph({
	    	'opacity': [1,0],
			'margin-top': [1,20]
		});
	});

	$$('.note-3demi').store('tip:title', '<strong>3,5/5</strong>');
	$$('.note-3demi').store('tip:text', '');
	
	//
	
	// infobulle note
	var infobulle3 = new Tips($$('.note-4'), {
		className: 'bulleNote4',
		fixed: false,
		offsets: {'x': 20, 'y': -15},
		hideDelay: 200
	});
	infobulle3.addEvent('show', function(tip){
		tip.set('morph', {duration: 500, transition: Fx.Transitions.linear, wait:false });
	    tip.morph({
			'opacity': [0.1,1],
			'margin-top': [20,1]
		});
	});
	infobulle3.addEvent('hide', function(tip){
	    tip.morph({
	    	'opacity': [1,0],
			'margin-top': [1,20]
		});
	});

	$$('.note-4').store('tip:title', '<strong>4/5</strong>');
	$$('.note-4').store('tip:text', '');
	
	//
	
	// infobulle note
	var infobulle3 = new Tips($$('.note-4demi'), {
		className: 'bulleNote4demi',
		fixed: false,
		offsets: {'x': 20, 'y': -15},
		hideDelay: 200
	});
	infobulle3.addEvent('show', function(tip){
		tip.set('morph', {duration: 500, transition: Fx.Transitions.linear, wait:false });
	    tip.morph({
			'opacity': [0.1,1],
			'margin-top': [20,1]
		});
	});
	infobulle3.addEvent('hide', function(tip){
	    tip.morph({
	    	'opacity': [1,0],
			'margin-top': [1,20]
		});
	});

	$$('.note-4demi').store('tip:title', '<strong>4,5/5</strong>');
	$$('.note-4demi').store('tip:text', '');
	
	//
	
	// infobulle note
	var infobulle3 = new Tips($$('.note-5'), {
		className: 'bulleNote5',
		fixed: false,
		offsets: {'x': 20, 'y': -15},
		hideDelay: 200
	});
	infobulle3.addEvent('show', function(tip){
		tip.set('morph', {duration: 500, transition: Fx.Transitions.linear, wait:false });
	    tip.morph({
			'opacity': [0.1,1],
			'margin-top': [20,1]
		});
	});
	infobulle3.addEvent('hide', function(tip){
	    tip.morph({
	    	'opacity': [1,0],
			'margin-top': [1,20]
		});
	});

	$$('.note-5').store('tip:title', '<strong>5/5</strong>');
	$$('.note-5').store('tip:text', '');
	
	//

/********************* Fin Infobulles **********************/
});

//envoi d'un mail
function test_envoi(nomImage, Url)
{
    send_it = "mailto:?subject=coucou";
    send_it += "&body=bobo <img src='.nomImage.'>";
    
    
    //replace
    

    alert(body);
    document.location = send_it; 
}
