$(document).ready(function () {
	randomize_bg();
});

function randomize_bg() {
	/* eventually remove hte BG from the CSS so there's no flashing.
	image 1:
	about page, mailing list, support, sponsors, affiliates, contact and
	blog

	Image 2:
	videos, 2d_work, 3d_work, juried_videos

	Image 3:
	Venues, events, great river arts
	venues
	events
	great-river-arts
	*/
	swap_to_image = "1";
	if(
		location.href.indexOf('videos') > 0 ||
		location.href.indexOf('2d_work') > 0 ||
		location.href.indexOf('3d_work') > 0 ||
		location.href.indexOf('juried_videos') > 0 
	) {
		swap_to_image = "2";
	} else if (
		location.href.indexOf('venues') > 0 ||
		location.href.indexOf('events') > 0 ||
		location.href.indexOf('great-river-arts') > 0
	) {
		swap_to_image = "3";
	}
	
	// images = shuffle(['splash', 'drops','fling']);
	// swap_to_image = images.pop();
	//alert(location.href);
	$('#ft').css('background','transparent url(http://h2ofilmonwater.org/site/wp-content/themes/wpthemegen/images/bg_'+swap_to_image+'.jpg) no-repeat bottom left'); 
}

shuffle = function(o){ //v1.0
	for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
	return o;
};
