$(document).ready(function(){

	// SCROLL TO #TOP
	$('a.gototop,a.bt-top').click(function(){
	$.scrollTo('#wrapper',1000);
	return false;
	});

	// SCROLL TO SECTION PRECEDENTE
	$('.bloc-bas,ol.refs li').click(function(){
	var prev = $(this).find("a").attr("href");
	$.scrollTo(prev,600);
	return false;
	});

  // BOUTONS CONTACT ET PORTFOLIO SUR LA HOME
  
	$('#bloc-presentation a.tipfix').hover(function(){
	$(this).animate({scale: '1.20'}, 600,'easeOutBounce');
	   if(jQuery.support.opacity) {
      $(this).find('img').fadeTo("fast",1);
}
else {
  $('img',this).stop().animate({marginTop : '+10px'}, 600,'easeOutBounce');
}
   },function(){
   if(jQuery.support.opacity) {
      $(this).find('img').fadeTo("slow",0.8);
}
else {
  $('img',this).stop().animate({marginTop : '0'}, 600);
}
      $(this).animate({scale: '1'}, 1000);
   });

   
   
  // VISUEL ARTWORKS SUR LA HOME
  
	$('#bloc-artworks .featured-cadre').hover(function(){
	$(this).animate({scale: '1.10'}, 600,'easeOutBounce');
   },function(){
      $(this).animate({scale: '1'}, 800);
   });

   
	
  // SLIDES DANS PORTFOLIO GALERIE
	
	$('.galerie-thumb').hover(function(){
      $('img.galleryImg',this).stop().animate({
	  	marginTop : '+24px',
	  }, 300).css('border', '1px solid #f20055');
	  $('.slide-lien a',this).stop().animate({
	  	bottom : '0'
	  }, 300).fadeTo("fast",0.8);
	  $('.slide-title',this).fadeTo("fast",1);
	  $('.zoom',this).stop().animate({
	  	top : '-125px'
	  }, 300);

	}, function() {
	$('.zoom',this).stop().animate({
	  	top : '135px'
	  }, 2000);
	$('.slide-title',this).fadeTo("fast",0);
	$('.slide-lien a',this).stop().animate({
	  	bottom : '-34px',
	  }, 300);
      $('img.galleryImg',this).stop().animate({
	  	marginTop : '+4px',
	  }, 400).css('border', '1px solid #FFF');
	  
	});
	
  // SLIDES DANS PORTFOLIO CATEGORIE
	
	$('a.fiche').hover(function(){
	  $(this).fadeTo("fast",1);
      $('img',this).stop().animate({
	  	marginTop : '-10px',
	  }, 500).css('border', '1px solid #f20055');

	}, function() {
      $('img',this).stop().animate({
	  	marginTop : '+10px',
	  }, 500).css('border', '1px solid #DDD');
	  $(this).fadeTo("fast",0.9);
	});
	
  // SUBMENU

	$('#access ul li').hover(function(){
	$(this).find('ul.sub-menu').show(500,'easeOutBounce');
   },function(){
      $(this).find('ul.sub-menu').hide("fast");
   });
	
  // MENU HIGHLIGHT

  	$('#access li a,.addthis_toolbox1 a').css({
		opacity : '0.7'
	});
	$('#access li.current-menu-item a').css({
		opacity : '1'
	});
	$('#access li a,.addthis_toolbox1 a').hover(function(){
	$(this).fadeTo("slow",1);
   },function(){
      $(this).fadeTo("slow",0.7);
   });

	
/* TOOLTIP QTIP (By suppling no content attribute, the library uses each elements title attribute by default)
$("dfn[title],abbr[title]").qtip({
	style: { 
      width: { min: 25 },
      padding: 5,
      background: '#eee',
      color: '#0e386f',
      textAlign: 'justify',
	  tip: 'topMiddle',
	  border: {
         width: 0,
         radius: 5,
         color: '#FFF'
		}
	},

	position: {
    target: 'mouse',
    adjust: { mouse: true, screen: true }
	}
   });
   $(".bloc a[title]").qtip({
	style: { 
      width: { min: 25 },
      padding: 5,
      background: '#eee',
      color: '#f20055',
      textAlign: 'justify',
	  tip: 'topMiddle',
	  border: {
         width: 0,
         radius: 5,
         color: '#FFF'
		}
	},

	position: {
    target: 'mouse',
    adjust: { mouse: true, screen: true }
	}
   });
   
$(".bottom a[title],.bloc-bas a[title],.tipfix").qtip({
	show: { effect: { type: 'slide',
					  length: 200
					}
	},
	style: { 
      width: { min: 25 },
      padding: 5,
      background: '#F9f9f9',
      color: '#f20055',
      textAlign: 'justify',
	  tip: 'topMiddle',
	  border: {
         width: 0,
         radius: 5,
         color: '#FFF'
		}
	},
	position: { corner: {
				target: 'bottomMiddle',
				tooltip: 'topMiddle'
						}
			  }

			  
   });
   
$("#access li#menu-item-15 a[title],#access li#menu-item-14 a[title],#access li#menu-item-11 a[title]").qtip({
	show: { effect: { type: 'slide',
					  length: 200
					}
	},
	style: { 
      width: { min: 25 },
      padding: 5,
      background: '#F9f9f9',
      color: '#f20055',
      textAlign: 'justify',
	  tip: 'topMiddle',
	  border: {
         width: 0,
         radius: 5,
         color: '#FFF'
		}
	},
	position: { corner: {
				target: 'bottomMiddle',
				tooltip: 'topMiddle'
						}
			  }
			  
   });
$("#access li#menu-item-13 a[title],#access li#menu-item-12 a[title]").qtip({
	show: { effect: { type: 'slide',
					  length: 200
					}
	},
	style: { 
      width: { min: 25 },
      padding: 5,
      background: '#F9f9f9',
      color: '#f20055',
      textAlign: 'justify',
	  tip: 'topRight',
	  border: {
         width: 0,
         radius: 5,
         color: '#FFF'
		}
	},
	position: { corner: {
				target: 'bottomLeft',
				tooltip: 'topRight'
						}
			  }
			  
   });

$('.tipfix2').qtip({
	show: { effect: { type: 'slide',
					  length: 200
					}
	},
	style: { 
      width: { min: 25 },
      padding: 5,
      background: '#F9f9f9',
      color: '#0e386f',
      textAlign: 'justify',
	  tip: 'bottomMiddle',
	  border: {
         width: 0,
         radius: 5,
         color: '#FFF'
		}
	},

	position: { corner: {
				target: 'topMiddle',
				tooltip: 'bottomMiddle'
						}
			  }
			  
   });
$('.tipfix3').qtip({
	show: { effect: { type: 'slide',
					  length: 200
					}
	},
	style: { 
      width: { min: 25 },
      padding: 5,
      background: '#F9f9f9',
      color: '#0e386f',
      textAlign: 'justify',
	  tip: 'bottomMiddle',
	  border: {
         width: 0,
         radius: 5,
         color: '#eee'
		}
	},

	position: { corner: {
				target: 'topMiddle',
				tooltip: 'bottomMiddle'
						}
			  }
			  
   });
   
  $('a.tooltip2').qtip({
	style: { 
      width: 436,
      padding: 0,
      background: '#FFF',
      color: '#6fa900',
      textAlign: 'center',
		border: {
         width: 1,
         radius: 5,
         color: '#DDD'
		}
	},
	position: {
    target: 'mouse',
    adjust: { mouse: true, screen: true }
	}
   });
   
   $('a.qtip').qtip({
	style: { 
      tip: 'topMiddle',
	  name: 'dark',
	  width: { min: 25, max: 100  }
	},
   	position: {
    adjust: { x: -40, y: 0 }
	}

   });
*/


  $("#colophon a[title],#services a[title], ol a[title],#media-sociaux a[title],.featured-cadre img[title],#featured img[title],.galerie-thumb a[title],.galerie-thumb span[title]").qtip({
	style: {
		classes: 'ui-tooltip-jtools'
   },
   position: {
		my: 'top left',
		at: 'bottom center',
		target: 'mouse',
		adjust: {
		y: 10,
        mouse: true  // Can be ommited (e.g. default behaviour)
			}
		}
	
  });


  $(".bottom a[title],.bloc-bas a[title],.tipfix").qtip({
  
	style: {
		classes: 'ui-tooltip-jtools'
   },
   position: {
		my: 'top center',
		at: 'bottom center',
		adjust: { y: 3 }
		},
	show: {
   effect: function(offset) {
       $(this).show('drop', {distance: 10, direction: 'down'}, 300);
        }
    },
	hide: {
	event : 'mouseleave' ,
   effect: function(offset) {
       $(this).hide('drop', {distance: 5, direction: 'down'}, 500);
        }
    }
  });
  
  $(".tipfix2").qtip({
	style: {
		classes: 'ui-tooltip-jtools jtools-tipfix2'
   },
   position: {
		my: 'bottom center',
		at: 'top center',
		adjust: { y: 5 }
		},
	show: {
   effect: function(offset) {
       $(this).show('drop', {distance: 10, direction: 'up'}, 300);
        }
    },
	hide: {
	event : 'mouseleave' ,
   effect: function(offset) {
       $(this).hide('drop', {distance: 5, direction: 'up'}, 500);
        }
    }
  });

  $("dfn[title],abbr[title]").qtip({
	style: {
		classes: 'ui-tooltip-jtools jtools-dfn'
   },
   position: {
		my: 'top center',
		at: 'bottom center'
		},
	show: {
   effect: function(offset) {
       $(this).show('drop', {distance: 10, direction: 'left'}, 300);
        }
    },
	hide: {
	event : 'mouseleave' ,
   effect: function(offset) {
       $(this).hide('drop', {distance: 15, direction: 'right'}, 300);
        }
    }
  });
  
  $("#access li#menu-item-15 a[title],#access li#menu-item-14 a[title],#menu-pictos a[title]").qtip({
	style: {
		classes: 'ui-tooltip-jtools jtools-menu'
   },
   position: {
		my: 'top center',
		at: 'bottom center',
		adjust: { y: 5 }
		},
	show: {
   effect: function(offset) {
       $(this).show('drop', {distance: 10, direction: 'down'}, 300);
        }
    },
	hide: {
	event : 'mouseleave' ,
   effect: function(offset) {
       $(this).hide('drop', {distance: 5, direction: 'down'}, 300);
        }
    }
  });

  
  $("#access li#menu-item-11 a[title],li#menu-item-12 a[title],li#menu-item-13 a[title]").qtip({
	style: {
		classes: 'ui-tooltip-jtools jtools-menu'
   },
   position: {
		my: 'middle left',
		at: 'middle right'
		},
	show: {
	effect: function(offset) {
       $(this).show('drop', {distance: 10, direction: 'left'}, 300);
        }
    },
	hide: {
	event : 'mouseleave' ,
	effect: function(offset) {
       $(this).hide('drop', {distance: 5, direction: 'left'}, 300);
        }
    }
  });


});
		
