function CheckForm_alt(form) {
	//alert(form.f_alt_data[1].checked);
	if(form.f_alt_data[1].checked) {
		if (form.f_nazwa.value.length < 1) {
				form.f_nazwa.focus(); alert('Podaj [nazwę / imię i nazwisko].');
				return false;
		}
		if (form.f_adres.value.length < 1) {
			form.f_adres.focus(); alert('Podaj [adres].'); 
			return false;
		}
		if (form.f_nip.value.length < 1) {
			form.f_nip.focus(); alert('Podaj [NIP].');
			return false;
		}	
		else {
			return true;
		}
	} else {
		return true;
	}
}


function CheckForm1(form) { //checkuj formy z polami temat, email, tresc
	//alert('weqweqweweqwe');
	if (form.temat.value.length < 1) {
			form.temat.focus(); alert('Podaj [temat].');
			return false;
	}
	if (form.email.value.length < 1) {
		form.email.focus(); alert('Pole [e-mail] nie zostało wypełnione.'); 
		return false;
	}
	if(form.email.value.length > 0) {
		Wzor=/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.(([0-9]{1,3})|([a-zA-Z]{2,3})|(aero|coop|info|museum|name))$/;
		OK=(Wzor.test(form.email.value)==true); 
		if (OK){}
		else{
			alert('Pole [e-mail] zawiera nieprawidłowe dane!');
			return false;
		}
	}
	if (form.tresc.value.length < 1) {
		form.tresc.focus(); 
		alert('Podaj [treść].');
		return false;
	}	
	else {
		return true;
	}
}

function CheckForm(form) { //sprawdzanie nazwy i kategorii w dodawniau edytowaniu kancelarii

	if (form.f_title.value.length < 1) {

		form.f_title.focus(); alert('Podaj [nazwa kancelarii]');
		return false;
	} 
	if (form.f_nip.value.length < 1) {

		form.f_nip.focus(); alert('Podaj [NIP]');
		return false;
	}
	if (form.f_kat.value.length < 2) {
		form.f_kat.focus(); alert('Podaj [kategorie].');
		return false;
	} else {
		return true;
	}
}

function Confirm(text,location)
			{if (confirm(text)) parent.location.href=location;}

function idz(gdzie,form) {
	poskladany_link = gdzie+'?nameform='+form.name+'&kategorie='+form.f_kat.value+'';
	window.open(poskladany_link,'Wybierz','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=0,width=500,height=500');
}

function idz2(gdzie,form) {
	//var firma = document.getElementById(tinyMCE.getInstanceById('mce_editor_0').formTargetElementId).value; //chuj
	
	//alert(firma);
	
	poskladany_link = gdzie+'?nameform='+form.name+'&f_title='+form.f_title.value+'&f_adres='+form.f_adres.value+'&f_tel='+form.f_tel.value+'&f_fax='+form.f_fax.value+'&f_godz='+form.f_godz_pn.value+'%%;%%'+form.f_godz_wt.value+'%%;%%'+form.f_godz_sr.value+'%%;%%'+form.f_godz_cz.value+'%%;%%'+form.f_godz_pt.value+'%%;%%'+form.f_godz_so.value+'%%;%%'+form.f_godz_nd.value+'&f_www='+form.f_www.value+'&f_email='+form.f_email.value+'&f_rok='+form.f_rok.value+'&f_formap='+form.f_formap.value+'&ff_inf_zatrudnienie='+form.ff_inf_zatrudnienie.value+'&ff_inf_organizacja='+form.ff_inf_organizacja.value+'&ff_uslugi='+form.ff_uslugi.value+'&ff_firma='+form.ff_firma.value+'&f_ustalenia='+form.f_ustalenia.value+'&ff_partner='+form.ff_partner.value+'&f_klienci_liczba='+form.f_klienci_liczba.value+'&f_maps='+form.f_maps.value+'';
	
	window.open(gdzie,'Podgląd','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=1000,height=600');
}