//google.load('jquery','1');
//google.setOnLoadCallback(function() {
$(document).ready(function() {
	
	// Do Preloads
	$('<img>').attr('src','/images/v2/bucket_base.png');
	$('<img>').attr('src','/images/v2/bucket_hilite.png');
	$('<img>').attr('src','/images/v2/sesd-callout-o.png');
	$('<img>').attr('src','/images/v2/bucket-a-escape.png');
	$('<img>').attr('src','/images/v2/bucket-a-escape-o.png');
	$('<img>').attr('src','/images/v2/bucket-a-escape-pic.png');
	$('<img>').attr('src','/images/v2/bucket-a-escape-pic-o.png');
	$('<img>').attr('src','/images/v2/bucket-b-explore.png');
	$('<img>').attr('src','/images/v2/bucket-b-explore-o.png');
	$('<img>').attr('src','/images/v2/bucket-b-explore-pic.png');
	$('<img>').attr('src','/images/v2/bucket-b-explore-pic-o.png');
	$('<img>').attr('src','/images/v2/bucket-c-enjoy.png');
	$('<img>').attr('src','/images/v2/bucket-c-enjoy-o.png');
	$('<img>').attr('src','/images/v2/bucket-c-enjoy-pic.png');
	$('<img>').attr('src','/images/v2/bucket-c-enjoy-pic-o.png');
	
	if ($.browser.msie)
	{
		// $('ul#buckets li p').css({'marginTop':'50px'});
	}
	
	$('div#communities ul li a').click(function() {
		window.open($(this).attr('href'));
		return false;
	});
	
	$('<img>').attr('src','/images/backgrounds/canoe.jpg').ready(function() {
		$('div#bg-frame').fadeOut(3500,function(){
			$(this).remove();
		});
	});
	
	$('ul#buckets li,div.left').click(function() {
		window.location.href = 'http://www.southeastsouthdakota.com/';
	})
	$('ul#buckets li').hover(
		function() {
			$(this).css({backgroundImage:'url(/images/v2/bucket_hilite.png)'});
			var cls = this.className;
			var title = $('h1',this).text();
			$('h1',this).css({backgroundImage:'url(/images/v2/bucket-'+cls+'-'+title+'-o.png)'});
			$('p',this).not('.learn-more').css({color:'#fff',backgroundImage:'url(/images/v2/bucket-'+cls+'-'+title+'-pic-o.png)'});
		},
		function() {
			$(this).css({backgroundImage:'url(/images/v2/bucket_base.png)'});
			var cls = this.className;
			var title = $('h1',this).text();
			$('h1',this).css({backgroundImage:'url(/images/v2/bucket-'+cls+'-'+title+'.png)'});
			$('p',this).not('.learn-more').css({color:'#bbb',backgroundImage:'url(/images/v2/bucket-'+cls+'-'+title+'-pic.png)'});
		});
	
	$('#sesd-callout').hover(
		function() {
			$(this).attr('src','/images/v2/sesd-callout-o.png');
		},
		function() {
			$(this).attr('src','/images/v2/sesd-callout.png');
		});

	$('#head div.right').flash(
		{ src: '/video/spot01-outdoors.swf',
			width: 633,
			height: 436 },
		{ version: 8 }
	);
	
});