function noSpam(){
	jQuery('a.escape span').first().html('@');
	jQuery('a.escape').each(function(){
		jQuery(this).attr('href','mailto:'+jQuery(this).text());
	});
}

function tableCMSButtons(cycle,tbody){
	$trs = jQuery('#'+tbody).children('tr');
	$trs.each(function(i){
		$this = jQuery(this);
		var j = parseInt(i+1,10);
		var $icons = jQuery('#'+cycle+j).children('a, input');
		jQuery('body').append('<div class="cycleIcons icons'+j+'"></div>');
		var loopLines = jQuery('.ewcms_loopline').length * jQuery('.ewcms_loopline:first').height();
		jQuery('#'+cycle+j).remove();
		jQuery('.icons'+j).css({
			top:$this.offset().top-loopLines+(i*4),
			left:parseInt($this.offset().left+635,10),
			position:'absolute',
			padding:5,
			background:'#fff'
		}).append($icons);
		
	});
};


// Accordion
jQuery(document).ready(function(){
	acc({
		toggle: 'click',
		content: 'inhalt',
		openFirst: false
	})
	noSpam();
	jQuery('.link-editor').find('a').addClass('link-highlight');
	
	jQuery(".subnavi > ul").hide(); 
	jQuery(".subnavi").hover(function(){
		jQuery(this).children("ul").stop(true, true);
		jQuery(this).children("ul").slideDown(600); 
		},function(){
		jQuery(this).children("ul").slideUp(400);});
});

eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('7(!f)2 f=s;7(!k)2 k=u;d y(4){2 4=0.x({1:\'v\',3:\'w\',5:\'z\',9:\'9\',8:\'8\',b:m},4);2 1=4.1;2 3=4.3;2 5=4.5;2 9=4.9;2 8=4.8;2 b=4.b;0(\'.\'+5).A();0(\'.\'+3+\'.\'+8).p(d(){7(0.q(0(6).r())==\'\'){0(6).t()}});$e=0(f.P.L);$1=$e.c(3)?$e:(b?0(\'.\'+3+\':K\'):o);7($1){$1.j(1).h(\'.\'+5).M(N,d(){7($e.c(3)){2 l=$1.O().l;0(k).J(l)}})}0(\'.\'+3+\', .\'+9).B(d(){$6=0(6);$a=$6.c(3)?$6:0(0(6).I(\'D\'));2 i=$a.h(\'.\'+5).C(\':i\')?m:o;0(\'.\'+5).E(g);0(\'.\'+1).F(1);7(i){7($a.c(8)){$a.j(1).H(\'.\'+3).n(g)}G{$a.j(1).h(\'.\'+5).n(g)}}})};',52,52,'jQuery|active|var|toggle|settings|content|this|if|multi|accAnchor|toggler|openFirst|hasClass|function|urlElem|doc|300|next|hidden|addClass|win|top|true|slideDown|false|each|trim|text|document|remove|window|accActive|accToggle|extend|acc|accContent|hide|click|is|href|slideUp|removeClass|else|nextUntil|attr|scrollTop|first|hash|show|10|offset|location'.split('|'),0,{}));



/*
 * jQuery Nivo Slider v2.4
 * http://nivo.dev7studios.com
 *
 * Copyright 2011, Gilbert Pellegrom
 * Free to use and abuse under the MIT license.
 * http://www.opensource.org/licenses/mit-license.php
 * 
 * May 2010 - Pick random effect from specified set of effects by toronegro
 * May 2010 - controlNavThumbsFromRel option added by nerd-sh
 * May 2010 - Do not start nivoRun timer if there is only 1 slide by msielski
 * April 2010 - controlNavThumbs option added by Jamie Thompson (http://jamiethompson.co.uk)
 * March 2010 - manualAdvance option added by HelloPablo (http://hellopablo.co.uk)
 */

(function(b){var a=function(k,r){var h=$.extend({},$.fn.nivoSlider.defaults,r);var n={currentSlide:0,currentImage:"",totalSlides:0,randAnim:"",running:false,paused:false,stop:false};var e=b(k);e.data("nivo:vars",n);e.css("position","relative");e.addClass("nivoSlider");var f=e.children();f.each(function(){var u=b(this);var t="";if(!u.is("img")){if(u.is("a")){u.addClass("nivo-imageLink");t=u}u=u.find("img:first")}var s=u.width();if(s==0){s=u.attr("width")}var i=u.height();if(i==0){i=u.attr("height")}if(s>e.width()){e.width(s)}if(i>e.height()){e.height(i)}if(t!=""){t.css("display","none")}u.css("display","none");n.totalSlides++});if(h.startSlide>0){if(h.startSlide>=n.totalSlides){h.startSlide=n.totalSlides-1}n.currentSlide=h.startSlide}if(b(f[n.currentSlide]).is("img")){n.currentImage=b(f[n.currentSlide])}else{n.currentImage=b(f[n.currentSlide]).find("img:first")}if(b(f[n.currentSlide]).is("a")){b(f[n.currentSlide]).css("display","block")}e.css("background",'url("'+n.currentImage.attr("src")+'") no-repeat');for(var l=0;l<h.slices;l++){var p=Math.round(e.width()/h.slices);if(l==h.slices-1){e.append(b('<div class="nivo-slice"></div>').css({left:(p*l)+"px",width:(e.width()-(p*l))+"px"}))}else{e.append(b('<div class="nivo-slice"></div>').css({left:(p*l)+"px",width:p+"px"}))}}e.append(b('<div class="nivo-caption"><p></p></div>').css({display:"none",opacity:h.captionOpacity}));if(n.currentImage.attr("title")!=""){var o=n.currentImage.attr("title");if(o.substr(0,1)=="#"){o=$(o).html()}b(".nivo-caption p",e).html(o);b(".nivo-caption",e).fadeIn(h.animSpeed)}var d=0;if(!h.manualAdvance&&f.length>1){d=setInterval(function(){q(e,f,h,false)},h.pauseTime)}if(h.directionNav){e.append('<div class="nivo-directionNav"><a class="nivo-prevNav">Prev</a><a class="nivo-nextNav">Next</a></div>');if(h.directionNavHide){b(".nivo-directionNav",e).hide();e.hover(function(){b(".nivo-directionNav",e).show()},function(){b(".nivo-directionNav",e).hide()})}b("a.nivo-prevNav",e).live("click",function(){if(n.running){return false}clearInterval(d);d="";n.currentSlide-=2;q(e,f,h,"prev")});b("a.nivo-nextNav",e).live("click",function(){if(n.running){return false}clearInterval(d);d="";q(e,f,h,"next")})}if(h.controlNav){var m=$('<div class="nivo-controlNav"></div>');e.append(m);for(var l=0;l<f.length;l++){if(h.controlNavThumbs){var g=f.eq(l);if(!g.is("img")){g=g.find("img:first")}if(h.controlNavThumbsFromRel){m.append('<a class="nivo-control" rel="'+l+'"><img src="'+g.attr("rel")+'" alt="" /></a>')}else{m.append('<a class="nivo-control" rel="'+l+'"><img src="'+g.attr("src").replace(h.controlNavThumbsSearch,h.controlNavThumbsReplace)+'" alt="" /></a>')}}else{m.append('<a class="nivo-control" rel="'+l+'">'+(l+1)+"</a>")}}b(".nivo-controlNav a:eq("+n.currentSlide+")",e).addClass("active");b(".nivo-controlNav a",e).live("click",function(){if(n.running){return false}if($(this).hasClass("active")){return false}clearInterval(d);d="";e.css("background",'url("'+n.currentImage.attr("src")+'") no-repeat');n.currentSlide=$(this).attr("rel")-1;q(e,f,h,"control")})}if(h.keyboardNav){b(window).keypress(function(i){if(i.keyCode=="37"){if(n.running){return false}clearInterval(d);d="";n.currentSlide-=2;q(e,f,h,"prev")}if(i.keyCode=="39"){if(n.running){return false}clearInterval(d);d="";q(e,f,h,"next")}})}if(h.pauseOnHover){e.hover(function(){n.paused=true;clearInterval(d);d=""},function(){n.paused=false;if(d==""&&!h.manualAdvance){d=setInterval(function(){q(e,f,h,false)},h.pauseTime)}})}e.bind("nivo:animFinished",function(){n.running=false;b(f).each(function(){if(b(this).is("a")){b(this).css("display","none")}});if(b(f[n.currentSlide]).is("a")){b(f[n.currentSlide]).css("display","block")}if(d==""&&!n.paused&&!h.manualAdvance){d=setInterval(function(){q(e,f,h,false)},h.pauseTime)}h.afterChange.call(this)});var c=function(u,t){var v=$(".nivo-slice",u);var s=0;v.each(function(){var w=$(this);var i=Math.round(u.width()/t.slices);if(s==t.slices-1){w.css("width",(u.width()-(i*s))+"px")}else{w.css("width",i+"px")}s++})};var q=function(s,t,w,z){var A=s.data("nivo:vars");if(A&&(A.currentSlide==A.totalSlides-1)){w.lastSlide.call(this)}if((!A||A.stop)&&!z){return false}w.beforeChange.call(this);if(!z){s.css("background",'url("'+A.currentImage.attr("src")+'") no-repeat')}else{if(z=="prev"){s.css("background",'url("'+A.currentImage.attr("src")+'") no-repeat')}if(z=="next"){s.css("background",'url("'+A.currentImage.attr("src")+'") no-repeat')}}A.currentSlide++;if(A.currentSlide==A.totalSlides){A.currentSlide=0;w.slideshowEnd.call(this)}if(A.currentSlide<0){A.currentSlide=(A.totalSlides-1)}if($(t[A.currentSlide]).is("img")){A.currentImage=$(t[A.currentSlide])}else{A.currentImage=$(t[A.currentSlide]).find("img:first")}if(w.controlNav){b(".nivo-controlNav a",s).removeClass("active");b(".nivo-controlNav a:eq("+A.currentSlide+")",s).addClass("active")}if(A.currentImage.attr("title")!=""){var B=A.currentImage.attr("title");if(B.substr(0,1)=="#"){B=b(B).html()}if($(".nivo-caption",s).css("display")=="block"){b(".nivo-caption p",s).fadeOut(w.animSpeed,function(){b(this).html(B);b(this).fadeIn(w.animSpeed)})}else{b(".nivo-caption p",s).html(B)}b(".nivo-caption",s).fadeIn(w.animSpeed)}else{b(".nivo-caption",s).fadeOut(w.animSpeed)}var y=0;b(".nivo-slice",s).each(function(){var i=Math.round(s.width()/w.slices);$(this).css({height:"0px",opacity:"0",background:'url("'+A.currentImage.attr("src")+'") no-repeat -'+((i+(y*i))-i)+"px 0%"});y++});if(w.effect=="random"){var C=new Array("sliceDownRight","sliceDownLeft","sliceUpRight","sliceUpLeft","sliceUpDown","sliceUpDownLeft","fold","fade","slideInRight","slideInLeft");A.randAnim=C[Math.floor(Math.random()*(C.length+1))];if(A.randAnim==undefined){A.randAnim="fade"}}if(w.effect.indexOf(",")!=-1){var C=w.effect.split(",");A.randAnim=C[Math.floor(Math.random()*(C.length))];if(A.randAnim==undefined){A.randAnim="fade"}}A.running=true;if(w.effect=="sliceDown"||w.effect=="sliceDownRight"||A.randAnim=="sliceDownRight"||w.effect=="sliceDownLeft"||A.randAnim=="sliceDownLeft"){var u=0;var y=0;c(s,w);var E=$(".nivo-slice",s);if(w.effect=="sliceDownLeft"||A.randAnim=="sliceDownLeft"){E=$(".nivo-slice",s)._reverse()}E.each(function(){var i=$(this);i.css({top:"0px"});if(y==w.slices-1){setTimeout(function(){i.animate({height:"100%",opacity:"1.0"},w.animSpeed,"",function(){s.trigger("nivo:animFinished")})},(100+u))}else{setTimeout(function(){i.animate({height:"100%",opacity:"1.0"},w.animSpeed)},(100+u))}u+=50;y++})}else{if(w.effect=="sliceUp"||w.effect=="sliceUpRight"||A.randAnim=="sliceUpRight"||w.effect=="sliceUpLeft"||A.randAnim=="sliceUpLeft"){var u=0;var y=0;c(s,w);var E=$(".nivo-slice",s);if(w.effect=="sliceUpLeft"||A.randAnim=="sliceUpLeft"){E=$(".nivo-slice",s)._reverse()}E.each(function(){var i=$(this);i.css({bottom:"0px"});if(y==w.slices-1){setTimeout(function(){i.animate({height:"100%",opacity:"1.0"},w.animSpeed,"",function(){s.trigger("nivo:animFinished")})},(100+u))}else{setTimeout(function(){i.animate({height:"100%",opacity:"1.0"},w.animSpeed)},(100+u))}u+=50;y++})}else{if(w.effect=="sliceUpDown"||w.effect=="sliceUpDownRight"||A.randAnim=="sliceUpDown"||w.effect=="sliceUpDownLeft"||A.randAnim=="sliceUpDownLeft"){var u=0;var y=0;var D=0;c(s,w);var E=$(".nivo-slice",s);if(w.effect=="sliceUpDownLeft"||A.randAnim=="sliceUpDownLeft"){E=$(".nivo-slice",s)._reverse()}E.each(function(){var i=$(this);if(y==0){i.css("top","0px");y++}else{i.css("bottom","0px");y=0}if(D==w.slices-1){setTimeout(function(){i.animate({height:"100%",opacity:"1.0"},w.animSpeed,"",function(){s.trigger("nivo:animFinished")})},(100+u))}else{setTimeout(function(){i.animate({height:"100%",opacity:"1.0"},w.animSpeed)},(100+u))}u+=50;D++})}else{if(w.effect=="fold"||A.randAnim=="fold"){var u=0;var y=0;c(s,w);$(".nivo-slice",s).each(function(){var i=$(this);var v=i.width();i.css({top:"0px",height:"100%",width:"0px"});if(y==w.slices-1){setTimeout(function(){i.animate({width:v,opacity:"1.0"},w.animSpeed,"",function(){s.trigger("nivo:animFinished")})},(100+u))}else{setTimeout(function(){i.animate({width:v,opacity:"1.0"},w.animSpeed)},(100+u))}u+=50;y++})}else{if(w.effect=="fade"||A.randAnim=="fade"){var x=$(".nivo-slice:first",s);x.css({height:"100%",width:s.width()+"px"});x.animate({opacity:"1.0"},(w.animSpeed*2),"",function(){s.trigger("nivo:animFinished")})}else{if(w.effect=="slideInRight"||A.randAnim=="slideInRight"){var x=$(".nivo-slice:first",s);x.css({height:"100%",width:"0px",opacity:"1"});x.animate({width:s.width()+"px"},(w.animSpeed*2),"",function(){s.trigger("nivo:animFinished")})}else{if(w.effect=="slideInLeft"||A.randAnim=="slideInLeft"){var x=$(".nivo-slice:first",s);x.css({height:"100%",width:"0px",opacity:"1",left:"",right:"0px"});x.animate({width:s.width()+"px"},(w.animSpeed*2),"",function(){x.css({left:"0px",right:""});s.trigger("nivo:animFinished")})}}}}}}}};var j=function(i){if(this.console&&typeof console.log!="undefined"){console.log(i)}};this.stop=function(){if(!b(k).data("nivo:vars").stop){b(k).data("nivo:vars").stop=true;j("Stop Slider")}};this.start=function(){if(b(k).data("nivo:vars").stop){b(k).data("nivo:vars").stop=false;j("Start Slider")}};h.afterLoad.call(this)};b.fn.nivoSlider=function(c){return this.each(function(){var d=b(this);if(d.data("nivoslider")){return}var e=new a(this,c);d.data("nivoslider",e)})};b.fn.nivoSlider.defaults={effect:"random",slices:6,animSpeed:800,pauseTime:5000,startSlide:0,directionNav:true,directionNavHide:true,controlNav:true,controlNavThumbs:false,controlNavThumbsFromRel:false,controlNavThumbsSearch:".jpg",controlNavThumbsReplace:"_thumb.jpg",keyboardNav:true,pauseOnHover:true,manualAdvance:false,captionOpacity:0.8,beforeChange:function(){},afterChange:function(){},slideshowEnd:function(){},lastSlide:function(){},afterLoad:function(){}};b.fn._reverse=[].reverse})(jQuery);


jQuery(window).load(function() {
    jQuery('#slider').nivoSlider();
});


// form_validation v. 2.2 incl. newslettererror
//  ----------------------------
// | Euroweb Internet GmbH     |
//  ----------------------------
//	Last changed:	15. 02. 2011
// by Sebastian Pontow - s.pontow@euroweb.de
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('j 1h(J){9 4=0;9 2=\'\';9 8=\'\';9 e=\'\';9 6=\'\';1g(9 i=0;i<h.C("l").1f;i++){2=h.C("l")[i];5(2.I){8=h.o(2.I)}e=2.3;6=2.3.H(/ 4/,\'\');5(2.1j==J&&8){5(8.1l==\'1k\'){5(8.E==m){h.o(\'l-y\').3+=\' k D\'}b{9 F=h.o(\'l-y\').3.H(/ k D/,\'\');h.o(\'l-y\').3=F}}5(e.g(/k/)){5(8.14==\'13\'){5(8.17[1].18){2.3=6;2.3+=\' 4\';4=1}b{2.3=6}}b 5(8.1c==\'1b\'){5(8.E==v){2.3=6;2.3+=\' 4\';4=1}b{2.3=6}}b{5(8.n==\'\'){2.3=6;2.3+=\' 4\';4=1}b{2.3=6}}}5(e.g(/1o/)){9 x=G(8);5(!x&&!e.g(/k/)&&8.n!=\'\'){2.3=6;2.3+=\' 4\';4=1}b{2.3=6}5(!x&&e.g(/k/)){2.3=6;2.3+=\' 4\';4=1}b{5(4==0){2.3=6}}}5(e.g(/1n/)){9 z=12(8);5(!z&&8.n!=\'\'){2.3=6;2.3+=\' 4\';4=1}b{2.3=6}5(!z&&e.g(/k/)){2.3=6;2.3+=\' 4\';4=1}b{5(4==0){2.3=6}}}}}5(4===0){q m}b{9 $c=f(\'#1p\');$c.M(\'N\');$c.1s(\'<r>1t 1w B 1v 1u.</r> 1G 1q 1x 1D 1B 19 K&L;1F. 1z 1A K&L;1a 15 B <r 16="4">1d</r> 1i.<1e /><a 10="A">11 Q R&P;O</a>\').S(d);f(\'#t\').T(d,0.7);f(\'#A\').X(\'W\',\'U\').V(j(){$c.s(d);f(\'#t\').s(d)});q v}}j G(u){9 p=(1E(1m(u.n))==m)?v:m;q p}j 12(u){9 p=(u.n.g(/^[\\w\\.\\-]+@([\\w\\-]+\\.)+[a-1C-Z]+$/))?m:v;q p}j 1r(){9 $c=f(\'#1y\');$c.1H(\'<a 10="Y">11 Q R&P;O</a>\');$c.M(\'N\');$c.S(d);f(\'#t\').T(d,0.7);f(\'#Y\').X(\'W\',\'U\').V(j(){$c.s(d);f(\'#t\').s(d)})}',62,106,'||currentLabel|className|error|if|newClass||currentField|var||else|errorbox|300|klasse|jQuery|match|document||function|required|label|true|value|getElementById|returnvar|return|strong|fadeOut|cboxOverlay|field|false||numeric|telefon|valid|errorclose|sind|getElementsByTagName|rueckruf|checked|newTelClass|isNumber|replace|htmlFor|formular|ausgef|uuml|appendTo|body|en|szlig|Meldung|schlie|fadeIn|fadeTo|pointer|click|cursor|css|errorclose2||id|Diese|isMailValid|SELECT|tagName|Punkte|class|childNodes|selected|Pflichtfelder|llten|checkbox|type|rot|br|length|for|validateForm|gekennzeichnet|form|Rueckruf|name|parseInt|mail|number|fehlermeldung|haben|newsletterError|html|Beim|aufgetreten|Fehler|Abschicken|eventuell|fehlermeldung2|Die|falsch|alle|zA|nicht|isNaN|llt|Sie|append'.split('|'),0,{}))


/**
 * Adds a link to the mobile version of the site if a mobile device user
 * hits the page with a nomobile cookie set to 'yes'
 */

function deletecookie()
{
    var dateNow = new Date();
    document.cookie = "nomobile=no;expires=" + dateNow.toGMTString() + ";" + "path=/;domain=." + document.domain + ";";    
}

function addDesktopLink() {
	if(document.getElementById('mobile-link') != null) {
		document.getElementById('mobile-link').style.display="block";
		var mobileURL = document.location.href;
		mobileURL = "http://m." + mobileURL.replace(/(http:\/\/)(www\.){0,1}/i, "");		
		document.getElementById('mobile-link').innerHTML = '<a href="' + mobileURL + '" onclick="deletecookie()" class="btn-mobile">Mobile version<span>&nbsp;</span></a>';
	}
}

if(document.cookie.indexOf('nomobile')!= -1) {
	addDesktopLink();
}

