$(document).ready(function(){if($.browser.mozilla){$(".box-content-linklist li").textOverflow()}$("#horizontalnavigation .nav-ul-l1").superfish({delay:0,speed:"fast",autoArrows:false})});TTW.Form={clearFieldValue:function(a){$(a).val("")},isDefaultTextOrEmpty:function(c,a,d){var b=$(c).find("input[name="+a+"]").val();if((b==="")||(b===d)){return true}return false},validate:function(b){var a=$("form[name="+b.Name+"]");a.validate({errorElement:"em",rules:b.Rules,messages:b.Messages});return a.valid()}};TTW.Ajax={Options:{Cache:true},LOADING:"<div class='ajax-loading'><img src='../files/website/$file/ajax-loader.gif' width=32 height=32></div>",oSource:this,get:function(c,d,a,b){this.oSource.handleRequest=b;$("#"+a).html(this.LOADING);$.ajax({type:"GET",url:c,cache:TTW.Ajax.Options.Cache,timeout:60000,success:function(e){TTW.Ajax.oSource.handleRequest(a,e)},error:function(e,g,f){$("#"+a).html('<div class="ajax-error">'+ttw_labels.ajax.error+"</div>")}})},getHTML:function(a){var e=a.Url;var c=a.ID;var b=a.CallBackFunction;if(b===""){fCallBack=b}else{fCallBack=TTW.DOM.setContentByID}var d=a.Cache;if(d!==true){TTW.Ajax.Options.Cache=d}this.get(e,"html",c,fCallBack)}};TTW.DOM={setContentByID:function(a,b){if($("#"+a).length>0){$("#"+a).html(b)}},appendContentByID:function(a,b){if($("#"+a).length>0){$("#"+a).append(b)}}};TTW.Messagebox={show:function(b){var a=b.Text;$.colorbox.init();$.colorbox({html:"<div class='colorbox-text'>"+a+"</div>",opacity:0.7,innerWidth:300,initialWidth:300,innerHeight:100,initialHeight:100,close:""})}};TTW.Quicksearch={DefaultTextSearch:"Suche",validate:function(a){if(TTW.Form.isDefaultTextOrEmpty(a,"qs",this.DefaultTextSearch)){TTW.Messagebox.show({Text:"Bitte geben Sie einen Suchbegriff ein"});return false}return true},clearField:function(){$("#quicksearch_form input[name=qs]").val("")}};TTW.Print={openWindow:function(b){var a="resizable=yes, location=no, menubar=yes, toolbar=no, scrollbars=yes, status=no, dependent=yes, width=650,height=600";var c=window.open(b,"windowprint",a);
return false}};TTW.Login={DefaultTextUsername:"username",DefaultTextPassword:"password",validate:function(a){if(TTW.Form.isDefaultTextOrEmpty(a,"Username",this.DefaultTextUsername)){TTW.Messagebox.show({Text:TTW_Labels.box.login.errorusername});return false}else{if(TTW.Form.isDefaultTextOrEmpty(a,"Password",this.DefaultTextPassword)){TTW.Messagebox.show({Text:TTW_Labels.box.login.errorpassword});return false}}return true},logout:function(a){location.href=TTW.dbpath+"?logout&RedirectTo="+a}};TTW.Icons={setBookmark:function(){var a=window.location.href;if(document.all){window.external.addFavorite(a,$("title").html())}else{TTW.Messagebox.show({Text:TTW_Labels.icons.bookmark})}}};TTW.Teaser={CurrentNumber:1,MaximalNumber:1,Interval:null,IntervalSpeed:20000,setNavigation:function(){$(".teaser-nav-counter-current").html(this.CurrentNumber)},next:function(){if(this.CurrentNumber===this.MaximalNumber){this.CurrentNumber=0}this.CurrentNumber++;this.open();this.setNavigation();this.resetslide()},prev:function(){if(this.CurrentNumber===1){this.CurrentNumber=this.MaximalNumber+1}this.CurrentNumber--;this.open();this.setNavigation();this.resetslide()},open:function(){$(".teaser-container-inner").hide();$("#teaser"+this.CurrentNumber).show()},autoslide:function(){if(this.MaximalNumber>1){if(this.CurrentNumber<this.MaximalNumber){this.CurrentNumber++;this.open();this.setNavigation()}else{this.CurrentNumber=1;this.open();this.setNavigation()}}},resetslide:function(){if(this.Interval!=null){window.clearInterval(this.Interval);this.Interval=window.setInterval("TTW.Teaser.autoslide()",this.IntervalSpeed)}}};

