	jQuery.preloadImages = function()
	{
		for(var i = 0; i<arguments.length; i++)
		{
			jQuery("<img>").attr("src", arguments[i]);
		}
	}
	
	$(window).bind('load', function() {
		$('.rollover img').each(function(elm) { 
			$.preloadImages($(this).attr("src").replace(".jpg", "_on.jpg"));
		});
	});

	$(document).ready(function() {

	    $(".rollover").hover(
			function() {
			    if ($(this).attr("src").indexOf("_on") == -1) {
			        var newSrc = $(this).attr("src").replace(".jpg", "_on.jpg");
			        $(this).attr("src", newSrc);
			    }
			},
			function() {
			    if ($(this).attr("src").indexOf("_on") != -1) {
			        var oldSrc = $(this).attr("src").replace("_on.jpg", ".jpg");
			        $(this).attr("src", oldSrc);
			    }
			}
		);

	    // menu rollover
	    $(".menuItems p").mouseover(function() {
	        if (!($(this).find("a").hasClass("on"))) {
	            $(this).addClass("over");
	        }
	    }).mouseout(function() {
	        $(this).removeClass("over");
	    }).click(function() {			
	        $(".menuItems p").find("a.on").each(function() {
				var menuDiv = $(this).parents().get(2);
				if($(menuDiv).hasClass("internalMenu"))
				{
					$(this).removeClass("on");
				}
	        });
			var anchor = $(this).find("a");
	        anchor.addClass("on");
	        var link = anchor.attr("href");
	        if (link.indexOf("javascript") != -1) {
	            document.location.href = link;
	        }
	    });
	    $(".menuItems a.on").each(function() {
	        $(this).parent().find("span").addClass("on");
	    });



	});