//Used for setting headers for the top of the page.  If the arguments are provided, they're passed along, otherwise, they're picked at random
function header(left, center, right)
{
	this.BASE = 'http://www.indiana.edu/~iuccc/images/nav/';
	this.LEFT_FOLDER = 'left/';
	this.CENTER_FOLDER = 'center/';
	this.RIGHT_FOLDER = 'right/';
	this.leftImages = ['ban.3smile_web.jpg', 'ban.500ride_web.jpg', 'ban.50close_web.jpg', 'ban.abovetalk_web.jpg',
					   'ban.bonfire_web.jpg', 'ban.football_web.jpg', 'ban.jeffsing_web.jpg', 'ban.lifted_web.jpg',
					   'ban.ostrom_web.jpg', 'ban.picfun_web.jpg', 'ban.south_web.jpg', 'ban.staff_web.jpg', 'ban.vball_web.jpg'];
	this.centerImages = ['ban.500walk_web.jpg', 'ban.abovecards_web.jpg', 'ban.accordion_web.jpg', 'ban.bandpray_web.jpg', 
						 'ban.ccpray_web.jpg', 'ban.djjr_web.jpg', 'ban.mcamp_web.jpg', 'ban.pansong_web.jpg', 'ban.seniors_web.jpg',
						 'ban.snshake_web.jpg', 'ban.tgate_web.jpg', 'ban.woodlawn_web.jpg'];
	this.rightImages = ['ban.50smile_web.jpg', 'ban.50wide_web.jpg', 'ban.ccUK_web.jpg', 'ban.everything_web.jpg', 'ban.feet_web.jpg',
						'ban.haus_web.jpg', 'ban.hugs_web.jpg', 'ban.picnicgrp_web.jpg', 'ban.shadows_web.jpg'];
	this.selectRandom = selectRandom;
	
	this.setRight = setRight;
	this.setLeft = setLeft;
	this.setCenter = setCenter;
	this.setImage = setImage;
	
	this.left = left;
	this.center = center;
	this.right = right;
	
	if(this.left == null)
		this.left = this.selectRandom(this.leftImages);
	if(this.center == null)
		this.center = this.selectRandom(this.centerImages);
	if(this.right == null)
		this.right = this.selectRandom(this.rightImages);
		
	this.setLeft();
	this.setCenter();
	this.setRight();
}

//Returns a random element from the given array
function selectRandom(array)
{
	return array[Math.floor(Math.random() * array.length)];
}

//Sets the background image for the given div to the given image
function setImage(divName, backgroundImage)
{
	jQuery(divName).css('background-image', 'url(' + backgroundImage + ')');
}

//Sets the right image for the header
function setRight()
{
	this.setImage('#image-right', this.BASE + this.RIGHT_FOLDER + this.right);
}

//Sets the center image for the header
function setCenter()
{
	this.setImage('#image-center', this.BASE + this.CENTER_FOLDER + this.center);
}

//Sets the left image for the header
function setLeft()
{
	this.setImage('#image-left', this.BASE + this.LEFT_FOLDER + this.left);
}
