
	$(document).ready(function(){
		
		var current_url = window.location.pathname;
		
		if (current_url != "/") {
			$("#blog_main").slideToggle();
			$("#blog").addClass("active_section");
		};
		
		
		var Project_Titles = $("#projects h3");
		
		//$("#project_categories").hide();
		
		// Quality Links Reveal
		$("#quality_links_title").click(function() {
			$("#link_list").slideToggle("fast");
		});
		
		// Contact Me Reveal
		$("#contact_me_trigger").click(function() {
			$("#header").removeClass("active_section");
			$("#header_main").slideUp("fast");
			$("#contact_main").slideDown("fast");
			$("#contact").addClass("active_section");
			$("#header, #projects, #blog").addClass("shade_bg");
		});
				
		// Section Reveal
		$("#header_trigger, #projects_trigger, #blog_trigger, #contact_trigger").click(function() {
		
			var ClickedSection = $(this).parent().parent().parent(".container_wrapper");
			
			if (ClickedSection.hasClass("active_section")) {
				ClickedSection.removeClass("active_section");
				$("#header_main:visible, #projects_main:visible, #blog_main:visible, #contact_main:visible").slideUp("fast");
				if ($(this).hasClass("projects_class")) {
					$("#project_categories").addClass("hidden");
				}
			} else if ($(this).hasClass("projects_class")) {
				$("#header_main:visible, #projects_main:visible, #blog_main:visible, #contact_main:visible").slideUp("fast");
				$("#header, #projects, #blog, #contact").removeClass("active_section");
				$("#project_categories").removeClass("hidden");
				$("#projects_main").slideDown("fast");
				ClickedSection.addClass("active_section");
			} else {
				$("#project_categories:visible").addClass("hidden");
				$("#header_main:visible, #projects_main:visible, #blog_main:visible, #contact_main:visible").slideUp("fast");
				$("#header, #projects, #blog, #contact").removeClass("active_section");
				$(this).parent().siblings("#header_main, #blog_main, #contact_main").slideDown("fast");
				ClickedSection.addClass("active_section").prevAll(".container_wrapper");
			}
		});
		
		
		// Project Categories
		$("#project_categories li").click(function() {
			Project_Titles.removeClass("active_project_title").animate({opacity:'1'},60);
			$("#projects_main .project_content").removeClass("active_project").slideUp("fast");
		});
		
		// Specific Category Select
		//function categorySelect(category){		
		//	$("#project_categories li").removeClass("active_category");
		//	Project_Titles.removeData('faded').hide();
		//	$("#projects_main " + category + " h3").show();
		//	return false;
		//}
		
		// Specific Category Select
		function categorySelect(category){		
			$("#project_categories li").removeClass("active_category");
			Project_Titles.removeData('faded');
			Project_Titles.animate({opacity:'.1'},60);
			$("#projects_main " + category + " h3").stop().animate({opacity:'1'},60);
			return false;
		}

		$("#project_categories li#all").click(function() {
			$("#project_categories li").removeClass("active_category");
			Project_Titles.removeData('faded').fadeIn(200);
			$(this).addClass("active_category");
		});
		
		$("#project_categories li.Commercial").click(function() {
			categorySelect('.Commercial');
			$(this).addClass("active_category");
		});
		
		$("#project_categories li.Short").click(function() {
			categorySelect('.Short');
			$(this).addClass("active_category");
		});
		
		$("#project_categories li.Music").click(function() {
			categorySelect('.Music');
			$(this).addClass("active_category");
		});
		
		$("#project_categories li.Documentary").click(function() {
			categorySelect('.Documentary');
			$(this).addClass("active_category");
		});

		
		// Project Animation on Select
		Project_Titles.click(function() {
		
			var Clicked_Project = $(this).parent().siblings(".project_content");
			
			if (Clicked_Project.hasClass("active_project")) {
				Clicked_Project.removeClass("active_project").slideUp("fast");
				Project_Titles.animate({opacity:'1'},60).removeData('faded');
				$(this).removeClass("active_project_title");
			} else {	
				Project_Titles.removeClass("active_project_title");
				$("#projects_main .active_project").removeClass("active_project").slideUp("fast");
				Clicked_Project.addClass("active_project").slideDown("fast");
				Project_Titles.animate({opacity:'.5'},150).data('faded',true);
				$(this).stop(false, true).removeData('faded').animate({opacity:'1'},60).addClass("active_project_title");
				$(this).siblings('h3').stop(false, true).removeData('faded').animate({opacity:'1'},60).addClass("active_project_title");
			}
		});
			
		// Full Opacity on Hover
		Project_Titles.hover(function() {
			$(this).animate({opacity:'1'},60);
			},
			function() {
			if ($(this).data('faded')) {
				$(this).animate({opacity:'.5'},60);
			};
		});
		
		// Close Project
		$("#projects_main .close_button").click(function() {
			Project_Titles.removeData('faded').removeClass("active_project_title").animate({opacity:'1'},150);
			$(this).parent().parent().parent(".active_project").slideUp("fast").removeClass("active_project");
			//$(this).closest('.active_project').slideUp('fast').removeClass('active_project');
		});
		
		// Hover Slide	
		$('h1.section_trigger').hover(function() {
			$(this).stop().animate({backgroundPosition:'0 -33px'},100);
		}, function() {
			$(this).animate({backgroundPosition:'0 0'},100);
		});
		
		// Project Titles Hover
		$('#projects_main .project_title').hover(function() {
			$(this).children('.top_title').stop().animate({top:'-30px'},120);
			$(this).children('.bottom_title').stop().animate({bottom:'-5px'},120);
		}, function() {
			$(this).children('.top_title').stop().animate({top:'0'},120);
			$(this).children('.bottom_title').stop().animate({bottom:'-30px'},120);
		});
		
		// Footer Images
		var StalkerLinks = $("#text-4 li");
		StalkerLinks.animate({opacity:'.5'},60);
		StalkerLinks.hover(function() {
			$(this).stop().animate({opacity:'1'},120);
			}, function() {
			$(this).stop().animate({opacity:'.5'},200);
		});
		
		// Album Slide
		$('#album_button img').hover(function() {
			$(this).animate({left:'-323px'},200);
		}, function() {
			$(this).animate({left:'0'},200);
		});
		
	});

