function winOpenJpg(num,WindowName) {
	var WinWidth=450;
	var WinHeight=675;
	var Link='../popup/pop.php?num='+num+'&titel='+WindowName;
	window.open(Link,WindowName,'toolbar=0,width='+WinWidth+',height='+WinHeight+',location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,copyhistory=0');
}


function popUp(num) {
	var WinWidth=450;
	var WinHeight=675;
	var WindowName='popWin';
	var Link='../popup/pop'+num+'.html';
	window.open(Link,WindowName,'toolbar=0,width='+WinWidth+',height='+WinHeight+',location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,copyhistory=0');
}

function winOpen2Jpg(num,WindowName) {
	var WinWidth=675;
	var WinHeight=500;
	var Link='../popup/pop2.php?num='+num+'&titel='+WindowName;
	window.open(Link,WindowName,'toolbar=0,width='+WinWidth+',height='+WinHeight+',location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,copyhistory=0');
}

function popUp2(num) {
	var WinWidth=675;
	var WinHeight=500;
	var WindowName='popWin2';
	var Link='../popup/pop2'+num+'.html';
	window.open(Link,WindowName,'toolbar=0,width='+WinWidth+',height='+WinHeight+',location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,copyhistory=0');
}



$(document).ready(function() {
	$('#myTable input').attr('checked','');
	$('#myTable').tablesorter({sortList: [[2,0]], headers: { 0:{sorter: false}, 1:{sorter: false}}});
	$.ajaxSetup({ async:false });
	$("#form2").submit(function() {
		var challenge = $('#recaptcha_challenge_field').val();
		var response = $('#recaptcha_response_field').val();
		var ajax_passt = 0;
		$.post("verify.php", {recaptcha_response_field: response, recaptcha_challenge_field: challenge}, function(data) {
			if (data == 'ok')	{
				ajax_passt = 1;
			}
		});
		
		if (document.form2.secur.value != '') {
				alert('Sie sind kein Mensch.'); 
				return (false); 
			}
		
		if (document.form2.firma.value == '') {
				alert('Bitte geben Sie Ihre Firma an.'); 
    			document.form2.firma.focus(); 
				return (false); 
			}
			
		if (document.form2.vname.value == '') {
			alert('Bitte geben Sie Ihren Vornamen an.'); 
			document.form2.vname.focus(); 
			return (false); 
		}
												   
		if (document.form2.nname.value == '') {
			alert('Bitte geben Sie Ihren Nachnamen an.'); 
			document.form2.nname.focus(); 
			return (false); 
		}
		
		if (document.form2.anschrift.value == '') {
			alert('Bitte geben Sie Ihre Anschrift an.'); 
			document.form2.anschrift.focus(); 
			return (false); 
		}
												   
		if (document.form2.plz.value == '') {
			alert('Bitte geben Sie Ihre PLZ an.');
			document.form2.plz.focus(); 
			return (false);
		}    									             										   
											   
		if (document.form2.ort.value == '') {
			alert('Bitte geben Sie Ihr Ort an.'); 
			document.form2.ort.focus();
			return (false);
		}									   
		
		if (document.form2.land.value == '') {
			alert('Bitte geben Sie Ihr Land an.');
			document.form2.land.focus();
			return (false);
		}
		
		if (document.form2.email.value == '') {
			alert('Bitte geben Sie Ihre E-Mail-Adresse an.');
			document.form2.email.focus();
			return (false);
		}     
												   
		if (document.form2.tel.value == '') {
			alert('Bitte geben Sie Ihre Telefonnummer an.');
			document.form2.tel.focus();
			return (false);
		}
		
		if (ajax_passt == 0) {
			alert('Bitte geben Sie das Captcha korrekt ein.');
			return (false);
		}
		
		return true;
    });

	
	$('#interactive-map span').mouseover(function(){
		var id = $(this).attr('id').substr(5);
		$('#list_'+id+'').css({'color':'red'});
	});
	
	$('#interactive-map span').mouseout(function(){
		var id = $(this).attr('id').substr(5);
		$('#list_'+id+'').css({'color':''});
	});
	
	$('#interactive-map span').click(function(){
		var id = $(this).attr('id').substr(5);
		
		if ($('input#checkbox_list_'+id+'').hasClass('check')) {
			$('input#checkbox_list_'+id+'').attr('checked','').removeClass('check');
			$(this).css({'background-position':''});
		} else {
			$('input#checkbox_list_'+id+'').attr('checked','checked').addClass('check');
			$(this).css({'background-position':'0 0'});
		}
	});
	
	$('#myTable label').mouseover(function(){
		var id = $(this).attr('id').substr(5);
		$('span#bobel'+id+'').css({'background-position':'0 0'});
	});
	
	$('#myTable label').mouseout(function(){
		var id = $(this).attr('id').substr(5);
		if ($('input#checkbox_list_'+id+'').hasClass('check')) {
		} else {
			$('span#bobel'+id+'').css({'background-position':''});
		}
	});
	
	$('#myTable input').change(function() {
		var id = $(this).attr('id').substr(14);
		if ($(this).hasClass('check')) {
			$(this).removeClass('check');
			$('span#bobel'+id+'').css({'background-position':'-15px 0'});
		} else {
			$(this).addClass('check');
			$('span#bobel'+id+'').css({'background-position':'0 0'});
		}
	});
	
});



//-->
