// remplacement data-rel par rel pour validation html5
// $('a[data-rel]').each(function() {
//     $(this).attr('rel', $(this).data('rel'));
// });
// scrollvertical
			var scrolling = function(){
			    var speed     = 500;
			    jQuery('a[href^="#"]').bind('click',function(){
			        var id = jQuery(this).attr('href');
			        if(id == '#')
			            goTo('body');
			        else
			            goTo(id);
			        return(false);
                 void(0);
			    });
			    function goTo(ancre){jQuery('html,body').animate({scrollTop:jQuery(ancre).offset().top},speed,'linear',function(){
			          if(ancre != 'body')
			                window.location.hash = ancre;
			          else
			              window.location.hash = '#';
			          jQuery(ancre).attr('tabindex','-1');
			          jQuery(ancre).focus();
			          jQuery(ancre).removeAttr('tabindex');
			      });
			    }
			};
			jQuery(function(){
				scrolling();
			});
// scroll back to top
var $ = jQuery.noConflict(); 

$(document).ready(function() {

   $(".mainMenu li:last-child").addClass("lastMenuChild");	
   $(".subMenu li:last-child").addClass("lastSubMenuChild");

/* top menu */
$(".mainMenu > li").hover(function() {   
    $(this).stop().find(".subMenu").animate({ 
                                 height: "show"
                                 },150);

},function(){
    $(this).stop().find(".subMenu").delay(300).animate({
                                 height: "hide"
                                 },150);
    });

//back to top	
   $('.backToTop').click(function(e) {
      e.preventDefault(); $('html, body').animate( {
         scrollTop : 0}
      , 800, 'easeOutCubic'); return false; }
   ); 
   
   
//animate portfolio items and posts on load   
var delayAni = 150;
$(".portfolioItem1").css({opacity:0});
$(".portfolioItem2").css({opacity:0});
$(".portfolioItem3").css({opacity:0});
$(".smallPost").css({opacity:0});

$(".portfolioItem1").each(function() {
														 
      $(this).delay(delayAni).animate({opacity:1}, 300); delayAni += 150; }
   ); 
$(".portfolioItem2").each(function() {
														 
      $(this).delay(delayAni).animate({opacity:1}, 300); delayAni += 150; }
   ); 

$(".portfolioItem3").each(function() {
														 
     $(this).delay(delayAni).animate({opacity:1}, 300); delayAni += 150; }
   );

$(".smallPost").each(function() {
														 
     $(this).delay(delayAni).animate({opacity:1}, 300); delayAni += 150; }
   );
   
//animate portfolio items and post image on hover
 $(".oneColumnImage").hover(function() {
    $(this).animate({ 
                                 opacity: 0.8
                                 },200, "easeOutCubic");

},function(){
    $(this).animate({
                                 opacity: 1
                                 },200, "easeOutCubic");
    });
 
 $(".slideThumb").hover(function() {
    $(this).animate({ 
                                 opacity: 0.8
                                 },200, "easeOutCubic");

},function(){
    $(this).animate({
                                 opacity: 1
                                 },200, "easeOutCubic");
    });
   

 $(".twoColumnsImage").hover(function() {
    $(this).animate({ 
                                 opacity: 0.8
                                 },200, "easeOutCubic");

},function(){
    $(this).animate({
                                 opacity: 1
                                 },200, "easeOutCubic");
    });


   
$(".threeColumnsImage").hover(function() {
    $(this).animate({ 
                                 opacity: 0.5
                                 },200, "easeOutCubic");

},function(){
    $(this).animate({
                                 opacity: 1
                                 },200, "easeOutCubic");
    });

$(".frontItemImage").hover(function() {
    $(this).animate({ 
                                 opacity: 0.8
                                 },200, "easeOutCubic");

},function(){
    $(this).animate({
                                 opacity: 1
                                 },200, "easeOutCubic");
    });

$(".smallPostImage").hover(function() {
    $(this).animate({ 
                                 opacity: 0.8
                                 },200, "easeOutCubic");

},function(){
    $(this).animate({
                                 opacity: 1
                                 },200, "easeOutCubic");
    });


$(".postLargeImage").hover(function() {
    $(this).animate({ 
                                 opacity: 0.8
                                 },200, "easeOutCubic");

},function(){
    $(this).animate({
                                 opacity: 1
                                 },200, "easeOutCubic");
    });


$(".widgetTabsThumb").hover(function() {
    $(this).animate({ 
                                 opacity: 0.8
                                 },200, "easeOutCubic");

},function(){
    $(this).animate({
                                 opacity: 1
                                 },200, "easeOutCubic");
    });

// cycle plugin
$('#sliderOne').cycle({

	        fx:     'fade',  // effect
			sync:          1,     // true if in/out transitions should occur simultaneously 
            easing: 'linear', // set the easing you want , easeInElastic, easeOutBack  ...
	        speed:  700,    // speed of transition
	        timeout: 3800,    // timeout of the slide
            pause:       false,     // true to enable "pause on hover"
            pauseOnPagerHover: false, // true to pause when hovering over pager link
	        pager:  '#sliderNavList',
	        pagerAnchorBuilder: function(idx, slideModule) {
	            // return sel string for existing anchor
	            return '#sliderNavList li:eq(' + (idx) + ') a';
	        },
			next:   '#nextSlideOne',
            prev:   '#prevSlideOne',
            cleartypeNoBg: true,  // fix cleartype inside slides
            cleartype: true  // fix cleartype inside slides
	    });
       
		
$('#itemsSlider').cycle({

	        fx:     'scrollLeft',  // effect
			sync:          1,     // true if in/out transitions should occur simultaneously 
            easing: 'easeOutQuad', // set the easing you want , easeInElastic, easeOutBack  ...
	        speed:  1200,    // speed of transition
	        timeout: null,    // timeout of the slide
            pause:       false,     // true to enable "pause on hover"
            pauseOnPagerHover: false, // true to pause when hovering over pager link
            next:   '#nextSlide',
            prev:   '#prevSlide',
            cleartypeNoBg: true,  // fix cleartype inside slides
            cleartype: true  // fix cleartype inside slides
	    });

//pretty photo
$("a[rel^='prettyPhoto']").prettyPhoto({
		    theme: 'light_square',
			social_tools: false,
			deeplinking: false,
									   });

  }); //ducument ready ends
