(function($){$.bannerslider=function(el,options){var base=this;$('.tx-rgtabs-pi1').ready(function(){$('.tx-rgtabs-pi1').hide()});base.$el=$(el).addClass('anythingBase').wrap('<div class="bannerslider"><div class="anythingWindow" /></div>');base.$el.data("bannerslider",base);base.init=function(){base.options=$.extend({},$.bannerslider.defaults,options);base.$wrapper=base.$el.parent().closest('div.bannerslider').addClass('bannerslider-'+base.options.theme);base.$window=base.$el.closest('div.anythingWindow');base.$controls=$('#BannerNavbar');base.$items=base.$el.find('> li').addClass('panel');base.pages=base.$items.length;base.timer=null;base.flag=false;base.playing=false;base.hovered=false;base.pageCounter=0;base.panelSize=[];base.currentPage=base.options.startPanel;base.selectedNaveIcon=0;base.isIconSelected=false;base.NavIconsSel=[];base.NavIcons=[];base.setPanelLinks();try{$('#StartseitenBannerNoScript').hide();$('#StartseitenBanner').show()}catch(err){}base.runTimes=$('div.bannerslider').index(base.$wrapper)+1;if(!$.isFunction($.easing[base.options.easing])){base.options.easing="swing"}if(base.pages===1){base.options.autoPlay=false}if(base.options.autoPlay){base.playing=!base.options.startStopped;base.buildAutoPlay()}base.buildNavigation();base.$el.prepend(base.$items.filter(':last').clone().addClass('cloned').removeAttr('id'));base.$el.append(base.$items.filter(':first').clone().addClass('cloned').removeAttr('id'));base.$items=base.$el.find('> li');base.setDimensions();if((base.options.hashTags===true&&!base.gotoHash())||base.options.hashTags===false){base.setCurrentPage(base.options.startPanel,false)}try{$(".bannercontent").each(function(index){var parent=$(this).parents("div");if(!parent.parents("li").hasClass("cloned")){var parentposition=parent.position().left;var left=$(this).position().left;$(this).css("left",parentposition+left)}});$(".contentLink").each(function(index){var position=$(this).position();if(position!=null){var y=position.top;if($.browser.msie&&jQuery.browser.version<8){y=y-9}else{y=y-4}$(this).css('top',y)}var ref=$(this).children("a:first").attr("href");var url=ref.replace(/^\s+|\s+$/g,"");var target='';var pos=url.indexOf(' ');if(pos>=1){url=ref.substr(0,pos);target=ref.substr(pos+1).replace(/^\s+|\s+$/g,"");var pos2=ref.substr(pos+1).indexOf(' ');if(pos2>0){target=ref.substr(pos,pos2-pos)}}var awrap='<a href="'+url+'" />';if(target.length>0){awrap='<a href="'+url+'" target="'+target+'" />'}$(this).parent().wrap(awrap)});$(".contentLink").click(function(){var ref=$(this).children("a").attr("href");var url=ref.replace(/^\s+|\s+$/g,"");var target='';var pos=url.indexOf(' ');if(pos>=1){url=ref.substr(0,pos);target=ref.substr(pos+1).replace(/^\s+|\s+$/g,"");var pos2=ref.substr(pos+1).indexOf(' ');if(pos2>0){target=ref.substr(pos,pos2-pos)}}if(target.length<=0){target='_self'}if(url.length>0){window.open(url,target);return false}return true});$(".navicontxt").mouseenter(function(){if(!$(this).hasClass('navicontxtcurrent')){$(this).addClass('navicontxtblack')}}).mouseleave(function(){$(this).removeClass('navicontxtblack')});$(".bannercontent").hover(function(){var img=$(this).children(".contentLink").children("a").children("img:first").attr("src");var img2=$(this).children(".contentLink").children(".linkover").attr("src");$(this).children(".contentLink").children("a").children("img:first").attr("src",img2);$(this).children(".contentLink").children(".linkover").attr("src",img)});$(".bannercontent").mouseenter(function(){$(this).children("H1").css("color","#821413");$(this).children("H2").css("color","#821413");$(this).children("H3").css("color","#821413");$(this).children("H4").css("color","#821413")}).mouseleave(function(){$(this).children("H1").css("color","Black");$(this).children("H2").css("color","Black");$(this).children("H3").css("color","Black");$(this).children("H4").css("color","Black")})}catch(err){}};base.buildNavigation=function(){base.$nav=$('<ul class="thumbNav" />').appendTo(base.$controls);base.$items.each(function(i,el){var index=i+1,$a=$("#panel"+index);$a.bind(base.options.clickControls,function(e){if(!base.flag){base.flag=true;setTimeout(function(){base.flag=false},base.options.animationTime);base.slideOnce=false;base.gotoPage(index)}e.preventDefault()});$b=$("#nav"+index);$b.bind(base.options.clickControls,function(e){if(!base.flag){base.flag=true;setTimeout(function(){base.flag=false},base.options.animationTime);base.slideOnce=false;base.gotoPage(index);base.startStop(false)}e.preventDefault()})});var bgimg=$("#pgbimg").attr("src");$("#BannerNavbar").css("background-image","url("+bgimg+")");base.getNavIcons();base.changeNavIcon("set")};base.buildAutoPlay=function(){base.startStop(base.playing)};base.setDimensions=function(){var w,h,c,cw,dw,leftEdge=0,bww=base.$window.width(),winw=$(window).width();base.$items.each(function(i){c=$(this).children('*');w=$(this).width();dw=(w>=winw)?true:false;if(c.length==1&&dw){cw=(c.width()>=winw)?bww:c.width();$(this).css('width',cw);c.css('max-width',cw);w=cw}w=(dw)?base.options.width||bww:w;w=w-5;$(this).css('width',w);h=$(this).outerHeight();base.panelSize[i]=[w,h,leftEdge];leftEdge+=w});base.$el.css('width',(leftEdge<base.options.maxOverallWidth)?leftEdge:base.options.maxOverallWidth)};base.gotoPage=function(page,autoplay){if(typeof(page)==="undefined"||page===null){page=base.options.startPage;base.setCurrentPage(base.options.startPage)}base.$el.trigger('slide_init',base);if($.isFunction(base.options.onSlideInit)){base.options.onSlideInit(base)}base.changeNavIcon("remove");if(page>base.pages+1){page=base.pages}if(page<0){page=1}if(autoplay&&base.options.stopAtEnd){base.pageCounter=base.pageCounter+1}base.$el.trigger('slide_begin',base);if($.isFunction(base.options.onSlideBegin)){base.options.onSlideBegin(base)}base.$window.filter(':not(:animated)').animate({scrollLeft:base.panelSize[page][2]},{queue:false,duration:base.options.animationTime,easing:base.options.easing,complete:function(){base.endAnimation(page)}});if(base.options.stopAtEnd&&(base.pageCounter>=base.pages)){base.startStop(false);base.pageCounter=0}};base.endAnimation=function(page){if(page===0){base.$window.scrollLeft(base.panelSize[base.pages][2]);page=base.pages}else if(page>base.pages){base.$window.scrollLeft(base.panelSize[1][2]);page=1}base.setCurrentPage(page,false);base.$el.trigger('slide_complete',base);if($.isFunction(base.options.onSlideComplete)){setTimeout(function(){base.options.onSlideComplete(base)},0)}base.changeNavIcon("set")};base.setPanelLinks=function(){base.$items.each(function(i){var idx=i+1;if($(this).attr('title')!=undefined&&$(this).attr('title')!=""){var title=$(this).attr('title').replace(/^\s+|\s+$/g,"");var url=title;var target='_self';pos=title.indexOf(' ');if(pos>=1){url=title.substr(0,pos);if(pos+1>title.length){target=title.substr(pos+1);var pos2=title.substr(pos).indexOf(' ');if(pos2>0){target=title.substr(pos,pos2-pos)}}}if(url.length>0){$("#BaImg"+idx).attr("onClick","window.open('"+url+"','"+target+"')");$("#BaImg"+idx).css("cursor","pointer");if($.browser.msie&&jQuery.browser.version<8){$("#BaImg"+idx).click(function(){eval($(this).attr("onClick"))})}}}$(this).removeAttr("title")})};base.getNavIcons=function(){base.$items.each(function(i){var idx=i+1;var pimgSelname="#pimg"+idx;base.NavIconsSel[idx]=$(pimgSelname).attr('src');var pimgUnselected=$("#panel"+idx).children().first().attr('src');base.NavIcons[idx]=pimgUnselected;$("#nav"+idx).children("div").first().css("cursor","pointer");$("#nav"+idx).children("div").first().attr("onClick","location.href='"+$('#panel'+idx).attr('href')+"'")})};base.changeNavIcon=function(action){if(action=="set"){$("#panel"+base.currentPage).children("img").first().attr('src',base.NavIconsSel[base.currentPage]);if(base.selectedNaveIcon!=0){$("#panel"+base.selectedNaveIcon).children("img").first().attr('src',base.NavIcons[base.selectedNaveIcon]);$("#nav"+base.selectedNaveIcon).children("div").first().removeClass("navicontxtcurrent")}base.selectedNaveIcon=base.currentPage}else{$("#panel"+base.currentPage).children("img").first().attr('src',base.NavIcons[base.currentPage]);base.selectedNaveIcon=0}$("#nav"+base.currentPage).children("div").first().toggleClass("navicontxtcurrent")};base.setCurrentPage=function(page,move){if(!move){base.$wrapper.css({width:base.panelSize[page][0]});base.$wrapper.scrollLeft(0);base.$window.scrollLeft(base.panelSize[page][2])}base.currentPage=page;if(!base.$wrapper.is('.activeSlider')){$('.activeSlider').removeClass('activeSlider');base.$wrapper.addClass('activeSlider')}};base.goForward=function(autoplay){if(autoplay!==true){autoplay=false;base.startStop(false)}base.gotoPage(base.currentPage+1,autoplay)};base.goBack=function(autoplay){if(autoplay!==true){autoplay=false;base.startStop(false)}base.gotoPage(base.currentPage-1,autoplay)};base.gotoHash=function(){var hash=window.location.hash.match(/^#?panel(\d+)-(\d+)$/);if(hash){var panel=parseInt(hash[1],10);if(panel==base.runTimes){var slide=parseInt(hash[2],10),$item=base.$items.filter(':eq('+slide+')');if($item.length!==0){base.setCurrentPage(slide,false);return true}}}return false};base.setHash=function(hash){if(typeof window.location.hash!=='undefined'){if(window.location.hash!==hash){window.location.hash=hash}}else if(location.hash!==hash){location.hash=hash}return hash};base.clearTimer=function(paused){if(base.timer){window.clearInterval(base.timer);if(!paused){base.$el.trigger('slideshow_stop',base);if($.isFunction(base.options.onShowStop)){base.options.onShowStop(base)}}}};base.startStop=function(playing,paused){if(playing!==true){playing=false}if(playing&&!paused){base.$el.trigger('slideshow_start',base);if($.isFunction(base.options.onShowStart)){base.options.onShowStart(base)}}base.playing=playing;if(playing){base.clearTimer(true);base.timer=window.setInterval(function(){base.goForward(true)},base.options.delay)}else{base.clearTimer()}};base.init()};$.bannerslider.defaults={startPanel:1,hashTags:true,toggleControls:false,navigationFormatter:null,autoPlay:true,startStopped:false,resumeOnVideoEnd:true,stopAtEnd:true,delay:6000,animationTime:700,easing:"swing",onShowStart:null,onShowStop:null,onShowPause:null,onShowUnpause:null,onSlideInit:null,onSlideBegin:null,onSlideComplete:null,clickControls:"click focusin",addWmodeToObject:"opaque",maxOverallWidth:32766};$.fn.bannerslider=function(options){if((typeof(options)).match('object|undefined')){return this.each(function(i){if($(this).is('.anythingBase')){return}(new $.bannerslider(this,options))})}else if(/\d/.test(options)&&!isNaN(options)){return this.each(function(i){var anySlide=$(this).data('bannerslider');if(anySlide){var page=(typeof(options)=="number")?options:parseInt($.trim(options),10);if(page<1||page>anySlide.pages){return}anySlide.gotoPage(page)}})}}})(jQuery);
