/*
This clears out the "hint" in the input fields and clears them out. Replaces with the original hint if no text is entered.
Thanks to Jörn Zaefferer:
http://bassistance.de/2007/01/23/unobtrusive-clear-searchfield-on-focus/
*/
$.fn.clearField = function() {
	return this.addClass('hint-text').focus(function() {
		if( this.value == this.defaultValue ) {
			this.value = "";
      $(this).removeClass('hint-text');
		}
	}).blur(function() {
		if( !this.value.length ) {
			this.value = this.defaultValue;
      $(this).addClass('hint-text');
		}
	});
};



/*
Rollovers for the input type="image".
Thanks to Atlanta Jones:
http://www.atlantajones.com/2008/07/02/even-easier-jquery-rollovers/
*/
$.fn.rollOver = function() {
	// Set the original src
	rollsrc = $(this).attr("src");
	if (rollsrc) {
		rollON = rollsrc.replace('off', 'on');
		newImg = new Image(); // create new image obj
		$(newImg).attr("src", rollON); // set new obj's src
	}
	
	this.mouseover(function() {
		imgsrc = $(this).attr("src");
		if (typeof(imgsrc) != 'undefined') {
		imgsrcON = imgsrc.replace('off', 'on');
		$(this).attr("src", imgsrcON);
		}
	});

	// Handle mouseout
	this.mouseout(function(){
		if (typeof(imgsrc) != 'undefined') {
		$(this).attr("src", imgsrc);
		}
	});
};



/*
Initialize
*/
$(function() {
    $("#about").hide();
    $("#aid").hide();

    $("#nav .overview a").click(function(e) {
        e.preventDefault();
        $("#about").hide();
        $("#aid").hide();

        $(".active").removeClass('active');
        $(".overview").addClass("active");
        $("#overview").show();
    });

    $("#nav .about a").click(function(e) {
    $("#overview").hide();
    $("#aid").hide();

        e.preventDefault();
        $(".active").removeClass('active');
        $(".about").addClass("active");
        $("#about").show();
    });

    $("#nav .aid a").click(function(e) {
    $("#about").hide();
    $("#overview").hide();
    e.preventDefault();
        $(".active").removeClass('active');
        $(".aid").addClass("active");
        $("#aid").show();
    });
});

