Stoiber={init:function(){this.MainMenu.init();this.Slogan.init(!1);$("#slideshow").length&&this.Slideshow.init();$("#reel").length&&this.Reel.init();$("#cat_selector_box").length&&this.CatSelector.init()},Uniform:{init:function(){$("select, input, textarea").not(function(){return $(this).closest("#products-form").length||$(this).closest("#form-sidebar").length?!0:!1}).uniform({autoWidth:!1,useID:!1})}}};
Stoiber.Slideshow={ANIMATION_DELAY:5E3,ANIMATION_DURATION:500,slideInterval:void 0,currentSlide:1,images:$("<div>"),init:function(){Stoiber.Slideshow.shuffle();$(window).load(function(){$("#slideshow img").each(function(a){$(this).css({"z-index":$("#slideshow img").length-a,position:"absolute",right:0,top:0});a&&$(this).hide()});Stoiber.Slideshow.start()})},start:function(){this.slideInterval=setInterval(this.nextSlide,this.ANIMATION_DELAY)},stop:function(){return this.slideInterval?(clearInterval(this.slideInterval),
!0):!1},nextSlide:function(){$("#slideshow").find("img:visible").fadeOut(Stoiber.ShowCase.ANIMATION_DURATION);Stoiber.Slideshow.currentSlide==$("#slideshow img").length?Stoiber.Slideshow.currentSlide=1:Stoiber.Slideshow.currentSlide++;$("#slideshow").find("img:eq("+parseInt(Stoiber.Slideshow.currentSlide-1)+")").fadeIn(Stoiber.ShowCase.ANIMATION_DURATION)},shuffle:function(){$("#slideshow").children(":gt(0)").each(function(){Stoiber.Slideshow.images.append($(this).clone());$(this).replaceWith("<span></span>")});
do $("#slideshow span:first").replaceWith(this.images.children().eq(Math.floor(Math.random()*this.images.children().length)));while($("#slideshow span:first").length)}};
Stoiber.Slogan={ANIMATION_DELAY:5E3,ANIMATION_DURATION:500,slideInterval:void 0,init:function(a){$(window).load(function(){a?Stoiber.Slogan.slideInterval=setInterval(Stoiber.Slogan.toggle,Stoiber.Slogan.ANIMATION_DELAY):setTimeout(Stoiber.Slogan.toggle,Stoiber.Slogan.ANIMATION_DELAY)})},toggle:function(){$("#slogan img:eq(1)").is(":visible")?$("#slogan img:eq(1)").fadeOut(Stoiber.Slogan.ANIMATION_DURATION):$("#slogan img:eq(1)").fadeIn(Stoiber.Slogan.ANIMATION_DURATION)}};
Stoiber.MainMenu={init:function(){this.hideSubmenus();$("#main-menu .toggle").parent("a").bind("click",this.toggleSubmenu)},hideSubmenus:function(){$("#main-menu .submenu").not(function(){var a=!1;$(this).find("a").each(function(){if($(location)[0].pathname.split("/").pop()==$(this).attr("href"))return a=!0,!1});return a}).slideUp("fast")},toggleSubmenu:function(){var a;a=$(this).siblings("ul.submenu");$("#main-menu .submenu:visible").length&&$("#main-menu .submenu:visible").slideUp(function(){$(this).siblings("a").find("span.toggle").removeClass("subVisible")});
a.is(":hidden")&&a.slideDown(function(){a.siblings("a").find("span.toggle").addClass("subVisible")});return!1}};Stoiber.References={slideDuration:247,init:function(){$("#carousel").tinycarousel({duration:this.slideDuration})}};
Stoiber.ShowCase={currentColor:"",currentType:"stickerei",productName:"",viewerURL:"",colorBoxClasses:"ColorboxDamen,ColorboxHerren,ColorboxTuecher,ColorboxMuetzen,ColorboxSchals,ColorboxDecken".split(","),init:function(a){this.productName=a;this.currentColor=$("#models ."+this.currentType+" li:first-child").attr("class");this.viewerURL=$("#models .rotate").attr("href");$("#models .rotate").attr("href",this.viewerURL+"&color="+this.currentColor);$("#models .stickerei li, #models .druck li").not("#models .views li").hide().filter("#models ."+
this.currentColor).show();$.each(this.colorBoxClasses,function(a,c){$("#models a[class~="+c+"]").colorbox({current:"Bild {current} von {total}",previous:"Z\u00fcrick",next:"Weiter",close:"Schlie\u00dfen",rel:c,title:""})});$('#sideinfo input[name="type"]').bind("click",this.switchType);$("#sideinfo .druck, .highlights.druck").hide();$("#colors a").bind("click",this.changeColor);$("#models .video").colorbox({innerWidth:"860px",innerHeight:"515px",iframe:!0,title:"Stickerei Stoiber "+this.productName});
$("#models .rotate").colorbox({innerWidth:"952px",innerHeight:"532px",iframe:!0,title:"Stickerei Stoiber "+this.productName});$("#models .zoom").bind("click",this.zoomModel);$("#models .view0, #models .view1, #models .view2, #models .view3, #models .view4, #models .view5, #models .caps-zoom").each(function(){$(this).colorbox({innerWidth:"975px",innerHeight:"565px",iframe:!0,rel:"group-"+$(this).attr("class"),current:"Farbe {current} von {total}",previous:"Vorherige Farbe",next:"N\u00e4chste Farbe",
close:"Schlie\u00dfen",title:$(this).closest("li[class]").attr("title")})});$("#sideinfo .prices").colorbox({innerWidth:"764px",innerHeight:"542px",iframe:!0});$("#sideinfo .sizes").colorbox({innerWidth:"892px",innerHeight:"462px",iframe:!0});$("#reel").length&&$("#colors a").bind("click",Stoiber.Reel.changeReelColor)},switchType:function(){"stickerei"==$(this).val()?(Stoiber.ShowCase.currentType="stickerei",Stoiber.ShowCase.currentColor=$("#models .stickerei li:first-child").attr("class"),$("#sideinfo .druck, .highlights.druck, #models .stickerei, #models .druck").hide(),
$("#sideinfo .stickerei, .highlights.stickerei").fadeIn("fast"),$("#color-name").slideDown("fast"),$("#color-name").html($("#colors ."+Stoiber.ShowCase.currentColor).attr("title")),$(".zoom").show()):(Stoiber.ShowCase.currentType="druck",$("#sideinfo .stickerei, .highlights.stickerei, #models .stickerei, #models .druck").hide(),$("#sideinfo .druck, .highlights.druck").fadeIn("fast"),$("#color-name").slideUp("fast"),$(".zoom").hide());$("#models .stickerei li, #models .druck li").not("#models .views li").hide();
$("#models .stickerei li:first-child, #models .druck li:first-child").show();$("#models ."+Stoiber.ShowCase.currentType).fadeIn("fast")},changeColor:function(a){if("druck"==Stoiber.ShowCase.currentType)return a.preventDefault(),!1;$("#models .stickerei li, #models .druck li").not("#models .views li").hide();$("."+$(this).attr("class")).fadeIn("fast");$("#color-name").html($(this).attr("title"));Stoiber.ShowCase.currentColor=$(this).attr("class");$("#models .rotate").attr("href",Stoiber.ShowCase.viewerURL+
"&color="+Stoiber.ShowCase.currentColor)},zoomModel:function(){"leftControls"==$(this).closest("ul").attr("class")?$("#models li:visible a.left").colorbox({open:!0}):$("#models li:visible a.right").colorbox({open:!0})}};
Stoiber.PriceSwitcher={NETTO_SWITCHER_TEXT:'<span class="switchedTo">netto zzgl. MwSt.</span> / <a class="switch" title="Brutto Preise anzeigen">brutto incl. MwSt.</a>',BRUTTO_SWITCHER_TEXT:'<a class="switch" title="Netto Preise anzeigen">netto zzgl. MwSt.</a> / <span class="switchedTo">brutto incl. MwSt.</span>',DIMENSION_SWITCHER_WIDTH:120,init:function(){$(".brutto").hide();$(".price-switcher .switch").live("click",this.switchPrices);$(".logo20x20, .logo30x30").hide();$(".logo-switcher").bind("click",
this.switchLogoSize);$(".dimension_switcher").bind("change",this.switchDimensions);$(".dimension_switcher").length&&($(".dimension_switcher").closest(".selector").css("width",this.DIMENSION_SWITCHER_WIDTH+"px"),$(".dimension").not(".dimension.option_1").hide())},switchPrices:function(){$(".netto:visible").length?($(".netto").hide(),$(".brutto").fadeIn(),$(".price-switcher").html(Stoiber.PriceSwitcher.BRUTTO_SWITCHER_TEXT)):($(".brutto").hide(),$(".netto").fadeIn(),$(".price-switcher").html(Stoiber.PriceSwitcher.NETTO_SWITCHER_TEXT))},
switchLogoSize:function(){$(".logo-switcher").removeClass("switchedTo");$(this).addClass("switchedTo");$(".logo10x10, .logo20x20, .logo30x30").hide();$(this).hasClass("logoSwitch20x20")?$(".logo20x20").fadeIn("fast"):$(this).hasClass("logoSwitch30x30")?$(".logo30x30").fadeIn("fast"):$(".logo10x10").fadeIn("fast")},switchDimensions:function(){$(".dimension").hide();$(".dimension.option_"+$(this).val()).fadeIn("fast")}};
Stoiber.FAQ={init:function(){$(".faq p").each(function(){$(this).css("height",$(this).height()).hide()});$(".faq a").bind("click",this.toggle)},toggle:function(){var a=$(this),b=$(this).siblings("p");$(".faq p:visible").length&&$(".faq p:visible").slideUp(function(){$(this).siblings("a").find(".toggle").removeClass("openned")});b.is(":hidden")&&b.slideDown(function(){a.find(".toggle").addClass("openned")})}};
Stoiber.ContactSidebar={ANIMATION_DURATION:"fast",side:"",init:function(){this.side=$("#sidebar-contact").hasClass("right")?"right":"left";$("#sidebar-contact .switch").bind("click",this.toggle)},toggle:function(){params={};params[Stoiber.ContactSidebar.side]=0>parseInt($("#sidebar-contact").css(Stoiber.ContactSidebar.side))?0:-($(this).siblings("div.data").width()+1);$("#sidebar-contact").animate(params,this.ANIMATION_DURATION)}};
Stoiber.Reel={colors:[],name:"",initial:-1,path:"",imageHTML:"",init:function(){$("#colors a").each(function(){Stoiber.Reel.colors.push($(this).attr("class"))});this.initial=Math.floor(Math.random()*this.colors.length);this.path=$("#reel .images img").attr("src").replace($("#reel .images img").attr("class")+".jpg","");$("#reel .images").html('<img class="'+Stoiber.Reel.colors[Stoiber.Reel.initial]+'" src="'+Stoiber.Reel.path+Stoiber.Reel.colors[Stoiber.Reel.initial]+'.jpg" width="400" height="175" alt="" />');
$("#reel a").bind("click",this.changeReelColor);$(window).load(function(){Stoiber.Reel.postloadInit()});$("#showcase").length&&$("#reel .colors a").bind("click",Stoiber.ShowCase.changeColor)},postloadInit:function(){var a=1;$.each(Stoiber.Reel.colors,function(b){b!=Stoiber.Reel.initial&&$("<img>").load(function(){a++;Stoiber.Reel.imageHTML+='<img class="'+Stoiber.Reel.colors[b]+'" src="'+Stoiber.Reel.path+Stoiber.Reel.colors[b]+'.jpg" width="400" height="175" style="display: none;" alt="" />';a==
Stoiber.Reel.colors.length&&($("#reel .images").html($("#reel .images").html()+Stoiber.Reel.imageHTML),$("#reel .images img:first").reel({frames:75,speed:0.2,footage:5}))}).attr("src",Stoiber.Reel.path+Stoiber.Reel.colors[b]+".jpg")})},changeReelColor:function(){if(!$("#reel .images ."+$(this).attr("class")).length)return!1;$.reel.instances.length&&$($.reel.instances[0]).trigger("teardown");$("#reel .images img").hide();$("#reel .images ."+$(this).attr("class")).fadeIn("fast",function(){$("#reel .images img:visible").reel({frames:75,
speed:0.2,footage:5})});return!0}};Stoiber.Videos={init:function(){$(document).ready(function(){$("#videos a").colorbox({innerWidth:"860px",innerHeight:"515px",iframe:!0})})}};
Stoiber.Social={init:function(){$(".facebook").html('<fb:like send="false" layout="button_count" width="110" show_faces="false" font=""></fb:like>');$(".twitter").html('<a href="http://twitter.com/share" class="twitter-share-button" data-count="none" data-lang="de">Twittern</a>');FB.init({appId:"143126085766138",status:!0,cookie:!0,xfbml:!0})}};
Stoiber.CatSelector={CAT_URL_REDIRECT_BASE:"blog/",wl:"",init:function(){$("#cat_selector_box").bind("change",Stoiber.CatSelector.switchCategory);this.wl=-1!=(index=location.href.indexOf(Stoiber.CatSelector.CAT_URL_REDIRECT_BASE))?location.href.substr(0,index+Stoiber.CatSelector.CAT_URL_REDIRECT_BASE.length):location.protocol+"//"+location.hostname+(location.port?":"+location.port+"/":"/")+Stoiber.CatSelector.CAT_URL_REDIRECT_BASE},switchCategory:function(){window.location.href=0!=$(this).val()?Stoiber.CatSelector.wl+
$(this).val():Stoiber.CatSelector.wl}};
