$(document).ready(function(){

	 $.setHoverImgs("#nav img");

	 $.preloadImages("/images/links/contactushover.png", "/images/links/aboutushover.png", "/images/links/galleryhover.png", "/images/links/investmenthover.png", "/images/link/orderprintshover.png", "/images/links/photobloghover.png", "/images/links/testimonialshover.png");

						   });

	 

/*functions #nav img */

   	jQuery.setHoverImgs = function() {

	//image hover code. changes out image.png src to imagehover.jpg

	//on mouse over to all images within specified area (#navbar)

		for(var i=0; i<arguments.length; i++) {

			

			$(arguments[i])

	    		.mouseover(function(){

					var src = $(this).attr("src").match(/[^\.]+/) + "hover.png";

					$(this).attr("src", src);

				})

				.mouseout(function(){

					var src = $(this).attr("src").replace("hover", "");

					$(this).attr("src", src);

		   	    });

		}

	}

    //preload the hover images so the user does not have to wait

	jQuery.preloadImages = function() {

      for(var i = 0; i<arguments.length; i++) {

         jQuery("<img>").attr("src", arguments[i]);

       }

    }