// FONT REPLACEMENT
// Replace all tags with cufon equivalant
Cufon.replace('h1,h2,h3,h4,h5,h6,#commentform label,.postnavigation a,.message');

// jQuery Start
(function($){

	$(function () {

		// Scroll to top animation
		$('a.scroll-top').click(function () {

			$('html, body').animate({
				scrollTop: 0
			}, 'slow');
			return false;

		});

		// Clear searchform on click
		$("#searchform #s").click(function () {

			$(this).val("");

		});

		// Dropdown Menu config
		$("ul.sf-menu").supersubs({
			minWidth: 12,
			maxWidth: 30,
			extraWidth: 1
		}).superfish();
		// extra width can ensure lines don't sometimes turn over 
		// due to slight rounding differences and font-family 
		// call supersubs first, then superfish, so that subs are 
		//not display:none when measuring. 
		//Call before initialising containing tabs for same reason.
	});

	$('#slider LI IMG').attr("usemap","HomeBoardMap");
	setTimeout(setFloatboxKicks,1500)

	function setFloatboxKicks(){
		$('#skydivingvideo').click(function(){
			fb.start('http://vimeo.com/14829621',"width:600 height:450 caption:`My First Plane Ride` color:black");
		});
		$('#Travis-Hasselbeck-video').click(function(){
			fb.start('http://www.vimeo.com/20232679',"width:640 height:360 caption:`Travis Hasselebck 2010 highlights` color:black");
		});
		/*
		 * $('#2009video').click(function(){
		 *	fb.start('http://vimeo.com/14841436',"width:640 height:360 caption:`A recap of 2009. A great year in my life.` color:black");
		 * }); 
		 */
		$('#YouVersion').click(function(){
			fb.start('http://read.ly/Matt7.7.NIV');
		});
		$('#myResume').click(function(){
			fb.start('http://resume.justinobney.com');
		});
	}
	
setTimeout(function(){
	   $('ul#slider').append('<li id="HomeBoardContainer"><div id="HomeBoardTitle">Click a picture for a story</div></li>');
		
		$('#HomeBoardContainer').css({
			position: 'absolute',
			bottom: '55px',
			width: '100%'
		});
		
		$('#HomeBoardTitle').css({
			'color': '#FFF',
			'text-align': 'center',
			'text-shadow': '2px 2px 2px #000',
			'font-size': '20px'
		});
		
		$('#HomeBoardMap AREA').hover(function(){
				$('#HomeBoardTitle').html(this.title);
			},function(){
				$('#HomeBoardTitle').html("Click a picture for a story");
		});
},2000);
	
})(window.jQuery);
