/**
 * @desc	Preload a list of images
 * @author	Sylvain Guillopé - Lixar Inc. I.T.
 * 
 * @access	public
 * @param	array		aImages		List of images to preload
 * @return	void 
 **/
$.preloadImages = function(aImages) {
	$.each(aImages, function() {
		$("<img />").attr("src", "../../images/nav/nav_" + this + "_on.gif");
	});
}


$(document).ready(function() {
	// Add the target="blank" attribute to external links
	// This is done as it's not validated by the strict XHTML doctype
	$("a.external, map area.external").each(function(e) {
		$(this).attr("target", "_blank");
	});
	
	// Add the hover event to menu links for image switching
	$("#menu a").each(function() {
		var sImageName = $(this).attr("rel");
		var $jImage = $(this).find("img");
		
		$(this).hover(
			function() {
				$jImage.attr("src", "../images/nav/nav_"+sImageName+"_on.gif");
			},
			function() {
				$jImage.attr("src", "../images/nav/nav_"+sImageName+".gif");
			}
		);
	});
});
