// Sitewide scripts using jquery
//place this at the bottom of other script includes to activate jquery plugins

$(document).ready(function(){ 
// Art and artist rotators
	$("#artist_rotate").innerfade({
		speed: 1000,
		timeout: 5000,
		type: "random",
		containerheight: '150px'
	});
	$("#art_rotate").innerfade({
		speed: 1000,
		timeout: 5000,
		containerheight: '700px'
	});
	$("#presenting").innerfade({
		speed: 1000,
		timeout: 5000,
		containerheight: '100px'
	});
	
//highlight navigation link of selected page
	var path = location.pathname.substring(1); //substring number is the number of characters to leave out from the beginning
	if (path) {
		$("#navigation a[href*=" + path + "]").each(function() {
			var src = $(this).children("img").attr("src");
			var new_src = src.replace(/\.(\w+(\?[^$]*)?)$/, '_over.$1');
			$(this).children("img").attr("src", new_src);
		});
	}

//create rollover images and prelode by passing "true"
	$('img.rollover').rollover(true);
	
//back in history button
	$('a.btn_back').click(function() {
		history.go(-1);
		return false;
	});
	
//Print Page
	$("a.btn_print").click(function() {
		javascript:print(document);
		return false;
	});

//Large Map window
	$("a.map_window").click(function() {
		window.open(this.href, 'Map', 'width=550,height=450,scrollbars=1,resizable=1,status=0,toolbar=0');
		return false;
	});
	
});