
(function(){var special=jQuery.event.special,uid1='D'+(+new Date()),uid2='D'+(+new Date()+1);jQuery.event.special.focus={setup:function(){var _self=this,handler=function(e){e=jQuery.event.fix(e);e.type='focus';if(_self===document){jQuery.event.handle.call(_self,e);}};jQuery(this).data(uid1,handler);if(_self===document){if(_self.addEventListener){_self.addEventListener('focus',handler,true);}else{_self.attachEvent('onfocusin',handler);}}else{return false;}},teardown:function(){var handler=jQuery(this).data(uid1);if(this===document){if(this.removeEventListener){this.removeEventListener('focus',handler,true);}else{this.detachEvent('onfocusin',handler);}}}};jQuery.event.special.blur={setup:function(){var _self=this,handler=function(e){e=jQuery.event.fix(e);e.type='blur';if(_self===document){jQuery.event.handle.call(_self,e);}};jQuery(this).data(uid2,handler);if(_self===document){if(_self.addEventListener){_self.addEventListener('blur',handler,true);}else{_self.attachEvent('onfocusout',handler);}}else{return false;}},teardown:function(){var handler=jQuery(this).data(uid2);if(this===document){if(this.removeEventListener){this.removeEventListener('blur',handler,true);}else{this.detachEvent('onfocusout',handler);}}}};})();var dContent=$('#maincol');var dSlide=$('#leftcol');var dSCont=$('#slideshow');var dSCaption=$('#caption');var dSLoading=$('#loading');var dSCapWrap=$('#capwrapper');var dSControls=$('.controls');var dTitle=$('title');var slideshow=new Array();var slideID;var cI=0;var preventSlide=0;var isLoading=0;var form=$("#customForm");var name1=$("#name1");var nameInfo=$("#nameInfo");var email=$("#email");var emailInfo=$("#emailInfo");var message=$("#message");var error=$("#error");var telefon=$('#telefon');var telefonInfo=$('#telefonInfo');var ENTITIES={34:"quot",60:"lt",62:"gt",38:"amp",160:"nbsp",161:"iexcl",162:"cent",163:"pound",164:"curren",165:"yen",166:"brvbar",167:"sect",168:"uml",169:"copy",170:"ordf",171:"laquo",172:"not",173:"shy",174:"reg",175:"macr",176:"deg",177:"plusmn",178:"sup2",179:"sup3",180:"acute",181:"micro",182:"para",183:"middot",184:"cedil",185:"sup1",186:"ordm",187:"raquo",188:"frac14",189:"frac12",190:"frac34",191:"iquest",192:"Agrave",193:"Aacute",194:"Acirc",195:"Atilde",196:"Auml",197:"Aring",198:"AElig",199:"Ccedil",200:"Egrave",201:"Eacute",202:"Ecirc",203:"Euml",204:"Igrave",205:"Iacute",206:"Icirc",207:"Iuml",208:"ETH",209:"Ntilde",210:"Ograve",211:"Oacute",212:"Ocirc",213:"Otilde",214:"Ouml",215:"times",216:"Oslash",217:"Ugrave",218:"Uacute",219:"Ucirc",220:"Uuml",221:"Yacute",222:"THORN",223:"szlig",224:"agrave",225:"aacute",226:"acirc",227:"atilde",228:"auml",229:"aring",230:"aelig",231:"ccedil",232:"egrave",233:"eacute",234:"ecirc",235:"euml",236:"igrave",237:"iacute",238:"icirc",239:"iuml",240:"eth",241:"ntilde",242:"ograve",243:"oacute",244:"ocirc",245:"otilde",246:"ouml",247:"divide",248:"oslash",249:"ugrave",250:"uacute",251:"ucirc",252:"uuml",253:"yacute",254:"thorn",255:"yuml",34:"quot",60:"lt",62:"gt",38:"amp"};function setForm(){form=$("#customForm");name1=$("#name1");nameInfo=$("#nameInfo");email=$("#email");emailInfo=$("#emailInfo");message=$("#message");error=$("#error");telefon=$('#telefon');telefonInfo=$('#telefonInfo');telefon.live('blur',validateTelefon);name1.blur(validateName);email.blur(validateEmail);name1.keyup(validateName);message.keyup(validateMessage);$("#customForm").submit(function(e){if(validateName()&&validateEmail()&&validateMessage()&&validateTelefon())
{var sText=convert(message.val());message.val(sText);$.post("validate.php",form.serializeArray(),function(result){var reArr=result.split('%%');if(reArr[0]=='ok'){error.html(reArr[1]).addClass("valid");form.hide();}else
error.html(reArr[1]);});}
if('function'==typeof e.preventDefault){e.preventDefault();}else{e.returnValue=false;}
return false;});}
function validateTelefon(){var reg=new RegExp("^[ +0-9/()-]+$");if(!reg.test(telefon.val())&&telefon.val()!=""){telefon.addClass("error");telefonInfo.text("Bitte geben Sie eine gültige Telefonnummer ein!");telefonInfo.addClass("error");return false;}
else{telefon.removeClass("error");telefonInfo.text("");telefonInfo.removeClass("error");return true;}}
function validateName(){if(name1.val().length<3){name1.addClass("error");nameInfo.text("Bitte geben Sie Ihren Namen ein!");nameInfo.addClass("error");return false;}
else{name1.removeClass("error");nameInfo.text("");nameInfo.removeClass("error");return true;}}
function validateEmail(){var a=email.val();var filter=/^[a-zA-Z0-9]+[a-zA-Z0-9_.-]+[a-zA-Z0-9_-]+@[a-zA-Z0-9]+[a-zA-Z0-9.-]+[a-zA-Z0-9]+.[a-z]{2,4}$/;if(filter.test(a)){email.removeClass("error");emailInfo.text("");emailInfo.removeClass("error");return true;}
else{email.addClass("error");emailInfo.text("Ist Ihre E-Mailadresse wirklich richtig??");emailInfo.addClass("error");return false;}}
function validateMessage(){if(message.val().length<10){message.addClass("error");return false;}
else{message.removeClass("error");return true;}}
function convert(txt){if(!txt)return'';txt=txt.replace(/&/g,"&amp;");var new_text='';for(var i=0;i<txt.length;i++){var c=txt.charCodeAt(i);if(typeof ENTITIES[c]!='undefined'){new_text+='&'+ENTITIES[c]+';';}else if(c<128){new_text+=String.fromCharCode(c);}else{new_text+='&#'+c+';';}}
return new_text.replace(/</g,"&lt;").replace(/>/g,"&gt;");}
(function($){var locationWrapper={put:function(hash,win){(win||window).location.hash=this.encoder(hash);},get:function(win){var hash=((win||window).location.hash).replace(/^#/,'');return $.browser.mozilla?hash:decodeURIComponent(hash);},encoder:encodeURIComponent};var iframeWrapper={id:"__jQuery_history",init:function(){var html='<iframe id="'+this.id+'" style="display:none" src="javascript:false;" />';$("body").prepend(html);return this;},_document:function(){return $("#"+this.id)[0].contentWindow.document;},put:function(hash){var doc=this._document();doc.open();doc.close();locationWrapper.put(hash,doc);},get:function(){return locationWrapper.get(this._document());}};function initObjects(options){options=$.extend({unescape:false},options||{});locationWrapper.encoder=encoder(options.unescape);function encoder(unescape_){if(unescape_===true){return function(hash){return hash;};}
if(typeof unescape_=="string"&&(unescape_=partialDecoder(unescape_.split("")))||typeof unescape_=="function"){return function(hash){return unescape_(encodeURIComponent(hash));};}
return encodeURIComponent;}
function partialDecoder(chars){var re=new RegExp($.map(chars,encodeURIComponent).join("|"),"ig");return function(enc){return enc.replace(re,decodeURIComponent);};}}
var _={appState:undefined,callback:undefined,init:function(callback,options){},check:function(){},load:function(hash){}};$.history=_;var SimpleImpl={init:function(callback,options){initObjects(options);_.callback=callback;var current_hash=locationWrapper.get();_.appState=current_hash;_.callback(current_hash);setInterval(_.check,100);},check:function(){var current_hash=locationWrapper.get();if(current_hash!=_.appState){_.appState=current_hash;_.callback(current_hash);}},load:function(hash){if(hash!=_.appState){locationWrapper.put(hash);_.appState=hash;_.callback(hash);}}};var IframeImpl={init:function(callback,options){initObjects(options);_.callback=callback;var current_hash=locationWrapper.get();_.appState=current_hash;iframeWrapper.init().put(current_hash);_.callback(current_hash);setInterval(_.check,100);},check:function(){var iframe_hash=iframeWrapper.get(),location_hash=locationWrapper.get();if(location_hash!=iframe_hash){if(location_hash==_.appState){_.appState=iframe_hash;locationWrapper.put(iframe_hash);_.callback(iframe_hash);}else{_.appState=location_hash;iframeWrapper.put(location_hash);_.callback(location_hash);}}},load:function(hash){if(hash!=_.appState){locationWrapper.put(hash);iframeWrapper.put(hash);_.appState=hash;_.callback(hash);}}};if($.browser.msie&&($.browser.version<8||document.documentMode<8)){$.extend(_,IframeImpl);}else{$.extend(_,SimpleImpl);}})(jQuery);function DickerFisch($selektor,_settings){var _DF_hoverclass='over',_DF_parent_class='parent',$ofocusstyle='ofocus';var _DF_ActiveCatnAncestorsofIT=new Array(".activepath",".active");var _jsreadyclass='navfxenabled';var _DF_hideclass='DF_hidelis',_waitingnavclass='DF_waitlis';var $nodisClass="displaynone",$disClass="displayblock";var _DF_obj=this;var _settings=_settings||this;this.NavTimeout=_settings.NavTimeout||2500;this.ListType=_settings.ListType||'ul';this.Effect=(_settings.Effect)?_settings.Effect:0;this.ShowEffect=_settings.ShowEffect||'show';this.HideEffect=_settings.HideEffect||'hide';this.EffectSpeed=_settings.EffectSpeed||300;this.FitIfViewportSmaller=_settings.FitIfViewportSmaller||1111;this.Fit2ViewportClass=_settings.Fit2ViewportClass||false;this.LimitLinks=(typeof _settings.LimitLinks=="number")?_settings.LimitLinks:1;_DF_obj.LimitLinks=($.browser.opera&&_DF_obj.LimitLinks=="1")?0:_DF_obj.LimitLinks;this._DF_NavTimeID;this._fastpullout=function(_eventobj){var $fastpullreturn=false;if(typeof $($selektor+' li.'+_DF_hoverclass).get(0)=="undefined")
$fastpullreturn=true;else{$fastpullreturn=true;$(_eventobj).siblings("li").each(function(i){if($(this).is('.'+_DF_hoverclass)){$fastpullreturn=false;return false;}});}
return $fastpullreturn;};this.$oldtimer=0;this.$fastpullin=function(_eventobj){var $aktimer=(typeof _DF_obj.NavTimeout!="number")?_DF_obj.NavTimeout[1]:_DF_obj.NavTimeout;if(typeof _DF_obj.NavTimeout!="number"&&$(_eventobj).parents('li').length=="0"&&!$(_eventobj).children(_DF_obj.ListType).children('li').is('.'+_DF_hoverclass))
$aktimer=_DF_obj.NavTimeout[0];if($(_eventobj).is('.'+_DF_hoverclass)||_DF_obj.$oldtimer!=$aktimer){window.clearTimeout(_DF_obj._DF_NavTimeID);_DF_obj._DF_NavTimeID=window.setTimeout(_DF_obj._hide,$aktimer);}
_DF_obj.$oldtimer=$aktimer;};this.$navstatus=function(_eventobj,$action){if($action=="show"){$(_eventobj).addClass(_waitingnavclass).removeClass(_DF_hideclass);if(_DF_obj._fastpullout(_eventobj))
_DF_obj.$show();}else if($action=="hide")
$(_eventobj).removeClass(_waitingnavclass).addClass(_DF_hideclass);_DF_obj.$fastpullin(_eventobj,'pullin');};this.$show=function(){_showobj=$selektor+' li.'+_waitingnavclass;if(_DF_obj.Effect==1||_DF_obj.Effect==2)
$(_showobj+':not(.'+_DF_hoverclass+')>'+_DF_obj.ListType).addClass($nodisClass).CleanCSSAnimation(_DF_obj.ShowEffect,_DF_obj.EffectSpeed,function(){$(this).removeClass($disClass);});$(_showobj).removeClass(_waitingnavclass).addClass(_DF_hoverclass);};this._hide=function(){$hideobj=$selektor+' li.'+_DF_hideclass;if(_DF_obj.Effect==1||_DF_obj.Effect==3)
$($hideobj).removeClass(_DF_hideclass).children(_DF_obj.ListType).CleanCSSAnimation(_DF_obj.HideEffect,_DF_obj.EffectSpeed,function(){$(this).removeClass($nodisClass).parent('li').removeClass(_DF_hoverclass);_DF_obj.$show();});else{$($hideobj).removeClass(_DF_hoverclass+' '+_DF_hideclass);_DF_obj.$show();}};this.FitToScreen=function($liobj){var $subpos=$($liobj).addClass(_DF_hoverclass).children(_DF_obj.ListType).css('visibility','hidden').offset({scroll:false})['left']+$($liobj).children(_DF_obj.ListType).outerWidth();if(_viewport<$subpos)
$($liobj).children(_DF_obj.ListType).addClass(_DF_obj.Fit2ViewportClass);};if(_DF_obj.Fit2ViewportClass){var _viewport=$(document).innerWidth();_DF_obj.Fit2ViewportClass=(_viewport<_DF_obj.FitIfViewportSmaller)?_DF_obj.Fit2ViewportClass:false;}
$($selektor+">"+_DF_obj.ListType).addClass(_jsreadyclass).find(_DF_obj.ListType).parent('li').each(function(){$(this).hover(function(){_DF_obj.$navstatus(this,'show');},function(){_DF_obj.$navstatus(this,'hide');}).addClass(_DF_parent_class).find('a').focus(function(){$(this).addClass($ofocusstyle);if(_DF_obj.LimitLinks<1)
$(this).parents('li').addClass(_DF_hoverclass);else
$(this).parents('li').filter(_DF_ActiveCatnAncestorsofIT[0]+','+_DF_ActiveCatnAncestorsofIT[1]).addClass(_DF_hoverclass);}).blur(function(){$(this).removeClass($ofocusstyle).parents("li").removeClass(_DF_hoverclass);});if(_DF_obj.Fit2ViewportClass)
_DF_obj.FitToScreen(this);});if(_DF_obj.Fit2ViewportClass)
$($selektor+" li["+_DF_obj.ListType+"]").removeClass(_DF_hoverclass).children(_DF_obj.ListType).css('visibility','');};jQuery.fn.CleanCSSAnimation=function(_animetyp,$arg1,$arg2,$arg3,$arg4){var $args=new Array($arg1,$arg2,$arg3,$arg4);(_animetyp=="animate")?$fnpos=2:$fnpos=1;var $cbfn="";jQuery.each($args,function(o){if(typeof this=="function"){$cbfn=$args[o];$fnpos=o;}
return;});$args.splice($fnpos,1,function(){_apllyOldCallback(this,$cbfn)});return this.each(function(){unMakeInlineCSS(this,'pre');jQuery(this)[_animetyp].apply(jQuery(this),$args);});};function unMakeInlineCSS($elem,$when){var $nodisClass="displaynone";var $disClass="displayblock";if($when=="pre"){if(jQuery($elem).is('.'+$nodisClass))
jQuery($elem).css("display","none").removeClass($nodisClass);else if(jQuery($elem).is('.'+$disClass))
jQuery($elem).css("display","block").removeClass($disClass);}else if($when=="post"){if(jQuery($elem).css("display")=="none")
jQuery($elem).addClass($nodisClass).css("display","");else if(jQuery($elem).css("display")=="block")
jQuery($elem).addClass($disClass).css("display","");}};function _apllyOldCallback($elem,$cbfn){unMakeInlineCSS($elem,"post");if(typeof $cbfn=="function")
$cbfn.apply($elem);};jQuery.fn.imageLoader=function(options,callBackFunction){var opts=$.extend({},$.fn.imageLoader.defaults,options);var loading=1;var appendToID=this;var images=[];var imagesIsObjects=(typeof opts.images[0]=='object')?true:false;insertLoading();for(var i=0;i<opts.images.length;i++){images['img'+i]=new Image();$(appendToID).append(function(index,html){var img=$(images['img'+i]).load(function(){updateLoading();});if(opts.hideImages){$(img).hide();}
img.attr((imagesIsObjects?opts.images[i]:{src:opts.images[i].src}));return img;});}
return $(this);function updateLoading(){loading++;if((opts.images.length+1)==loading){if(opts.endableSplashScreen){$('#imageLoaderSplashArea').remove();}
if(typeof callBackFunction=='function'){callBackFunction.call();}}
else{if(opts.endableSplashScreen&&opts.enableSplashScreenText)
$('#imageLoaderSplashArea p.loadingText').html("Lade Bild "+loading+" von "+opts.images.length);}};function insertLoading(){if(opts.endableSplashScreen){var preloadArea='<div id="imageLoaderSplashArea">'
+((opts.enableSplashScreenImage)?'<img src="'+opts.splashScreenImage+'" class="splashScreenImage" />':'')
+((opts.enableSplashScreenText)?'<p class="loadingText">Lade Bild '+loading+' von '+opts.images.length+'</p>':'')
+'</div>';$(appendToID).append(preloadArea);}}};jQuery.fn.imageLoader.defaults={images:[],splashScreenImage:'images/splashScreenImage.gif',enableSplashScreenImage:0,enableSplashScreenText:1,endableSplashScreen:1,hideImages:1};function SlideShow(option)
{dSControls=$('.controls');if(option=='stop'||option=='pause'||option=='next'||option=='prev'){clearInterval(slideID);slideID=null;}
if(!slideID&&!preventSlide){if(option=='resume'||option=='start')
{if(option=='start')
cI=0;if($('.slideImg').length>1)
{slideID=setInterval("cI++;ShowSlide(true);",6000);if(dSControls.length<1)
{dSCont.append('<a href="#" id="nextpic" class="controls"><img src="images/next.png" /></a><a href="#" id="prevpic" class="controls"><img src="images/prev.png"/></a>');dSControls=$('.controls');}}else
dSControls.detach();ShowSlide();}
else if(option=='next')
{cI++;ShowSlide();SlideShow('resume');}
else if(option=='prev')
{cI--;ShowSlide();SlideShow('resume');}}
return;}
function ShowSlide(animation,control)
{var mod=$('.slideImg').length;cI=(cI+mod)%mod;var dSImgCurr=$('.slideImg:visible');var dSImgNext=$('.slideImg:eq('+cI+')');var ImgOutHeight=Math.floor(dSImgNext.outerHeight()+(dSCont.height()/2));var ImgOutWidth=dSImgNext.outerWidth();dSImgNext.css({'margin-top':Math.floor((dSlide.height()-ImgOutHeight)/2),'margin-left':Math.floor((dSlide.width()-dSImgNext.width())/2)+ImgOutWidth-dSImgNext.width()});if(animation==true)
{dSImgCurr.fadeOut(2000);dSImgNext.fadeIn(2000);}else
{dSImgCurr.hide();dSImgNext.show();}
if(mod>1)
{dSControls.css({'top':Math.floor(dSImgNext.offset().top+ImgOutHeight),'left':Math.floor(dSImgNext.offset().left+(ImgOutWidth/2))}).show();$('#prevpic').css('left',Math.floor(dSImgNext.offset().left+(ImgOutWidth/2)-38));}
dSCapWrap.offset({top:dSImgNext.offset().top,left:dSImgNext.offset().left}).width(ImgOutWidth).height(ImgOutHeight);dSCapWrap.html('<div id="caption"></div>').children().empty().html(slideshow[cI].caption).fadeTo(0,0.0).css('top',ImgOutHeight-$('#caption').outerHeight());dSCaption=$('#caption');};function loadContent(site){var picture=new Array();var cSite;SlideShow('stop');$.post('functions.php',{page:site,file:'xml/data.xml'},function(data){dContent.empty().html(data['content']).ready(function(){setForm();});if(data['pics'].length>0)
{var image=data['pics'];slideshow=data['pics'];delete image['caption'];$(image).attr('class','slideImg');dSCont.empty().imageLoader({images: image},function(){SlideShow('start');});$('.slideImg').wrap(function()
{return'<a class="fancy" href="'+$(this).attr('src').replace('_k.','_b.')+'" rel="g1"/>';});}
$('a.fancy').fancybox({'titleShow':false,'index':0,'onStart':function(){preventSlide=1;SlideShow('pause');},'onClosed':function(){preventSlide=0;SlideShow('resume');}});if(/(MSIE)/.test(navigator.userAgent))
{$('.fancyFrame').removeClass('fancyFrame').attr('target','_new');}else
{dTitle.html(data['title']);$('a.fancyFrame').fancybox({'titleShow':false,'onStart':function(){preventSlide=1;SlideShow('pause');},'onClosed':function(){preventSlide=0;SlideShow('resume');},'width':'95%','height':'95%','autoScale':false,'transitionIn':'none','transitionOut':'none','type':'iframe'});}
if(site==51)
{loadScript();dSCapWrap.hide();preventSlide=1;}
else
{dSCapWrap.show();preventSlide=0;}
if($('.toggleText')){$('.toggleText').hide();}},"json");};$(document).ready(function(){if(loadedpage!=1)
{window.location.hash=loadedpage;}
$('.conLink').each(function(){var a=$(this).attr('href').replace(/^\//,'#');$(this).attr('href',a);});var nav=new DickerFisch('#header',{NavTimeout:new Array(99,500),LimitLinks:0,Effect:1});$.history.init(function(url){var r=new RegExp(/[0-9]+/);var erg=r.exec(url==""?"1/i":url);loadContent(erg[0]);window.location.hash=url;try {
			var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
			piwikTracker.trackPageView(url);
		} catch( err ) {}});$.ajaxSetup({error:function(x,e){if(x.status==0){dContent.html('Du bist offline!!\n Pr&uuml;fe bitte dein Netzwerk!.');}else if(x.status==404){dContent.html('Die Seite wurde nicht gefunden.');}else if(x.status==500){dContent.html('Internel Server Error.');}else if(e=='parsererror'){dContent.html('Error.\nVerarbeitung der Anfrage ist fehlgeschlagen.');}else if(e=='timeout'){dContent.html('Zeit&uuml;berschreitung der Anfrage.');}else{dContent.html('Unbekannter Fehler.\n'+x.responseText);}}});$('.conLink').live('click',function(e){var requestSite=$(this).attr("href");$.history.load(requestSite);if('function'==typeof e.preventDefault){e.preventDefault();}else{e.returnValue=false;}});$('#zoom').live('click',function(e){$('.slideImg:visible').parent().trigger('click.fb');e.preventDefault();});$('#nextpic').live('click',function(e){SlideShow('next');if('function'==typeof e.preventDefault){e.preventDefault();}else{e.returnValue=false;}});$('#prevpic').live('click',function(e){SlideShow('prev');if('function'==typeof e.preventDefault){e.preventDefault();}else{e.returnValue=false;}});dSCapWrap.hover(function(){SlideShow('pause');if(dSCaption.html()){dSCaption.fadeTo(1000,0.85);}},function(){SlideShow("resume");dSCaption.fadeTo(1000,0.0);});$('.toggleHead').live('click',function(e){$(this).toggleClass("active").next().slideToggle("slow");e.preventDefault();});if(/(MSIE)/.test(navigator.userAgent))
{$('.fancyFrame').removeClass('fancyFrame').attr('target','_new');}});

