

//Function zum Vorladen

try {
	(function($) {
		var cache = [];
		// Arguments are image paths relative to the current page.
		$.preLoadImages = function() {
			var args_len = arguments.length;
			for (var i = args_len; i--;) {
				var cacheImage = document.createElement('img');
				cacheImage.src = arguments[i];
				cache.push(cacheImage);
			}
		}
	})(jQuery)
}
catch (e) {
	//Fehlerbehandlung
}

try {
	$(document).ready(function() {
		/*
		z.B.
		"image1.gif",
		"/path/to/image2.png"
		*/
		//Hier zwischen Bilder zum Vorladen einfuegen (nur Bilder, die nicht sofort sichtbar werden ohne Interaktion!)
		jQuery.preLoadImages(
	
		);
		$("img.hover").hover(
		function() {
			oldsrc = $(this).attr("src");
			oldwidth = $(this).attr("width");
			oldheight = $(this).attr("height");
			oldalt = $(this).attr("alt");
			oldtitle = $(this).attr("title");
			newsrc = oldsrc;
			newsrc = newsrc.replace(".jpg","-gr.jpg");
			newsrc = newsrc.replace(".png","-gr.png");
			newsrc = newsrc.replace(".gif","-gr.gif");
			newsrc = newsrc.replace("images/","images/vergroesserung/");
//			$("#re-bi-hover").html('<img src="' + newsrc + '">');
//			$("#re-bi-hover").fadeIn("slow");
			$(this).removeAttr('alt');
			$(this).removeAttr('title');
			$(this).removeAttr('width');
			$(this).removeAttr('height');
			$(this).css({'position' : 'absolute'});
			$(this).css({'z-index' : '100'});
			$(this).attr({'src' : newsrc});
		}
		,
		function() {
			$(this).css({'position' : ''});
			$(this).attr({'height' : oldheight});
			$(this).attr({'width' : oldwidth});
			$(this).attr({'alt' : oldalt});
			$(this).attr({'title' : oldtitle});
			$(this).attr({'src' : oldsrc});
			$(this).css({'z-index' : '0'});
			}
		);
	});
}
catch (e) {
	//Fehlerbehandlung
}


