$(document).ready(function() {

	jQuery('html').addClass('javascript-enabled');
	
	var $window_height = $(window).height();
	
	$(window).resize(function() {
		var $window_height = $(window).height();
	});
	
	$("#nav-universal li:not(#nav-primary li li)").hover(
	  function () {
	    $(this).children("ul").css('display','block');
	  }, 
	  function () {
	    $(this).children("ul").css('display','none');
	  }
	);
	
	var raw_slide = $('<img />').attr('src', 'http://www.passion-dev.com/files/images/raw-slide.png');
	
	$("body#home .site-slide").fadeOut(500, function() {
	  	$('.site-slide').css('height','0px');
		$('.site-slide').css('display','none');
		$('.logo').addClass('loaded');
	  });
    
    $("#nav-universal li li a").click(function(event){
        if (!$('body').hasClass($(this).attr('id'))) {
			$(".site-slide").addClass("sliding");
			if ($(this).attr('id') == "strange-beast"){
				$('.site-slide').css('top', '0px');
			}
			if ($(this).attr('id') == "raw"){
				$window_height = $window_height + 100;
			}
			event.preventDefault();
	        linkLocation = this.href;
			$('.site-slide').attr('id', $(this).attr('id')).animate({
	            height: $window_height
	        }, 1000, redirectPage);
		}        
    });

    function redirectPage() {
        window.location = linkLocation;
    }

	$("#search input[type='text']").placeholder();
	
	jQuery('.contacts-listing li a.slider').click(function(event){
		event.preventDefault();
		$(this).parents("li").children("div").slideToggle('fast');
		$(this).parents("li").children("div").toggleClass('open');
	});
	
	jQuery('.year h2 a').click(function(event){
		event.preventDefault();
		$(this).parents("div").children("div.awards").slideToggle('fast');
		$(this).parents("div").children("div.awards").toggleClass('open');
	});

});

