$(document).ready(function(){ 

	$('#videoneu.hidden').each(function() { 
		$('<a class="closevb" href="#"></a>')
			.appendTo(this)
			.click(function(e) {
				$('#rechte_spalte a.videostarter').trigger('click');
				e.preventDefault();
			});
	});
	$('#rechte_spalte a.videostarter').click(function(e) { 
		$('#videoneu').toggle();
		e.preventDefault();
	});

	if($('#ticker').length) { 
		$('#ticker li').addClass('news-item');
		$('#ticker').ticker({ 
			speed: 0.10,
			titleText: 'Latest',
			pauseOnItems: 2000,
			fadeInSpeed: 600,
			fadeOutSpeed: 300
		});	
	}

	// Course booking
	if($('table td.clickdates').length) { 
		var startPreis = $('table td.preis').text();
		var $form = $('table.course_booking').parent('form');
		var $dateField = $('form #coursedate').attr({ readonly: true });
		var $price = $('<input type="hidden" readonly="true" name="price" value="'+startPreis+'" />').insertAfter($dateField);
	}
	$('table td.clickdates a').click(function(e) { 
		var date = $(this).text();
		$('form #coursedate').val(date);
		$price.val(startPreis);
		e.preventDefault();
	});
	$('table td.clickdates a[href$="#0"]').click(function(e) { 
		$price.val('');
		e.preventDefault();
	});
		
	if($('table.course_booking').length) { 
		$('table.course_booking.toggle').hide();
		$('h2.booking_toggle').click(function() { 
			$(this).toggleClass('auf');
			$(this).next('.toggle').slideToggle(500);
		});
	};

	if($('body.startseite').hasClass('tbox') == true) { 
		var tboxAdress = $('a.tbox').attr('href');
		var tboxTitle = $('a.tbox').attr('title');
		tb_show(tboxTitle, tboxAdress, false); 
	};
	
	// Ohne Cycle-Plugin
	if($("#gallery").length) { 
		$.getScript("js_is/gallerie.js");
	};
	
	/* Loginbox */
	$('.loginbox').addClass('slide').parent().before('<a class="loginlink" title="Loginbereich &ouml;ffnen" href="#">Login&nbsp;&raquo;</a>');
	$(".loginlink").click().toggle(function(){
		$('#rechte_spalte:not(:animated), #head form').animate({ marginTop: '125px' }, 'slow', function() { 
			$('.loginbox:not(:animated)').animate({ height: 'show' }, 'slow');
		});
	  }, function() { 
		$('.loginbox:not(:animated)').animate({ height: 'hide' }, 'slow', function() { 
			$('#rechte_spalte:not(:animated), #head form').animate({ marginTop: '0' }, 'slow');
		});
	});
	
	/* Navigation */
 	$('#nav li:last a').addClass('last'); 
	$('body.startseite #nav li:has(>ul) ul li:first-child').addClass('first');
	$('body.startseite #nav li:has(>ul) li:last-child').addClass('last');
	function auf(){ $(this).children('ul').show(); }
	function zu(){ $(this).children('ul').hide(); }
	$('body.startseite #nav li:has(>ul)').hoverIntent({
	   sensitivity: 1, 
	   interval: 30, 
	   over: auf, 
	   timeout: 400, 
	   out: zu 
	});
	
	/* Allgemeines */
	$('table.kurstabelle tr:odd').addClass('wechsel');
	$('table.kurstabelle th:first').addClass('first');
	$('table.kurstabelle').before('<a class="jhw1" title="See January - June" href="#">&laquo;&nbsp;See January - June</a>&nbsp;&nbsp;&nbsp;&nbsp;<a class="jhw2" title="See July - December" href="#">See July - December&nbsp;&raquo;</a>');
	
	$('table.kurstabelle tr').find('td:gt(7), th:gt(7)').css({ display: 'none' });
	$('table.kurstabelle td.title a').attr({ target: '_parent' });	
	$('a.jhw2').click(function() { 
		$('table.kurstabelle tr, table.kurstabelle tr').each(function() { 
			$(this).find('td:gt(1), th:gt(1)').hide();
			$(this).find('td:gt(7), th:gt(7)').show();
		});
		return false;
	});
	
	$('a.jhw1').click(function() { 
		$('table.kurstabelle tr, table.kurstabelle tr').each(function() { 
			$(this).find('td:gt(1), th:gt(1)').hide();
			$(this).find('td:lt(8), th:lt(8)').show();
		});
		return false;
	});
	
	$('table.kurstabelle tr').hover(function() {
		$(this).find('td').addClass('hover');
	  }, function() {
		$(this).find('td').removeClass('hover');
	});
	
	$('select option:odd').addClass('wechsel'); 
	$('#linke_spalte select option:odd').addClass('wechsel'); 
	$('body.startseite #inhalt h2').wrap('<span class="h2wrap"></span>'); 
	$('#inhalt .box:even').addClass('box2');
	
	/* sIFR - Headlines */	
	if(typeof sIFR == "function"){
		sIFR.replaceElement(named({sSelector:"h1.bildueberschrift", sFlashSrc:"sifr/univers.swf", sColor:"#ffffff", sFlashVars:"textalign=right", sCase:"upper", sWmode:"transparent"}));
		sIFR.replaceElement(named({sSelector:"#linke_spalte h3, #rechte_spalte h3", sFlashSrc:"sifr/univers.swf", sColor:"#999999", nPaddingTop:4, nPaddingBottom:2, sFlashVars:"textalign=left", sCase:"upper", sWmode:"transparent"}));
		sIFR.replaceElement(named({sSelector:"h3.bereichheadline", sFlashSrc:"sifr/univers.swf", sColor:"#0035AD", nPaddingTop:5, nPaddingBottom:5, sFlashVars:"textalign=left", sCase:"upper", sWmode:"transparent"}));
		sIFR.replaceElement(named({sSelector:"#inhalt h1", sFlashSrc:"sifr/univers.swf", sColor:"#565656", sFlashVars:"textalign=left", sWmode:"transparent"}));
		//sIFR.replaceElement(named({sSelector:"body.startseite #inhalt h2", sFlashSrc:"sifr/univers.swf", sColor:"#565656", sFlashVars:"textalign=left&offsetTop=2", sCase:"upper",sWmode:"transparent"}));
	};	
});

/* Modul Besucherliste: Teilnehmer hinzufügen */
function addTeilnehmer(pfad) {
	$.get("http://"+pfad+"/func/modul_besucherliste/addteilnehmer.php", 
  		function(data){
  		
			// neuen Teilnehmer einfügen		
			$('#insertpoint').before(data);	
			
  		}
  	);
}	

// Ticker
eval(function(p,a,c,k,e,r){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--)r[e(c)]=k[c]||e(c);k=[function(e){return r[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}('(5($){$.1s.6=5(g){n h=$.2u({},$.1s.6.1R,g);4($(P).Q==0){4(R.S&&R.S.1d){R.S.1d(\'1S 1T 1t 1U 1u 1V!\')}7{1W(\'1S 1T 1t 1U 1u 1V!\')}D 8}n j=\'#\'+$(P).2v(\'w\');n k=$(P).2w(0).2x;D P.1X(5(){n d=1Y();n f={9:0,1v:0,12:0,o:{},H:m,r:8,1e:8,3:{l:\'#6-A-\'+d,13:\'#6-1f-\'+d,T:\'#6-1f-\'+d+\' 1Z\',K:\'#6-\'+d,E:\'#6-21-\'+d,s:\'#6-1w-\'+d,L:\'#6-1w-\'+d+\' 1Z\',1x:\'#6-z-\'+d,1y:\'#1g-\'+d,1z:\'#1h-\'+d,M:\'#H-22-\'+d}};4(k!=\'2y\'&&k!=\'2z\'&&h.1A===m){U(\'2A 1i <\'+k.2B()+\'> u 1B 2C F P 2D - 2E 1B u <1C> 2F <2G>\');D 8}h.B==\'2H\'?h.B=\'23\':h.B=\'2I\';24();5 V(a){n b=0,1D;F(1D 1u a){4(a.2J(1D))b++}D b};5 1Y(){n a=2K 2L;D a.2M()}5 U(a){4(h.25){4(R.S&&R.S.1d){R.S.1d(a)}7{1W(a)}}}5 24(){26();$(j).2N(\'<I w="\'+f.3.E.v(\'#\',\'\')+\'"></I>\');$(f.3.E).2O().2P();$(f.3.E).27(\'<I w="\'+f.3.K.v(\'#\',\'\')+\'" J="6"><I w="\'+f.3.13.v(\'#\',\'\')+\'" J="6-1f"><1j><!-- --></1j></I><p w="\'+f.3.l.v(\'#\',\'\')+\'" J="6-A"></p><I w="\'+f.3.s.v(\'#\',\'\')+\'" J="6-1w"><1j><!-- --></1j></I></I>\');$(f.3.E).1k(\'2Q-28\').W(\'6-21 2R-28 \'+h.B);$(f.3.2S+\',\'+f.3.l).N();4(h.z){$(f.3.1x).2T(\'29 1E 2a 1F 2b\',5(e){n a=e.2U.w;4(e.u==\'29\'){2c(a){14 f.3.1y.v(\'#\',\'\'):f.r=m;$(f.3.M).W(\'r\');1G(\'1g\');15;14 f.3.1z.v(\'#\',\'\'):f.r=m;$(f.3.M).W(\'r\');1G(\'1h\');15;14 f.3.M.v(\'#\',\'\'):4(f.H==m){f.r=m;$(f.3.M).W(\'r\');1l()}7{f.r=8;$(f.3.M).1k(\'r\');1H()}15}}7 4(e.u==\'1E\'&&$(\'#\'+a).1m(\'z\')){$(\'#\'+a).W(\'2d\')}7 4(e.u==\'2a\'&&$(\'#\'+a).1m(\'z\')){$(\'#\'+a).W(\'2e\')}7 4(e.u==\'2b\'&&$(\'#\'+a).1m(\'z\')){$(\'#\'+a).1k(\'2e\')}7 4(e.u==\'1F\'&&$(\'#\'+a).1m(\'z\')){$(\'#\'+a).1k(\'2d\')}});$(f.3.E).27(\'<1C w="\'+f.3.1x.v(\'#\',\'\')+\'" J="6-z"><X w="\'+f.3.M.v(\'#\',\'\')+\'" J="1I-H-22 z"><a 1n=""><!-- --></a></X><X w="\'+f.3.1y.v(\'#\',\'\')+\'" J="1I-1g z"><a 1n=""><!-- --></a></X><X w="\'+f.3.1z.v(\'#\',\'\')+\'" J="1I-1h z"><a 1n=""><!-- --></a></X></1C>\')}4(h.16!=\'1J\'){$(f.3.l).1E(5(){4(f.r==8){1l()}}).1F(5(){4(f.r==8){1H()}})}4(!h.1K){17()}}5 26(){4(f.1e==8){4(h.1K){4(h.1L==\'2f\'){$.2V({2W:h.2g,2X:8,2Y:h.1L,2Z:m,30:5(b){1M=0;F(n a=0;a<b.q.Q;a++){4(b.q[a].18==\'31\'){1o=b.q[a]}}F(n i=0;i<1o.q.Q;i++){4(1o.q[i].18==\'32\'){1p=1o.q[i]}}F(n x=0;x<1p.q.Q;x++){4(1p.q[x].18==\'G\'){Y=1p.q[x];n c,Z=8;F(n y=0;y<Y.q.Q;y++){4(Y.q[y].18==\'1f\'){c=Y.q[y].2h.2i}7 4(Y.q[y].18==\'Z\'){Z=Y.q[y].2h.2i}4((c!==8&&c!=\'\')&&Z!==8){f.o[\'G-\'+1M]={u:h.1N,A:\'<a 1n="\'+Z+\'">\'+c+\'</a>\'};1M++;c=8;Z=8}}}}4(V(f.o<1)){U(\'2j\\\'t C 1O A 33 19 34 35 F 19 6 1P 1i!\');D 8}f.1e=m;17()}})}7{U(\'36 37!\')}}7 4(h.1A){4($(j+\' 2k\').Q>0){$(j+\' 2k\').1X(5(i){f.o[\'G-\'+i]={u:h.1N,A:$(P).O()}})}7{U(\'2j\\\'t C 38 1O A F 19 6 1P 1i!\');D 8}}7{U(\'39 6 3a 3b 1P 1t 1i 1O 3c 1B A! 3d 19 3e F 19 6.\');D 8}}}5 17(){f.1e=m;$(f.3.T).O(f.o[\'G-\'+f.9].u);$(f.3.l).O(f.o[\'G-\'+f.9].A);4(f.9==(V(f.o)-1)){f.9=0}7{f.9++}12=$(f.3.l).2l();1v=12/h.2m;2n()}5 2n(){$(f.3.l).1a(\'3f\',\'1\');4(f.H){n a=$(f.3.13).2l()+20;$(f.3.s).1a(h.B,a+\'1b\');4(h.16==\'1J\'){$(f.3.s).N(0,5(){$(f.3.l).1a(h.B,a+\'1b\').3g(h.2o,1q)})}7 4(h.16==\'3h\'){}7{$(f.3.L).11(0,5(){$(f.3.l).1a(h.B,a+\'1b\').11();2p=h.B==\'23\'?{3i:12+\'1b\'}:{3j:12+\'1b\'};$(f.3.s).1a(\'3k-\'+h.B,\'3l\').2q(20).3m(2p,1v,\'3n\',1q)})}}7{D 8}};5 1q(){4(f.H){$(f.3.l).2q(h.2r).1Q(h.1r);4(h.16==\'1J\'){$(f.3.l).1Q(h.1r,5(){$(f.3.E).C(f.3.L+\',\'+f.3.l).N().1c().C(f.3.K+\',\'+f.3.s).11().1c().C(f.3.K+\',\'+f.3.s).2s(\'2t\');17()})}7{$(f.3.s).N(0,5(){$(f.3.l).1Q(h.1r,5(){$(f.3.E).C(f.3.L+\',\'+f.3.l).N().1c().C(f.3.K+\',\'+f.3.s).11().1c().C(f.3.K+\',\'+f.3.s).2s(\'2t\');17()})})}}7{$(f.3.L).N()}}5 1l(){f.H=8;$(f.3.K+\',\'+f.3.s+\',\'+f.3.13+\',\'+f.3.T+\',\'+f.3.L+\',\'+f.3.l).3o(m,m);$(f.3.s+\',\'+f.3.L).N();$(f.3.E).C(f.3.13+\',\'+f.3.T).11().1c().C(f.3.l).11()}5 1H(){f.H=m;f.r=8;1q()}5 1G(a){1l();2c(a){14\'1g\':4(f.9==0){f.9=V(f.o)-2}7 4(f.9==1){f.9=V(f.o)-1}7{f.9=f.9-2}$(f.3.T).O(f.o[\'G-\'+f.9].u);$(f.3.l).O(f.o[\'G-\'+f.9].A);15;14\'1h\':$(f.3.T).O(f.o[\'G-\'+f.9].u);$(f.3.l).O(f.o[\'G-\'+f.9].A);15}4(f.9==(V(f.o)-1)){f.9=0}7{f.9++}}})};$.1s.6.1R={2m:0.10,1K:8,2g:\'\',1L:\'2f\',16:\'3p\',1A:m,25:m,z:m,1N:\'3q\',B:\'3r\',2r:3s,2o:3t,1r:3u}})(3v);',62,218,'|||dom|if|function|ticker|else|false|position||||||||||||contentID|true|var|newsArr||childNodes|paused|revealID||type|replace|id|||controls|content|direction|find|return|wrapperID|for|item|play|div|class|tickerID|revealElem|playPauseID|hide|html|this|length|window|console|titleElem|debugError|countSize|addClass|li|xmlItems|link||show|distance|titleID|case|break|displayType|setupContentAndTriggerDisplay|nodeName|the|css|px|end|log|contentLoaded|title|prev|next|use|span|removeClass|pauseTicker|hasClass|href|xmlContent|xmlChannel|postReveal|fadeOutSpeed|fn|not|in|time|swipe|controlsID|prevID|nextID|htmlFeed|of|ul|key|mouseover|mouseout|manualChangeContent|restartTicker|jnt|fade|ajaxFeed|feedType|count|titleText|any|to|fadeOut|defaults|Element|does|exist|DOM|alert|each|getUniqID|SPAN||wrapper|pause|right|initialisePage|debugMode|processContent|append|js|click|mousedown|mouseup|switch|over|down|xml|feedUrl|lastChild|nodeValue|Couldn|LI|width|speed|revealContent|fadeInSpeed|animationAction|delay|pauseOnItems|removeAttr|style|extend|attr|get|tagName|UL|OL|Cannot|toLowerCase|element|plugin|must|or|ol|rtl|left|hasOwnProperty|new|Date|getTime|wrap|children|remove|no|has|tickerElem|live|target|ajax|url|cache|dataType|async|success|rss|channel|from|XML|feed|Code|Me|HTML|The|is|set|types|Check|settings|opacity|fadeIn|scroll|marginRight|marginLeft|margin|0px|animate|linear|stop|reveal|Latest|ltr|3000|600|300|jQuery'.split('|'),0,{}));
