// FOR LOGO
$(function() {
	//font color animation 
	$("h1 a").stop().hover(function() {
	    $(this).stop().animate({
	        color: "#000000"
	    },
	    400);
	},
	function() {
	    $(this).animate({
	        color: "#56A0D3"
	    },
	    500);
	});
});

// TAGS
$(function() {
	//font color animation 
	$(".tags").stop().hover(function() {
	    $(this).stop().animate({
	        color: "#000000",
			backgroundColor: '#CCCCCC'
	    },
	    200);
	},
	function() {
	    $(this).animate({
	        color: "#999999",
			backgroundColor: '#FFFFFF'
	    },
	    300);
	});
});

// BUTTONS
$(function() {
	//font color animation 
	$("#top-link, .rounded_links_5px, #pagination a").stop().hover(function() {
	    $(this).stop().animate({
	        color: "#FFFFFF",
			backgroundColor: '#333333'
	    },
	    200);
	},
	function() {
	    $(this).animate({
	        color: "#333333",
			backgroundColor: '#CCCCCC'
	    },
	    300);
	});
});

// FOR THUMBNAILS 
$(function() {
	
		$(".cardimgcrop").css("opacity","1.0");

		// ON MOUSE OVER
		$(".cardimgcrop").hover(function () {

			// SET OPACITY TO 1000%
			$(this).stop().animate({
				opacity: 0.75
			}, 200);
			},

			// ON MOUSE OUT
			function () {

			// SET OPACITY BACK TO 50%
			$(this).stop().animate({
				opacity: 1.0
			}, 300);
		
		});

});

// FOR LINKS
$(function() {
	
		$("#twitter_timeline a, #nextprev a, #footer a, #about_contact a, .post p a, .post h3 a, #sidebar-nav li a, .search_links").css("opacity","0.5");

		// ON MOUSE OVER
		$("#twitter_timeline a, #nextprev a, #footer a, #about_contact a, .post p a, .post h3 a, #sidebar-nav li a, .search_links").hover(function () {

			// SET OPACITY TO 1000%
			$(this).stop().animate({
				opacity: 1.0
			}, 200);
			},

			// ON MOUSE OUT
			function () {

			// SET OPACITY BACK TO 50%
			$(this).stop().animate({
				opacity: 0.5
			}, 300);
		
		});

});

// FOR NAV
$(function() {
	$nav_li = $("#nav li");
	$nav_li_selected = $("#nav li.selected");
	$nav_li_a = $nav_li.children("a");
	var animSpeed = 450;
	//fade speed
	var hoverTextColor = "#000";
	//text color on mouse over
	var hoverBackgroundColor = "transparent";
	//background color on mouse over
	var textColor = $nav_li_a.css("color");
	var backgroundColor = $nav_li.css("background-color");
	//init selected
	$nav_li_selected.css("background-color", hoverBackgroundColor).children().css("color", hoverTextColor);
	$nav_li_a.hover(function() {
	    var $this = $(this);
	    $this.stop().animate({
	        color: hoverTextColor
	    },
	    animSpeed).parent().stop().animate({
	        backgroundColor: transparent
	    },
	    animSpeed);
	},
	function() {
	    var $this = $(this);
	    if (!$this.parent().is(".selected")) {
	        $this.stop().animate({
	            color: textColor
	        },
	        animSpeed).parent().stop().animate({
	            backgroundColor: transparent
	        },
	        animSpeed);
	    }
	});
	//selected state
	$nav_li_a.click(function() {
	    var $this = $(this);
	    $this.stop().animate({
	        color: hoverTextColor
	    },
	    animSpeed).parent().stop().animate({
	        //backgroundColor: hoverBackgroundColor
	    },
	    animSpeed).addClass("selected").siblings(".selected").removeClass("selected").stop().animate({
	        //backgroundColor: backgroundColor
	    },
	    animSpeed).children().stop().animate({
	        color: textColor
	    },
	    animSpeed);
	});
});

/*$(function() {
	$('.behance').click(function() {
	  window.open('http://www.behance.net/jasonbishop','_blank');
	});
	$('.dribbble').click(function() {
	  window.open('http://dribbble.com/theebishop','_blank');
	});	
	$('.twitter').click(function() {
	  window.open('https://twitter.com/theebishop','_blank');
	});	
	$('.linkedin').click(function() {
	  window.open('http://www.linkedin.com/pub/jason-bishop/9/42b/a03','_blank');
	});	
	$('.rss').click(function() {
	  window.open('http://jasonbishop.net/index.php/Site/jasonbishop_rss','_blank');
	});
	$('.flickr').click(function() {
	  window.open('http://www.flickr.com/photos/theebishop/','_blank');
	});
	$('.tumblr').click(function() {
	  window.open('http://www.tumblr.com/blog/jasonbishop','_blank');
	});
});*/

/* Search form validator
$(function() {
	$("#searchVal").click(function() {
		alert("test");
		$("#searchForm").validate();
	});
});*/




