$(document).ready(function() {
	
	/* Some math to set the horizontal stripes around the header */
	var totalWidth = $("#headline-container").width();
	var leftWidth = totalWidth - ($("#headline").width() + $("#right-stripe").width()) - 10;
	$("#left-stripe").width(leftWidth);
	//$("#intro-text").width($("#headline").width() + $("#right-stripe").width() - 20);
	
	/* Subpage stripes are reversed */
	var totalWidth2 = $("#headline-container").width();
	var leftWidth2 = totalWidth2 - ($("#headline").width() + $("#left-stripe-2").width()) - 10;
	$("#right-stripe-2").width(leftWidth2);
	//$("#intro-text-2").width($("#headline").width() + $("#left-stripe-2").width() - 20);
	
	/* Ticker fader */
	$('ul#tickitems').innerfade({
				speed: 'slow',
				timeout: 4000,
				type: 'sequence',
				containerheight: '1.5em'
			});
			
	/* Scrollbars */		
	$('div#news-scrollbox').jScrollPane({showArrows:true, horizontalGutter:10});
	$('div#resources-scrollbox').jScrollPane({showArrows:true, horizontalGutter:10});
		

	/* Columnizer */
	$('.ds').addClass("dontsplit"); /* the dontsplit param must come before the columnize gets called! */
	$('.de').addClass("dontend"); /* the dontsplit param must come before the columnize gets called! */	
	$('div#history').columnize({ columns:2, lastNeverTallest:1  });
	$('div#boardmems').columnize({ columns:3, lastNeverTallest:1  });
	$('div#staffmems').columnize({ columns:2, lastNeverTallest:1 });
	$('.columnize1').columnize({ columns:2, lastNeverTallest:1 });	
	$('.columnize2').columnize({ columns:2, lastNeverTallest:1 });	
	$('.columnize3').columnize({ columns:3, lastNeverTallest:1 });		
/*	$('div#staffwrap').columnize({ columns:5});*/

	$('div#boardmems .column:not(.first)').css('margin', '30px 0 0 20px');	
	$('div#staffmems .column:not(.first)').css('margin', '30px 0 0 20px');
	$('div#history .column:not(.first)').css('margin', '30px 0 0 20px');
	$('div.basic2 .column:not(.first)').css('margin', '0 0 0 20px');
	$('div.svccol .column:not(.first)').css('margin', '30px 0 0 15px');

	/* Google map links for Visit Us section */
	$('a.mapupppp').click(function() {
		$('iframe#googmap').attr("src",this.title);
	});

	$('a.mapup').click(function() {
                $('iframe#googmap').attr("src", this.title);
		$('a#googmaplink').attr("href", this.title.slice(0,-12));
		return FALSE;
	});

}); // close docready

