/* init */

function initMain() {
	// header date
	$(".header .txtDateTime").html( getToday() );
	
	// col1 content margin
	if( $.trim( $(".main .col1 .content").html() ).length < 1 ) {
		$(".main .col1 .content").css("margin-bottom", "0" );
	}
	
	// colorbox modals
	// onClosed fires onOpen
	$(".colorbox").colorbox({
		iframe:true,
		opactiy:0.78,
		close:"CLOSE WINDOW",
		width:870,
		height:340 
	});
	$(".colorboxTall").colorbox({
		iframe:true,
		opactiy:0.78,
		close:"CLOSE WINDOW",
		width:870,
		height:405
	});
	$(".colorboxBio").colorbox({
		iframe:true,
		opactiy:0.78,
		close:"CLOSE WINDOW",
		width:870,
		height:430
	});
	$(".colorboxTallest").colorbox({
		iframe:true,
		opactiy:0.78,
		close:"CLOSE WINDOW",
		width:870,
		height:'90%'
	});
}


/* preloading */

function preloadImage( url, height, width )
{
	image = new Image( height, width ); 
	image.src = url;
}


/* date */

function getToday() {
	var now = new Date();
	var days = new Array( 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' );
	var months = new Array( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' );

	// Calculate the number of the current day in the week.
	var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

	// Join it all together
	today = days[now.getDay()] + ", " +
		months[now.getMonth()] + " " +
		date + ", " +
		( fourdigits( now.getYear() ) );

	return today;
}

function fourdigits( number ) {
	return (number < 1000) ? number + 1900 : number;
}

