var initCatalogPeel;
if (jQuery) {
    initCatalogPeel = function ( sPeelImage, sPath, width, height ) {

	if (parseInt(width) < 1) { width = 185; }
	if (parseInt(height) < 1) { height = 225; }

	jQuery(document).ready(function () {

		var getPeelIndex = function ( oElement, sPrefix ) {
			if ( String(sPrefix) == '' ) {
				sPrefix = 'item';
			}
			var aBigOnes = ['A','B','C','D'];
			var aSmallOnes = [1,2,3,4,5,6,7,8,9];
			for (i=0; i < aBigOnes.length; i++) {
				var sClassName = sPrefix + aBigOnes[i];
				if ( jQuery(oElement).hasClass(sClassName)) {
					return (aBigOnes[i]);
				}
			}
			for (i=0; i < aSmallOnes.length; i++) {
				var sClassName = sPrefix + aSmallOnes[i];
				if ( jQuery(oElement).hasClass(sClassName)) {
					return (aSmallOnes[i]);
				}
			}
			return '';
		};
		
		jQuery(".catalog_peel_banner .pageflip").hover(
			function () { 
				var sPeelIndex = getPeelIndex( jQuery(this).closest('.peel'), 'banner' );
				jQuery(this).find("img , .msg_block").stop().animate(
					{ 
						width	:	'185px',
						height	:	'225px'
					}, 
					500,
					null,
					function () {
						if (this.tagName == "IMG") {
							jQuery(this).fadeOut(); // 'fast');
						}
						if (this.tagName == "SPAN") {
							jQuery(this).css("background-image", "url("+sPath+"/"+sPeelImage+")");
						}
					}
				);
			}, 
			function () {
				jQuery(this).find("img").attr("src", sPath+"/"+"Eselsohr-hd.png");
				jQuery(this).find("img").stop().animate(
					{
						width	:	'30px',
						height	:	'30px'
					}, 
					220
				);
				jQuery(this).find(".msg_block").css("background-image", "none");
				jQuery(this).find(".msg_block").stop().animate(
					{
						width	:	'30px',
						height	:	'30px'
					}, 
					200
				);
			}
		);		
	});
	
   };
}

