/*
	Template: $RCSfile: jquery.functions.livepreview.min.js,v $
	$Author: shollstein $
	$Revision: 1.46 $ - $Date: 2011/06/17 08:21:40 $
	minified version created with : http://compressorrater.thruhere.net/ Compressor: YUI Compressor, Options: preserveAllSemi, disableOpt
*/
var livePreviewForProductList={defaults:{currentProductList:"#productlistLivePreview",putHoverIntoFollowingCell:".productlistImage",usejqueryuidragable:false,setTypeOfFadingLayerInModalLayer:"disable",setWidthOfModalLayer:670,customClassNameForModalbox:null,sIFRheadlines:"#detailviewPreview .sifrHeadline22"},initializeLivePreview:function(f){var f=jQuery.extend({loadContentAs:"ajax",loadContentAs_heightOfIframe:500,flagSpacer:40,currentProductListRow:" .livePreview",isTable:false,initBefore:function(){return true;},initBeforeInterval:1000,initBeforeIntervalMaxCount:5,initSuccess:function(){},furtherResizeContainer:null,disableHover:false},f||{});f=jQuery.extend({},livePreviewForProductList.defaults,f);function d(){jQuery(f.currentProductList+f.currentProductListRow).each(function(h){var l=jQuery(this);if(!l.hasClass("livePreviewPrepareRowSuccessfully")){l.addClass("livePreviewPrepareRowSuccessfully");var g=0;var m=200;var j=0;var k=0;jQuery(f.putHoverIntoFollowingCell,l).each(function(q){var u=jQuery(this);var p=jQuery("a.livePreview img",u).eq(0);var r=p.attr("height");if(r!=""){var t=r;}else{var t=p.height();}if(f.isTable){var o=u.parent(f.currentProductList+f.currentProductListRow).find(f.putHoverIntoFollowingCell);}else{var o=u.parents(f.currentProductListRow).find(f.putHoverIntoFollowingCell);}if(jQuery(".flags",o).length!=0){if(t<=m){o.addClass("rowHasSmallImagesAndFlags");t=t+f.flagSpacer;}else{o.addClass("rowHasBigImagesAndFlags");}}if(t>g){g=t;}if(!f.isTable){var n=u.next(".productlistInfo").height();if(n>j){j=n;}if(f.furtherResizeContainer){if(f.furtherResizeContainer.indexOf(".productlistInfo")!=-1){var s=j;}else{var s=u.next(".productlistInfo").next(f.furtherResizeContainer).height();}if(s>k){k=s;}}}}).attr({"maxHeightImageContainer":g,"maxHeightInfoContainer":j,"maxHeightFurtherResizeContainer":k});}});jQuery(f.currentProductList+f.currentProductListRow+" "+f.putHoverIntoFollowingCell).each(function(){var j=jQuery(this);var h=jQuery("a.livePreview img",j);var g=parseInt(j.attr("maxHeightImageContainer"));var i=h.height();if(!j.hasClass("livePreviewContainerAdded")){if(!f.isTable){jQuery("a.livePreview",j).height(g);j.next(".productlistInfo").height(parseInt(j.attr("maxHeightInfoContainer")));j.next(".productlistInfo").next(f.furtherResizeContainer).height(parseInt(j.attr("maxHeightFurtherResizeContainer")));}j.addClass("livePreviewContainerAdded");jQuery("a.livePreview",j).wrap('<div class="livePreviewHoverContainer clearfix"></div>');if((!j.hasClass("rowHasSmallImagesAndFlags")||j.hasClass("rowHasBigImagesAndFlags"))&&g>i){h.css({marginTop:Math.abs((g-i)/2)});}jQuery(".livePreviewHoverContainer",j).append('<div class="livePreviewClickContainer ie6pngfix"></div>').width(parseInt(j.outerWidth(true))).height(g);jQuery("a.livePreview .flags",j).show();}}).hover(function(){if(!f.disableHover){jQuery(".livePreviewHoverContainer",this).addClass("hoverStatus");}},function(){if(!f.disableHover){jQuery(".livePreviewHoverContainer",this).removeClass("hoverStatus");}});jQuery(".livePreviewClickContainer",f.currentProductList+f.currentProductListRow+" "+f.putHoverIntoFollowingCell).die("click").live("click",function(g){var i=jQuery("input[name='ajaxhref']",jQuery(this).prev("a.livePreview")).val();if(i!=""){g.preventDefault();if(f.loadContentAs=="preload"){jQuery(this).addClass("preloader");jQuery("#iframecontenttempcontainer").remove();jQuery("body").append('<div id="iframecontenttempcontainer" class="skipElement"></div>');jQuery("#iframecontenttempcontainer").load(i,function(k,j,l){if(j!="error"){b({directCall:{element:"#iframecontenttempcontainer"}});}jQuery(".livePreviewClickContainer").removeClass("preloader");});}else{if(f.loadContentAs=="iframe"){if(i.indexOf("?")!=-1){var h="&";}else{var h="?";}i=i+h+"isiframe=true";b({directCall:{data:'<iframe id="livePreviewIframe" name="livePreviewIframe" src="'+i+'" width="100%" height="'+f.loadContentAs_heightOfIframe+'" frameborder="0" scrolling="auto">'}});}else{b({directCall:{source:i}});}}}});f.initSuccess();}function b(g){g=jQuery.extend({directCall:null},g||{});if(g.directCall){jQuery.fn.modalBox({directCall:g.directCall,setTypeOfFadingLayer:f.setTypeOfFadingLayerInModalLayer,usejqueryuidragable:f.usejqueryuidragable,setWidthOfModalLayer:f.setWidthOfModalLayer,customClassName:f.customClassNameForModalbox,callFunctionAfterShow:function(){try{jQuery(".formDesigner").formDesigner();}catch(h){}}});}}if(f.currentProductList&&f.putHoverIntoFollowingCell){if(!f.initBefore()){var c=0;var a=window.setInterval(function(){c++;e(c);},f.initBeforeInterval);function e(g){if(f.initBefore()||g>f.initBeforeIntervalMaxCount){window.clearInterval(a);d();}}}else{d();}}},initEndlessScrollProductList:function(c){var a=jQuery(document).height()-jQuery(window).height();var c=jQuery.extend({isTable:false,bottomPixels:((a>450)?a:450),fireDelay:10,productlistCounter:1,url:null,enableScrollAction:true,bundlesPageablePageCount:null,preloadContainer:'<div class="productlistLivePreviewLoaderShowMore globalAjaxLoader"><div class="globalAjaxLoaderBody clearfix">Produktliste wird nachgeladen</div></div>',furtherResizeContainer:null,disableHover:null},c||{});c=jQuery.extend({},livePreviewForProductList.defaults,c);if(c.url&&c.bundlesPageablePageCount){function b(){if((c.productlistCounter<c.bundlesPageablePageCount)&&c.enableScrollAction){c.enableScrollAction=false;jQuery("div#productlistLivePreview .livePreview:last-child").after(c.preloadContainer);jQuery.ajax({type:"GET",url:c.url.replace("ProductPage=0","ProductPage="+c.productlistCounter),dataType:"html",success:function(e,f,d){jQuery("div#productlistLivePreview").append(e);livePreviewForProductList.init({isTable:c.isTable,preloadImages:true,furtherResizeContainer:c.furtherResizeContainer,disableHover:c.disableHover});c.productlistCounter++;c.enableScrollAction=true;}});}}jQuery(document).endlessScroll({bottomPixels:c.bottomPixels,fireDelay:c.fireDelay,callback:function(d){b();},ceaseFire:function(){return(c.productlistCounter>=c.bundlesPageablePageCount);}});}},init:function(a){var a=jQuery.extend({loadContentAs:"ajax",customClassNameForModalbox:"livepreview",initBeforeText:(typeof(localizedStringsForJavaScript.common_loading_productlist)!=undefined?localizedStringsForJavaScript.common_loading_productlist:"Produktliste wird geladen"),endlessScrollUrl:null,endlessScrollBundlesPageablePageCount:null,preloadImages:false,furtherResizeContainer:null,callFunctionAfterShow:function(){},disableHover:null},a||{});a=jQuery.extend({},livePreviewForProductList.defaults,a);var b=false;if(jQuery(a.currentProductList).is("table")){b=true;}if(b){livePreviewForProductList.initializeLivePreview({isTable:b,loadContentAs:a.loadContentAs,loadContentAs_heightOfIframe:a.loadContentAs_heightOfIframe,flagSpacer:a.flagSpacer,currentProductListRow:a.currentProductListRow,usejqueryuidragable:a.usejqueryuidragable,setWidthOfModalLayer:a.setWidthOfModalLayer,sIFRheadlines:a.sIFRheadlines,customClassNameForModalbox:a.customClassNameForModalbox,currentProductList:a.currentProductList,putHoverIntoFollowingCell:a.putHoverIntoFollowingCell,furtherResizeContainer:a.furtherResizeContainer,disableHover:a.disableHover});}else{livePreviewForProductList.initializeLivePreview({isTable:b,loadContentAs:a.loadContentAs,loadContentAs_heightOfIframe:a.loadContentAs_heightOfIframe,flagSpacer:a.flagSpacer,currentProductListRow:a.currentProductListRow,usejqueryuidragable:a.usejqueryuidragable,setWidthOfModalLayer:a.setWidthOfModalLayer,sIFRheadlines:a.sIFRheadlines,customClassNameForModalbox:a.customClassNameForModalbox,currentProductList:a.currentProductList,putHoverIntoFollowingCell:a.putHoverIntoFollowingCell,initBefore:function(){if((a.endlessScrollUrl&&a.endlessScrollBundlesPageablePageCount)||a.preloadImages){var f=jQuery(".productlistLivePreviewLoaderShowMore");if(!f.hasClass("isAnimated")){f.fadeOut("fast",function(){jQuery(".globalAjaxLoaderBody",this).text(a.initBeforeText);jQuery(this).addClass("isAnimated").fadeIn("fast");});}var e=jQuery(a.currentProductList+" div.livePreview:not('.livePreviewPrepareRowSuccessfully') a.productlistimageLink img");var c=e.length;var d=0;e.load(function(){d++;if(d==c){return true;}});}else{return true;}},initSuccess:function(){var c=jQuery("#productlistLivePreviewLoader");if(c.length!=0){c.fadeOut("fast",function(){jQuery("#productlistLivePreview").removeClass("visibleNo");if(typeof(initSimilarArticles)=="function"){initSimilarArticles();}}).remove();}else{jQuery("#productlistLivePreview").removeClass("visibleNo");if(typeof(initSimilarArticles)=="function"){initSimilarArticles();}}jQuery(".productlistLivePreviewLoaderShowMore").animate({opacity:0,height:1+"px"},600,function(){jQuery(this).remove();});jQuery("div#productListCount").text(0);a.callFunctionAfterShow();},furtherResizeContainer:a.furtherResizeContainer,disableHover:a.disableHover});if(a.endlessScrollUrl&&a.endlessScrollBundlesPageablePageCount){livePreviewForProductList.initEndlessScrollProductList({isTable:b,url:a.endlessScrollUrl,bundlesPageablePageCount:a.endlessScrollBundlesPageablePageCount,furtherResizeContainer:a.furtherResizeContainer,disableHover:a.disableHover});}}}};
