var Preloader = function(images, path){
	/* Preloading Class (requires jQuery for now) - built by Greg Coladarci, March 6, 2010*/
	/* Instantiate with array of images + optional path to images*/
	/* While using one array of images is probably smartest, you can call .load on your instance with another array to add those in later in code*/
	var _this = this;	
	if (typeof this.container == 'undefined'){
		this.container = $('<div id="imgPreloaderContainer"></div>').hide();
		$('body').append(this.container);
	}	
	if (typeof this.imgLocation == 'undefined'){
		this.imgLocation = path || '';
	}
	this.load = function(images){
		$.each(images, function(i,v){
				_this.container.append('<img src="'+_this.imgLocation+v+'" width="0" height="0" alt="pre" />');
		});
	}
	this.load(images);
}
function var_dump(input){
	var out = '';
	$.each(input, function(i,v){out += i+': '+v+"\n";});
	console.log(out);
}

function formatDate(input){
	var m_names = new Array("January", "February", "March", 
	"April", "May", "June", "July", "August", "September", 
	"October", "November", "December");

	var d = new Date(input);
	var curr_date = d.getDate();
	var sup = "";
	if (curr_date == 1 || curr_date == 21 || curr_date ==31)
	   {
	   sup = "st";
	   }
	else if (curr_date == 2 || curr_date == 22)
	   {
	   sup = "nd";
	   }
	else if (curr_date == 3 || curr_date == 23)
	   {
	   sup = "rd";
	   }
	else
	   {
	   sup = "th";
	   }

	var curr_month = d.getMonth();
	var curr_year = d.getFullYear();
	var hours = d.getHours()
	var minutes = d.getMinutes()
	if (minutes < 10){
	minutes = "0" + minutes
	}
	var amPM = hours > 11 ? 'PM': 'AM';
	if(hours > 11){ hours = hours - 11;}
	return(hours+':'+minutes+' '+amPM+' on '+m_names[curr_month]+' '+curr_date + "<sup>" + sup + "</sup>");	
}