
    $.easing.custom = function (x, t, b, c, d) {
        var s = 1.1;
        if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
        return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
    }

    doc=document.location.href.split("#");

    $(document).ready(function() {
		
	 $("#cfSubmit").click(function() {
       
		$.get("http://www.siaz.fr/mail.php", { name: $("#cfName").val(), prenom: $("#cfPrenom").val(), entreprise: $("#cfEntreprise").val(), mail: $("#cfEmail").val(), subject: $("#cfSujet").val(), message: $("#cfMessage").val() },
	   function(data){
		$("#contactFromDiv").html("Message Envoy&eacute;");
		 alert( $("#cfName").val() + $("#cfPrenom").val()+ $("#cfEntreprise").val()+$("#cfEmail").val()+ $("#cfSujet").val()+$("#cfMessage").val());
		 //alert("Data Loaded: " + data);
	   });
        
		
   	 });
	 
        $("a.slide").click(function(){
            var page = $(this).attr('href')
            document.title = document.title.split("-")[0] + ' - ' +page.split("#")[1];
            $.scrollTo(page, 800, {easing: 'easeInOutQuart', onAfter: function(){
                    window.location = doc[0] + page;
                }
            });
            return false;
        });
        
   		 var width; 
 
   		 if( typeof(window.innerWidth) == 'number' ){
    	    width = window.innerWidth; 
     	   }
   		 else if(document.documentElement && document.documentElement.clientWidth){
      		  width = document.documentElement.clientWidth; 
       		 }
		
		if(width <= 1042){
			$(".scrollable").scrollable({easing : 'custom',speed : 400, size: 3})
			$(".scrollable").width(480);
		}
		else{
			$(".scrollable").scrollable({easing : 'custom',speed : 400, size: 4})
		}
		

        $(".scrollable").navigator();

        $(".listeMenu li .menu").each(function(){
            var menu = $(this).find('img');
            menu.css({'height': '25px', 'position': 'relative'})

            if(menu.attr('class') == 'type2'){
                if($.browser.msie)
                    menu.css({'right': 2});
                else
                    menu.css({'opacity': 0.4, 'right': 2});
            }

                menu.hover(
                    function(){
                        if($(this).attr("class") == "type2"){
                            if($.browser.msie)
                                $(this).stop().animate({'height': 45, 'right': 3});
                            else
                                $(this).stop().animate({'height': 45, 'opacity': 1, 'right': 3});
                        }else{
                            if($.browser.msie)
                                $(this).stop().animate({'height': 55,  'right': 3});
                            else
                                $(this).stop().animate({'height': 55, 'opacity': 1, 'right': 3});
                        }
                    },
                    function(){
                        if($(this).attr("class") == "type2"){
                             if($.browser.msie)
                                $(this).stop().animate({'height': 25, 'right': 2});
                             else
                                $(this).stop().animate({'height': 25, 'opacity': 0.4, 'right': 2});
                        }else{
                            if($.browser.msie)
                                $(this).stop().animate({'height': 25, 'right': 0});
                            else
                                $(this).stop().animate({'height': 25, 'opacity': 1, 'right': 0});
                        }
                    }
                );
        });
    });
	
	
