jQuery.fn.simpleImageRollover = function(preload) {
    if (preload) {
        this.each(function() {
            var i = new Image;
            i.src = this.src;
        });
    }
    this.hover(
        function() { this.src = this.src.replace(/\.(\w+)$/, '_h.$1'); },
        function() { this.src = this.src.replace(/_h\.(\w+)$/, '.$1'); }
    );
}

$(function() {
	$('input').each(function() { $(this).addClass(this.type); });
	$('#nav img').simpleImageRollover();
	
	if ($('#slideshow').length) {
		setInterval(function() {
			$('#slideshow li:last').animate({opacity: 0}, function() {
				$(this).prependTo('#slideshow').css({opacity: 1});
			});
		}, 5000);
	}
});