/*

Copyright (c) Loyola University New Orleans

FILE DESCRIPTION:
Some jQuery stuff for progressive enhancement

LAST MODIFIED BY:
Niall Doherty on 20080818

NOTES:
1) 

*/

$(function() {
	
	// Show/hide the additional info on WebMail vs. SquirrelMail
	$(".target").hide().addClass("target-js").prev("p").append(' <a href="#" class="trigger">What\'s the difference?</a>')
	$(".trigger").click(function(){
		$(this).parent().next(".target").slideToggle();
		return false;
	});

	if (!location.hash) { // We only want to use autofocus if there's no hash in the URL (otherwise the anchor will be overruled by the focus)
		$("#wm-user").focus();
		// Overwrite the previous command if we have another input on the page with a class of autofocus.
		// We could possibly use this to speed up input after error feedback.
		$("input.autofocus").focus();
	};
	
});