$(document).ready(function() {

	//short url show/hide
	$("li.shorturl span").hide();	
	$('li.shorturl').hover(function() {
		$('.shorturl span').slideDown('slow');
	}, function() {
		$('li.shorturl span').slideUp('slow');	
		
		 return false;
	});

			
	//remove the little dotted outline of a:active
	$('a').click(function() {
  		this.blur();
	});

    // Open external links in a new window
   // $('a[href^="http://"]').attr("target", "_blank");

    // Clear textboxes on focus
    $('.text').autoClear();
	
	
	// simple slideshow of featured work
	
	
	//projects image rollover
	//Set opacity on each span to 0%
    $(".rollover").css({'opacity':'0'});

	$('.projects ul li a').hover(
		function() {
			$(this).find('.rollover').stop().fadeTo(500, 1);
		},
		function() {
			$(this).find('.rollover').stop().fadeTo(500, 0);
		}
	)
	
	//toggle effect to show/hide elements
	$(".toggle_container").hide();
	
	$(".trigger").toggle(function(){
		$(this).addClass("active"); 
		}, function () {
		$(this).removeClass("active");
	});
	
	$(".trigger").click(function(){
		$(".toggle_container").slideToggle("slow");
	});

	
	//Set Hover Class for Anything
	$('#hover-test p').hover(function() {
	  $(this).addClass('hover');
	}, function() {
	  $(this).removeClass('hover');
	});

	//scrollTo - local Scroll
	$.localScroll();



});





// Clears the default text when an input receives
// focus and reinstates it if it is left blank
(function($) {

    $.fn.autoClear = function() {	
        return this.each(function() {
            $(this).focus(function() {
                if( this.value == this.defaultValue ) {
                    this.value = "";
                }
            })
            .blur(function() {
                if( !this.value.length ) {
                    this.value = this.defaultValue;
                }
            });
        });
    };

})(jQuery);

