	$(document).ready(function () {

//Make DIV Clickable
$(".p-block").click(function(){
     window.location=$(this).find("a").attr("href");
     return false;
});

//$('.p-block img').css({opacity:0.5});
//$('.p-block .port').css({opacity:0.6});


		$('.p-block').hover(function() {
			//hover in
			//$('.p-block img').stop().fadeTo('slow',1.0);
			//$('.p-block .port').stop().fadeTo('slow',1.0);
			var img = $('img', this)
			var text = $('.port', this)
			img.stop().fadeTo('slow',1.0);			
			text.stop().fadeTo('slow',1.0);
		}, function (){
			//hover out
			//$('.p-block img').stop().fadeTo('slow',0.5);
			//$('.p-block .port').stop().fadeTo('slow',0.6);
			var img = $('img', this)
			var text = $('.port', this)
			img.stop().fadeTo('slow',0.5);			
			text.stop().fadeTo('slow',0.6);
					});


/*
		$('a.port-image').hover(function() {
			//hover in
			var div = $('> img', this)
			div.fadeOut(250);
		}, function (){
			//hover out
			var div = $('> img', this)
			div.fadeIn(600);
					});
*/
		$('a.next').hover(function() {
			//hover in
			var span = $('> span', this)
			span.fadeIn(250);
		}, function (){
			//hover out
			var span = $('> span', this)
			span.fadeOut(250);
					});

		$('a.prev').hover(function() {
			//hover in
			var span = $('> span', this)
			span.fadeIn(0);
		}, function (){
			//hover out
			var span = $('> span', this)
			span.fadeOut(0);
					});

		$('a.btn-more').hover(function() {
			//hover in
			var span = $('> span', this)
			span.fadeIn(250);
		}, function (){
			//hover out
			var span = $('> span', this)
			span.fadeOut(250);
					});

				$('li.portfolio a:not(.page-id-6 li.portfolio a, .single-post li.portfolio a)').hover(function(){ 
					//hover in
					var span = $('> span', this)
			       $(this).animate({backgroundPosition: '102px 0px'}); 
			       span.animate({backgroundPosition: '0px 0px'}); 
			     }, function (){
					//hover out
					var span = $('> span', this)
			       $(this).animate({backgroundPosition: '0px 0px'}); 
			       span.animate({backgroundPosition: '102px 0px'}); 
  				 });
   
				$('li.about a:not(.page-id-91 li.about a)').hover(function(){ 
					//hover in
					var span = $('> span', this)
			       $(this).animate({backgroundPosition: '102px -23px'}); 
			       span.animate({backgroundPosition: '0px -23px'}); 
 			     }, function (){
					//hover out
					var span = $('> span', this)
			       $(this).animate({backgroundPosition: '0px -23px'}); 
			       span.animate({backgroundPosition: '102px -23px'}); 			
  				 });

				$('li.resume a:not(.page-id-100 li.resume a)').hover(function(){ 
					//hover in
					var span = $('> span', this)
			       $(this).animate({backgroundPosition: '102px -46px'}); 
			       span.animate({backgroundPosition: '0px -46px'}); 
 			     }, function (){
					//hover out
					var span = $('> span', this)
			       $(this).animate({backgroundPosition: '0px -46px'}); 
			       span.animate({backgroundPosition: '102px -46px'}); 			
  				 });

				$('li.contact a:not(.page-id-8 li.contact a)').hover(function(){ 
					//hover in
					var span = $('> span', this)
			       $(this).animate({backgroundPosition: '102px -69px'}); 
			       span.animate({backgroundPosition: '0px -69px'}); 
 			     }, function (){
					//hover out
					var span = $('> span', this)
			       $(this).animate({backgroundPosition: '0px -69px'}); 
			       span.animate({backgroundPosition: '102px -69px'}); 			
  				 });
			



//fade in .mainConainer HTML delay 1000 and fadeIn 0600 are good settings		
$('.page-id-4 #layer').hide().delay(1000).fadeIn(0600);

// initialize scrollable
//10000 is good setting for interval
$(".scrollable").scrollable({circular: false}).autoscroll(10000);

// flashembed
flashembed("#flash", {src: "/wp-content/themes/jt30/swf/logo-static.swf", wmode: 'transparent', version: [10, 0]});
//flashembed("#flash", {src: "/wp-content/themes/jt30/swf/logo.swf", wmode: 'transparent', version: [10, 0]});
$(".page-id-4 div#flash").flashembed({src: "/wp-content/themes/jt30/swf/logo.swf", wmode: 'transparent', version: [10, 0]});

		
// ***SHOW AND HIDE FOOTER LINKS***
	$('.showNav').addClass('showNavOver');
	if($.cookie("jt_cookie") == ('show_nav')) {
	$('.socialNav').show();
	$('.showNav').addClass('showNavOver');
	 } 
	$('.showNav').click(function() {
	if($('.socialNav').is(':visible')) {
	//alert ('visible');
	$(this).hide();
	$('.socialNav').hide('slide', { direction: 'right' }, 500);
	$.cookie('jt_cookie', 'hide_nav');
	$(this).delay(400).fadeIn(500).removeClass('showNavOver');
	} else {
	//alert( "Hidden" );
	$(this).hide();
	$('.socialNav').show('slide', { direction: 'right' }, 500);
	$.cookie('jt_cookie', 'show_nav');
	$(this).delay(400).fadeIn(500).addClass('showNavOver');
	//alert( "show" );
	}

}); 

});
