$(document).ready(function(){$('#lefttab').live('click',function(){$("#cocoon2").addClass('hide');$("#cocoon3").addClass('hide');$("#cocoon1").removeClass('hide');$("#mr").attr('value','1');return false});$('#middletab').live('click',function(){$("#cocoon1").addClass('hide');$("#cocoon3").addClass('hide');$("#cocoon2").removeClass('hide');$("#mr").attr('value','1');return false});$('#righttab').live('click',function(){$("#cocoon1").addClass('hide');$("#cocoon2").addClass('hide');$("#cocoon3").removeClass('hide');$("#mr").attr('value','2');return false});function validation(){$("form").validate({errorElement:"span",errorPlacement:function(error,element){error.insertBefore(element.prev("br"))}})}function impressum(){if(slideshow){$("#image").removeClass('hide')}else{$("#image").addClass('hide')}if(topnav){$("#reiter").removeClass('hide')}else{$("#reiter").addClass('hide')}}function setNavigation(PageCall){$("#navigation a").removeClass('active');PageCall=PageCall.replace('.','\\.');$('a[href*='+PageCall+']').addClass('active')}$.address.init(function(event){$('a.ajax').address()}).change(function(event){var PageCall=$.address.value().substr(1);if(PageCall=='.html'){PageCall='index.html'}if($(location).attr("hash")){getContent(PageCall)}});function getContent(Page,DATA){$.ajax({type:"POST",url:domain+'index.php?nextpage='+Page,data:(DATA),dataType:"html",beforeSend:function(xhr){xhr.setRequestHeader("Ajax-Request","true");$("#contentleft").html('<div id="wait"><img src="'+domain+'img/wait.gif" /></div>')},success:function(response){setNavigation(Page);window.setTimeout(function(){$("#contentleft").replaceWith(response);impressum();validation()},800)}})}$('a.ajax').bind('click',function(){var PageCall=$(this).attr('id')||$(this).attr('rev');getContent(PageCall);return false});$("form").live("submit",function(event){var PageCall=$('#nextpage').attr('value');var DATA=$(this).serialize();getContent(PageCall,DATA);return false});$('#image').cycle({timeout:5000,speed:1500,random:true})});
