var galleryXXL=null;var galleryAdv=null;var setNavigationControls=true;$(document).ready(function(){if(IwAG.Image===undefined){IwAG.Image={};}var b=$(".galleriffic");var a=$(".thumbsXXL");Object.extend(IwAG.Image,{setExposeGallery:function(d){if(galleryAdv!=null){return;}setNavigationControls=d;var c=b.find(".thumbnail").height()*2;b.children("#thumbContainer").css({height:c+"px"}).children(".thumbs").css({position:"absolute"});galleryAdv=b.galleriffic({delay:300,numThumbs:16,preloadAhead:1,imageContainerSel:"#slideshow",controlsContainerSel:"#controls",captionContainerSel:"#caption",loadingContainerSel:"#loading",renderSSControls:false,renderNavControls:setNavigationControls,playLinkText:"Diashow starten",pauseLinkText:"Diashow stoppen",prevLinkText:"zur&uuml;ck",nextLinkText:"weiter",scaleUpImage:false,enableKeyboardNavigation:false,galleryImageWidthMax:400,galleryImageHeightMax:300,defaultTransitionDuration:500,onSlideChange:function(f,g){if(f!=g){try{SubmitTrackingCodeFromUpdatePanel();if(typeof IwAG.ivw!="undefined"&&typeof IwAG.ivw.Tracking!="undefined"){IwAG.ivw.Tracking.getInstance().Track();}}catch(h){}}},onTransitionIn:function(e,g,f){IwAG.Image.showGalleries();e.fadeTo(this.getDefaultTransitionDuration(f),1);},onComplete:function(){if(typeof this.currentImage.image=="undefined"||(!this.currentImage.image.complete&&!this.isInitCompleted)){galleryAdv.gotoIndex(0);}}});$(".thumb").click(function(){IwAG.Image.stopVideo(false);IwAG.Image.stopYTPlayer(true);});$(".videoLink").click(function(){if($(this).hasClass("icon_videoclipStart")){$(this).removeClass("icon_videoclipStart").addClass("icon_videoclipStop").html("Videoclip stoppen");if($("#gallery").is(":visible")){$("#video").show();IwAG.Image.hideGallery();}else{if($("#xxlGallery").is(":visible")){$("#xxlVideo").show();IwAG.Image.hideXxlGallery();}}IwAG.Image.stopYTPlayer(false);}else{$(this).removeClass("icon_videoclipStop").addClass("icon_videoclipStart").html("Videoclip starten");IwAG.Image.stopVideo(false);IwAG.Image.stopYTPlayer(true);}});$("#slideshow").click(function(){if(typeof(IwAG.Expose)!=="undefined"){IwAG.Expose.getInstance().BilderClick();}else{if(typeof(IwAG.Vacation)!=="undefined"){$("a#aPictures").trigger("click");}}galleryXXL.gotoIndex(galleryAdv.currentImage.index);});},setExposeGalleryXXL:function(){if(galleryXXL!=null){return;}a.children("#thumbContainer").removeClass("h_135");galleryXXL=a.galleriffic({delay:300,numThumbs:15,preloadAhead:1,imageContainerSel:"#xxlSlideshow",controlsContainerSel:"#xxlControls",captionContainerSel:"#xxlCaption",loadingContainerSel:"#xxlLoading",renderSSControls:false,renderNavControls:setNavigationControls,playLinkText:"Diashow starten",pauseLinkText:"Diashow stoppen",prevLinkText:"zur&uuml;ck",nextLinkText:"weiter",scaleUpImage:false,enableKeyboardNavigation:false,galleryImageWidthMax:690,galleryImageHeightMax:518,defaultTransitionDuration:500,onSlideChange:function(c,d){if(c!=d){try{SubmitTrackingCodeFromUpdatePanel();if(typeof IwAG.ivw!="undefined"&&typeof IwAG.ivw.Tracking!="undefined"){IwAG.ivw.Tracking.getInstance().Track();}}catch(f){}}},onTransitionIn:function(c,e,d){IwAG.Image.showGalleries();c.fadeTo(this.getDefaultTransitionDuration(d),1);}});},hideExposeGallery:function(){var c=new Image();c.src=String.Format("{0}App_Themes/MID_{1}/images/Immobilien/NoPicThumbnail_l.png",IWhost,mid);var d=$(".thumbnailContainer");if(d.length==0){$("span[id$=tabpnlBilder_tab]").hide();}else{$(".grid_image_big").append(c);}},setYouTube:function(c,d){$(".youtubeLink").click(function(k){var n=null;var f=null;var g=null;if($("[id$=pnlExpose]").is(":visible")){n=$("#ytPlayerContent");f=$("#captionYoutube");g="IwYtPlayer";IwAG.Image.hideGallery();$("#youtube").show();}else{if($("[id$=pnlBilder]").is(":visible")){n=$("#xxlYtPlayerContent");f=$("#xxlCaptionYoutube");g="xxlIwYtPlayer";IwAG.Image.hideXxlGallery();$("#xxlYoutube").show();}}if(n==null){return false;}IwAG.Image.stopVideo(false);var l=$(this).attr("href");var m=n.width();if(m===0){m=n.parent().width();}var i=Math.floor(m*3/4);f.empty().append($(this).attr("innerText")).show();var h={wmode:"opaque",allowScriptAccess:"always"};var j={id:g};swfobject.embedSWF(l,n.attr("id"),m,i,"8",null,null,h,j);return false;});},stopYTPlayer:function(d){var f=document.getElementById("IwYtPlayer");var c=document.getElementById("xxlIwYtPlayer");if(f){try{f.stopVideo();}catch(g){}}if(c){try{c.stopVideo();}catch(g){}}$("#youtube,#xxlYoutube,#captionYoutube,#xxlCaptionYoutube").hide();if(d){IwAG.Image.showGalleries();}},stopVideo:function(c){$(".videoLink").removeClass("icon_videoclipStop").addClass("icon_videoclipStart").html("Videoclip starten");$("#video,#xxlVideo").hide();if(c){IwAG.Image.showGalleries();}},showGalleries:function(){$("#slideshow,#xxlSlideshow,#controls,#xxlControls,.noPic").show();$("#caption,#xxlCaption").css("visibility","visible");},hideGallery:function(){$("#slideshow,#controls,.noPic").hide();$("#caption").css("visibility","hidden");},hideXxlGallery:function(){$("#xxlSlideshow,#xxlControls").hide();$("#xxlCaption").css("visibility","hidden");}});IwAG.Image.setYouTube();});
