/*-----------------------------------------------------------------------------------*/
/*	IMAGE HOVER
/*-----------------------------------------------------------------------------------*/

$(function() {
$("ul.grid li img, .gallery img, #thumbs span img, .post-thumb img, .project img, .homepage_post img, .gallery_third img, .recent_post img, .img-project img, .img-project-two-columns img, .img-one-fourth img, .img-gallery-two-columns img, .img-one-third img, .img-post-two-columns img, .img-post-one-column img, .flickr img, #carousel li img").css("opacity","1.0");
$("ul.grid li img, .gallery img, #thumbs span img, .post-thumb img, .project img, .homepage_post img, .gallery_third img, .recent_post img, .img-project img, .img-project-two-columns img, .img-one-fourth img, .img-gallery-two-columns img, .img-one-third img, .img-post-two-columns img, .img-post-one-column img, .flickr img, #carousel li img, #flickr_widget li img").hover(function () {
$(this).stop().animate({ opacity: 0.5 }, "fast");  },
function () {
$(this).stop().animate({ opacity: 1.0 }, "slow");
});

});

/*-----------------------------------------------------------------------------------*/
/*	JQUERY : NIVO SLIDER ETC...
/*-----------------------------------------------------------------------------------*/
jQuery(document).ready(function(){

	// Nivo slider
	jQuery(window).load(function() {
        jQuery('#slider').nivoSlider();
    });

	/* This is basic - uses default settings */
	jQuery("a.project-list-thumb").fancybox();

	jQuery("a.image").fancybox();

	/* Using custom settings */

	jQuery("a#inline").fancybox({
			'hideOnContentClick': true
	});

	/* Apply fancybox to multiple items */
	jQuery(".youtube_video").click(function() {
	jQuery.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'		    : 680,
			'height'		: 495,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});
	return false;
	});

	jQuery(".vimeo_video").click(function(){
	jQuery.fancybox({
			'padding':0,
			'autoScale':false,
			'transitionIn':'none',
			'transitionOut':'none',
			'title':this.title,
			'width':600,
			'height':398,
			'href':this.href.replace(new RegExp("([0-9])","i"),'moogaloop.swf?clip_id=$1'),'type':'swf'
			});
	return false;

	});
});


jQuery(function() {

	function mainmenu(){
		jQuery(" #nav ul ").css({display: "none"}); // Opera Fix
		jQuery(" #nav li").hover(function(){
		jQuery(this).find('ul:first').css({visibility: "visible",display: "none"}).show(200);
		},function(){
		jQuery(this).find('ul:first').css({visibility: "hidden"});
	});
	}

 	jQuery(document).ready(function(){
		mainmenu();
	});

	// tipsy
	jQuery('#example-1').tipsy();

    jQuery('#north').tipsy({gravity: 'n'});
    jQuery('#south').tipsy({gravity: 's'});
    jQuery('#east').tipsy({gravity: 'e'});
    jQuery('#west').tipsy({gravity: 'w'});

	jQuery('.social_icons').tipsy({gravity: 's'});
	jQuery('.social_icons_footer').tipsy({gravity: 's'});

    jQuery('#auto-gravity').tipsy({gravity: jQuery.fn.tipsy.autoNS});

    jQuery('#example-fade').tipsy({fade: true});

    jQuery('#example-custom-attribute').tipsy({title: 'id'});
    jQuery('#example-callback').tipsy({title: function() { return this.getAttribute('original-title').toUpperCase(); } });
    jQuery('#example-fallback').tipsy({fallback: "Where's my tooltip yo'?" });

    jQuery('#example-html').tipsy({html: true });

	// fade in #back-top
	jQuery(function () {

		// scroll body to 0px on click
		jQuery('.backtop a').click(function () {
			jQuery('body,html').animate({
				scrollTop: 0
			}, 800);
			return false;
		});
	});

  });
