// Index Page

var width, left, hover;
left = width = 0;
hover = false;

function slide() {
    if(!hover) {
        $list = $("#mainPageSplash ul");
        left -= 3;
        if (-(left) > width) {
            left = 0;
            $list.css({'padding-left':width+10+'px'});
            $("#mainPageSplash ul li:first-child").clone().appendTo($list);
            $("#mainPageSplash ul li:first-child").remove();
            $list.css({'padding-left':'0px'});
            width = $("#mainPageSplash ul li:first-child").width();
        }

        $list.css({'left': left + 'px'});
    }
}

// Bio Page

$( function () {
	if( $("#mainPageSplash ul").length != 0) {
	    $("#mainPageSplash ul").hover( function () {
	        hover = true;
	    }, function () {
	        hover = false;
	    });
	    width = $("#mainPageSplash ul li:first-child").width();
	    setInterval(slide, 10);
	}

	if( $("#over_bio ul li a").length != 0) {
		$("#over_bio ul li a").each( function (e) {
			$(this).attr("rel", $(this).attr("href"));
			$(this).attr("href", "#");
		});
		$("#over_bio ul li a").live('click', function (e) {
			$("body").css({"overflow":"hidden"});
			$("#overWhite .title").html(($(this).text()));
			$("#overWhite").fadeIn();
			$('#overWhite .content-box').load($(this).attr("rel"));
		});
		$("#overWhiteHide").click( function () {
			$("body").css({"overflow":"auto"});
			$("#overWhite").fadeOut( function () {
				$('#overWhite .title').html("");
				$('#overWhite .content-box').html("");
			});
		});
	}
});

