
if (typeof jQuery != 'undefined') {

	$(function(){
		
		$('a[rel="external"]').attr('target','_blank');
		
		$(".swap").hover(function(){
			this.src = this.src.replace("_off","_on");
		},function(){
			this.src = this.src.replace("_on","_off");
		});
		$(".product-blank").hover(function(){
		    //$(this).css({ 'background-image': $(this).css('background-image').replace('_off', '_on'), 'color': '#fff' });
		    $(this).css({ 'background-image': $(this).css('background-image').replace('_off', '_on') });
		},function(){
		    //$(this).css({ 'background-image' : $(this).css('background-image').replace('_on','_off'), 'color' : '#6D298B' });
		    $(this).css({ 'background-image': $(this).css('background-image').replace('_on', '_off') });
		});
		// Declare the array variable
		var imgSwap = [];
		// Select all images used in the image swap function - in our case class "img-swap"
		$(".swap").each(function(){
			// Loop through all images which are used in our image swap function
			// Get the file name of the active images to be loaded by replacing _off with _on
			imgUrl = this.src.replace("_off","_on");
			// Store the file name in our array
			imgSwap.push(imgUrl);
		});
		// Pass the array to our preload function
		$(imgSwap).preload();
		
	});
	
	$.fn.preload = function() {
		this.each(function(){
			$('<img/>')[0].src = this;
		});
	}

} 


