    if (jQuery.browser.msie) {
       if (parseInt(jQuery.browser.version) == 6 || 7 || 8){
               
               if (document.all && document.styleSheets && document.styleSheets[0] &&
                 document.styleSheets[0].addRule)
                {
                 
                 document.styleSheets[0].addRule('img', 'behavior: url(../iepngfix.htc)');
                 document.styleSheets[0].addRule('div', 'behavior: url(../iepngfix.htc)');
                 document.styleSheets[0].addRule('a', 'behavior: url(../iepngfix.htc)');
                }
       }
    }
    
// Effets juteux et sucrés rendus possibles grâce à jQuery

/* IE PNG fix multiple filters */
(function ($) {
    if (!$) return;
    $.fn.extend({
        fixPNG: function(sizingMethod, forceBG) {
                if (!($.browser.msie)) return this;
                var emptyimg = "../blank.gif"; //Path to empty 1x1px GIF goes here
                sizingMethod = sizingMethod || "scale"; //sizingMethod, defaults to scale (matches image dimensions)
                this.each(function() {
                        var isImg = (forceBG) ? false : jQuery.nodeName(this, "img"),
                                imgname = (isImg) ? this.src : this.currentStyle.backgroundImage,
                                src = (isImg) ? imgname : imgname.substring(5,imgname.length-2);
                        this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='" + sizingMethod + "')";
                        if (isImg) this.src = emptyimg;
                        else this.style.backgroundImage = "url(" + emptyimg + ")";
                });
                return this;
        }
    });
})(jQuery);

$(function(){
   
   
   

   
   $('#wrap-texte-service1, #wrap-texte-service3').hide();
   
   //$('.items-menu-top').css({opacity : '0'});
   //$('.items-menu-top').animate({opacity : '0.8'}, 900);
   
   if (!(jQuery.browser.msie)) {
   $('.items-menu-top').hover(function(){
      $(this).animate({opacity : "1"}, 200);
      }, function(){
         $(this).animate({opacity : "0.8"}, 200);
      });
   }

   if (!(jQuery.browser.msie)) {
   $('.tweet').css({opacity : '0.6', top : "-60px"});
   }
   
   $('.tweet').animate({top : "0px"}, 2000);
   
   if (!(jQuery.browser.msie)) {
   $('.tweet').hover(function(){
      $(this).animate({opacity : "1"});
      }, function(){
         $(this).animate({opacity : "0.6"});
      });
   }
   
      
   $('#accueil').hover(function(){  
      $('#menu-selection').stop().animate({left : "-16px"});
      }, function(){
         $('#menu-selection').stop().animate({left : x});
      });
   
   
   $('#services').hover(function(){ 
      $('#menu-selection').stop().animate({left : "94px"});
      }, function(){
         $('#menu-selection').stop().animate({left : x});
      });
   
   $('#partenaires ').hover(function(){
      $('#menu-selection').stop().animate({left : "224px"});
      }, function(){
         $('#menu-selection').stop().animate({left : x});
      });
   
   $('#joindre ').hover(function(){
      $('#menu-selection').stop().animate({left : "385px"});
      }, function(){
         $('#menu-selection').stop().animate({left : x});
      });
   
   $('.slideshow').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
                speed:    600, 
                timeout:  7000,
                cleartype: true,
                cleartypeNoBg: true
	});
   
   y = "0px";
   $('#services1').css({backgroundColor : "#3c3c3c"});
   $('#services1').click(function(){
      y = "0px";
      $('#wrap-texte-service1, #wrap-texte-service3').hide();
      $('#wrap-texte-service2').show();
      $('#in-texte-accueil2').css({backgroundPosition : "0px -50px"});
      $(this).css({backgroundColor : "#3c3c3c"});
      $("#services2, #services3").css({backgroundColor : "#313131"});
      
      });
   
   $('#services2').click(function(){
      y = "153px";
      $('#wrap-texte-service2, #wrap-texte-service3').hide();
      $('#wrap-texte-service1').show();
      $('#in-texte-accueil2').css({backgroundPosition : "0px -80px"});
      
      $(this).css({backgroundColor : "#3c3c3c"});
      $("#services1, #services3").css({backgroundColor : "#313131"});
      });
   
   $('#services3').click(function(){
      y = "308px";
      $('#wrap-texte-service1, #wrap-texte-service2').hide();
      $('#wrap-texte-service3').show();
      $('#in-texte-accueil2').css({backgroundPosition : "0px -50px"});
      
      $(this).css({backgroundColor : "#3c3c3c"});
      $("#services2, #services1").css({backgroundColor : "#313131"});
      });
   
   
   $('#services1').hover(function(){
      $('#barre-orange').stop().animate({top : "0px"});
      },function(){
      $('#barre-orange').stop().animate({top : y});   
      });
   
   $('#services2').hover(function(){
      $('#barre-orange').stop().animate({top : "153px"});
      },function(){
      $('#barre-orange').stop().animate({top : y});   
      });
   
   $('#services3').hover(function(){
      $('#barre-orange').stop().animate({top : "308px"});
      },function(){
      $('#barre-orange').stop().animate({top : y});   
      });
   
   $("a.iframe").fancybox({
		'width'				: 615,
		'height'			: 500,
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none'
	});
   
   $("a.iframe2").fancybox({
		'width'				: 650,
		'height'			: 500,
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
   
   $("a.single_image").fancybox({
      
        'autoScale'     	: false
      });

   
   /*****************
    *****************
    *****************
    *****************
    *****************
    *****************
    *****************
    *****************
    *****************
    ********Form*****/

$("button").click(function(){

         $(".formError").hide();

	});

	var use_ajax=true;
	$.validationEngine.settings={};

	$("#contact-form").validationEngine({
		inlineValidation: false,
		
		success :  function(){use_ajax=true},
		failure : function(){use_ajax=false;}
	 })

	$("#contact-form").submit(function(e){
               var a = $("#name").attr("value");
               
               if(a == "Nom")
                  {
                     $.validationEngine.buildPrompt("#name","* Vous devez entrer votre nom","error");
                     use_ajax=false;
                  }
               
			if(use_ajax)
			{
				$('#loading').css('visibility','visible');
				$.post('submit.php',$(this).serialize()+'&ajax=1',                                       
                                       
					function(data){
						if(parseInt(data)==-1)
							$.validationEngine.buildPrompt("#captcha","* Wrong verification number!","error");
							
						else
						{
							$("#contact-form").hide('slow').after('<h1>Merci!<br /><small>Nous vous répondrons très bientôt</small></h1>');
                                                        x = "616px";
						}
						
						$('#loading').css('visibility','hidden');
					}
				
				);
			}
			e.preventDefault();
	})

   
});






