$(document).ready(function() {
	$("div.content_download a").each(function() {
		var eee = $(this).attr('href')
		$(this).css('background-image','url(/'+eee.substr(1,eee.length-4)+'jpg)')
	})
	$("div.content_download a").click(function() {
		window.open($(this).attr('href'));
		return false
	})
	/*$('div#themen_auswahl h2').prepend('-> ');
	$('div#themen_auswahl h2').hover(function() { $(this).css("cursor","pointer") })
	$('div#themen_auswahl h2').click(function() {
		$('div#themen_auswahl ul').slideToggle();
	});
	$('div#themen_auswahl ul').hide();*/
	$('div.content_training input.cb').click(function() {
		if ($(this).attr('checked')) {
			$(this).parent().addClass('sel')
		}
		else {
			$(this).parent().removeClass('sel')
		}
	});
	$('#gallery a').lightBox();
	$('#gallery a:first-child').show();
	
	$('input[name=tk_variante]').click(function() {
		var v = $(this).val();
		var v2 = v == 'postweg' ? 'email' : 'postweg';
		$('p.p_'+v2).hide();
		$('p.p_'+v).show();
		var arr_txt_tkv = new Array();
		arr_txt_tkv['email'] = 'Ihre Email-Adresse';
		arr_txt_tkv['postweg'] = 'Postanschrift';
		$('span#txt_intro_daten').html(arr_txt_tkv[v]);
		$('label.error').removeClass('error');
	});
	$('form').submit(function() {
		var foc = false;
		$(':input',this).each(function() {
			if ($(this).is(':visible')) {
				var prev = $(this).prev().prev();
				if (prev.attr('alt') == 'pflicht') {
					var err = false;
					if ($(this).val() == false) { err = true }
					if (err == true) { if (foc == false) { this.focus(); foc = true } prev.attr('class','error') }
					else { prev.attr('class',''); }
				}
				var v = this.value;
			}
		})
		return foc == false ? true : false;
	})
})


