
$(document).ready(function($){
	
	//$('.column').columnize({columns : 2});
	$('#configurateur').cycle({
		fx:    'fade',
		timeout:500,
    	speed:  300 
	});
	$(".swapImage").hover(function(){
	$(".imageSurvol").fadeIn();
	}, function() {
	$(".imageSurvol").fadeOut();
	});
	 
	$("div.switchcontent a").addClass("popup");
	
	$(".popup").click(function(){ 
    window.open($(this).attr("href")); 
    return false; 
	});
	
	$("#revueList a").click(function(){ 
    window.open($(this).attr("href")); 
    return false; 
	});
	
	$("a.bt_1").hover(function() {
	  $("#bulle_1").animate({opacity: "show", top: "0"}, "slow");
	}, function() {
	  $("#bulle_1").animate({opacity: "hide", top: "-5"}, "fast");
	});
	$("a.bt_2").hover(function() {
	  $("#bulle_2").animate({opacity: "show", top: "0"}, "slow");
	}, function() {
	  $("#bulle_2").animate({opacity: "hide", top: "-5"}, "fast");
	});
	$(".bt_3").hover(function() {
	  $("#bulle_3").animate({opacity: "show", top: "0"}, "slow");
	}, function() {
	  $("#bulle_3").animate({opacity: "hide", top: "-5"}, "fast");
	});
	
	$("#pageflip").hover(function() { //On hover...
	$("#pageflip img , .msg_block").stop()
		.animate({ //Animate and expand the image and the msg_block (Width + height)
			width: '29px',
			height: '40px'
		}, 500);
	} , function() {
	$("#pageflip img").stop() //On hover out, go back to original size 50x52
		.animate({
			width: '6px',
			height: '10px'
		}, 220);
	$(".msg_block").stop() //On hover out, go back to original size 50x50
		.animate({
			width: '6px',
			height: '8px'
		}, 200); //Note this one retracts a bit faster (to prevent glitching in IE)
});
  
	
	//lightBox utilise {sharedRessourcesDir}/scripts/jquery.lightbox-0.5.js
	// et {sharedRessourcesDir}/styles/shop/jquery.lightbox-0.5.css
	//http://leandrovieira.com/projects/jquery/lightbox/
    $('a.lightbox').lightBox(); // Select all links that contains lightbox in the attribute rel
	
});

// pré-remplissage du champ 'Votre message' sur le formulaire de contact avec la valeur du paramètre 'message' passé dans l'url
var urlParameters = location.search.substring(1).split('&');
for (var i = 0; i < urlParameters.length; i++) {

	var parameter = urlParameters[i];
	var parameterTmp = parameter.split('=');

	var key = parameterTmp[0];
	var value = parameterTmp[1];
	
	if (key == 'message'){
		// pré-remplissage du formulaire
		$('textarea[name=*Votre message]').val(unescape(value));		
	}
}