/* Author: shawn@tinyearth.net */
$(document).ready(function() {

	if ($('.ie7, .ie8').length == 1) {
		$('#wrap_foot').wrap('<div class="watermark" />');
	}

	if ($('.ie7, .ie8').length == 0) {
		// Animated Navigation
		$('nav.site li').removeClass('push');	
		$('nav.site li a:not(.current)').each(function(index) {
			
			var position = $(this).css('backgroundPosition').split(" ",2);
			var x = parseInt(position[0]);
			var y = parseInt(position[1]);
	
			// object literals
			var move = {
				push : x + ' 0',
				pull : x + ' ' + y
			};		
	
			$(this).hover(
				function() {
					$(this).animate( {
						backgroundPosition: move.push,
						height: 112
					}, 200, function() {
						// Animation complete.
					});
				},
				function() {
					$(this).animate({
						backgroundPosition: move.pull,
						height: 112
					}, 200, function() {
						// Animation complete.
					});
				}
			);
		});
	}

	// Custom Scrollbars
	if ($('#main').length > 0) {
		if ($.browser.msie && $.browser.version.substr(0,1)<9) {
			return
		} else {
			$('#main').parents('#wrap_body').addClass('scroll');
			$('#main').scrollbar();
		}
	}

	// Timeline content code
	$(".timeline .tile a").click(function(){
		var href = $(this).attr("href")
		var eid = href.split("#")[1]
		var content = $("#"+eid).html() 
		$("#timeline-content").html(content);
		return false;
	})


});

