/*!
* Main.js - General Javascript included for all pages
* Requires: jQuery 1.5 or higher
*/

/*
* display_swap() does things
*/
function display_swap(group_class,target_class) {
	// Hide all group elements
	var group = $('.'+group_class);
	if (group.length == 0) if (window.console) console.log('FYI: display_swap - No elements found in group "'+group_class+'"');
	group.hide();	
	// Show target element
	var target = $('.'+group_class+'.'+target_class);
	if (target.length == 0) if (window.console) console.log('ERROR: display_swap - Target "'+target_class+'" not found in group "'+group_class+'"');
	target.show();
}

/*
* append_window_onload() - Allows you to chain window.onload event code by building on to the existing window.onload function 
* without overwriting it
*/
function append_window_onload(new_func) {
	if (typeof window.onload != 'function') {
		window.onload = new_func;
	} else {
		var current_func = window.onload;
		window.onload = function() {
			current_func();
			new_func();
		}
	}
}
