// Modified so as not to interfere with currentPage.jq.js

jQuery(document).ready(function ($) {
	var navPath = '#nav>ul>li>ul>li'; // Do not include img tag. Path should go to element to be hovered.
	var overAppend = '-over';
	var ext = 'gif';

	$(navPath).hover(
		function () {
			// Over
			if (!$(this).find('a.current').length) {
				$(this).find('img').each( function () {
					this.src = this.src.replace(/\.gif$/i, overAppend+'.'+ext);
				});
			}
		},
		function () {
			// Out
			if (!$(this).find('a.current').length) {
				$(this).find('img').each( function () {
					this.src = this.src.replace(new RegExp(overAppend+'\\.gif$', 'i'), '.'+ext);
				});
			}
		}
	);

	$('body').append('<div id="overPreloader" style="position: absolute; left: -999em;"></div>');
	$(navPath+' img').each(function () {
		var newsrc = this.src.replace(/\.gif$/i, overAppend+'.'+ext);
		$('#overPreloader').append('<img alt="" src="'+newsrc+'" />');
	});

});
