
$(document).ready(function(){

	$('.singleBox').slideDown('fast');
	
 	$('.portfolioEntryTitle').click(function(){
 		// Check to see if its open or closed
 		// If its OPEN
 		if ( $(this).next().css("display") != "none" ){
 			// Close it
 			$(this).next().slideUp();
 		}
 		// If its CLOSED
 		else { 
 			// Close all others 			
 			$('.portfolioEntryTitle').each(function(){
 				if ( $(this).next().css("display") != "none" ){
 					$(this).next().slideUp();
 				}
 			});
 			// Then open this one
 			$(this).next().slideDown();
            $(this).next().children().each(function(){ 
            	if ( $(this).hasClass("anythingSlider") ) {
            		if ( !$(this).hasClass("initiated")) { 
	            		$(this).anythingSlider({
			                easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
			                autoPlay: false,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
			                delay: 3000,                    // How long between slide transitions in AutoPlay mode
			                startStopped: true,            // If autoPlay is on, this can force it to start stopped
			                animationTime: 600,             // How long the slide transition takes
			                hashTags: true,                 // Should links change the hashtag in the URL?
			                buildNavigation: true           // If true, builds and list of anchor links to link to each slide
			            });
			            $(this).addClass("initiated");
            		}	
            	}
            });
        }
 	});
 	
 	
 	$('.blogEntryTitle').click(function(){
 		// Check to see if its open or closed
 		// If its OPEN
 		if ( $(this).next().css("display") != "none" ){
 			// Close it
 			$(this).next().slideUp();
 		}
 		// If its CLOSED
 		else { 
 			// Close all others 			
 			$('.blogEntryTitle').each(function(){
 				if ( $(this).next().css("display") != "none" ){
 					$(this).next().slideUp();
 				}
 			});
 			// Then open this one
 			$(this).next().slideDown();
            $(this).next().children().each(function(){ 
            	if ( $(this).hasClass("anythingSlider") ) {
            		if ( !$(this).hasClass("initiated")) { 
	            		$(this).anythingSlider({
			                easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
			                autoPlay: false,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
			                delay: 3000,                    // How long between slide transitions in AutoPlay mode
			                startStopped: true,            // If autoPlay is on, this can force it to start stopped
			                animationTime: 600,             // How long the slide transition takes
			                hashTags: true,                 // Should links change the hashtag in the URL?
			                buildNavigation: true           // If true, builds and list of anchor links to link to each slide
			            });
			            $(this).addClass("initiated");
            		}	
            	}
            });
        }
 	});
 	
 	
    if (typeof pageTracker != 'undefined') {
        pageTracker._trackEvent(
            'Browser Dimensions',
            'load',
            $(window).width()
                + 'x'
                + $(window).height(),
            $(window).width()
        );

        $(window).resize(function () {
            if ($(this).data('gatimer')) {
                clearTimeout($(this).data('gatimer'));
                $(this).data('gatimer', null);
            }

            $(this).data(
                'gatimer',
                setTimeout(function () {
                    pageTracker._trackEvent(
                        'Browser Dimensions',
                        'resize',
                        $(window).width()
                            + 'x'
                            + $(window).height(),
                        $(window).width()
                        );
                    },
                    500
                )
            );
        });
    }

});