$(document).ready(function() {
/*
$("a.register").fancybox({
		'transitionIn': 'none',
		'transitionOut': 'none',
		'overlayShow':true,
		'titleShow': false,
		'width':  	595,
		'height': 775,
		'autoDimensions': false,
		'showCloseButton'	: false
	});
	

	
	jQuery.validator.messages.required = "";
	jQuery.validator.messages.email = "";
	jQuery.validator.messages.number = "";
	jQuery.validator.messages.minlength = "";
	jQuery.validator.messages.maxlength = "";



var telC = new Array("603", " 604", " 605", " 730", " 731", " 732", " 733", " 734", " 735", " 736", " 737", " 738", " 739", " 601", " 602", " 606", " 607", " 720", " 721", " 722", " 723", " 724", " 725", " 726", " 727", " 728", " 729", " 608", " 773", "774", " 775", " 776", " 777");

function tc(myValue) {
	if(telC.join().indexOf(myValue)>=0) 
		return true;
	else 
		return false;
}


	$.validator.addMethod('phone', function(value) {
		return (tc(value.substring(0, 3)));
		}, '');
	
	
	$("#registraceform").validate({
		rules: {
			psc: {
                            required: true,
                            minlength: 5,
                            maxlength: 5,
                            number: true

                        },
			telefon: {
				  phone: true,
                            required: true
                            minlength: 9,
                            maxlength: 9,
                            number: true

                        }
		},
		
		invalidHandler: function(form, validator) {
			var errors = validator.numberOfInvalids();
			if (errors) {
				alert('Je nutno vyplnit všechna pole včetně prohlášení. \n\nE-mail ve tvaru jmeno@domena.xx.\nGSM Tel. č. musí být devítimístné číslo bez mezinárodní provolby.\nPSČ musí mít 5 čísel.');
			}
		},

		submitHandler: function(form, validator) {
			var formDate=new Date();
			var rok = parseInt($("#rok").val())+18;
			var mesic = $("#mesic").val();
			var den = $("#den").val();
			formDate.setFullYear(rok,mesic-1,den);
			var today = new Date();
				
			if (formDate<today){
				$.fancybox.showActivity();
			
				$.ajax({
					type		: "POST",
					cache	: false,
					url		: "sablona/registrace.php",
					data		: $(form).serializeArray(),
					success: function(data) {
						$.fancybox(data);
						$('#registraceform').get(0).reset()
					}
				});
			}else{
				alert("Dle zadaného data narození není Váš věk větší než 18 let!");
			}
		}
	});
*/		
	$("a.remove").fancybox({
		'transitionIn': 'none',
		'transitionOut': 'none',
		'overlayShow':true,
		'titleShow': false,
		'width':  	495,
		'height': 185,
		'autoDimensions': false,
		'showCloseButton'	: false
	});
	
	$("#ano").click(function() {
			$.fancybox.showActivity();
		
			$.ajax({
				type		: "POST",
				cache	: false,
				url		: "sablona/odhlaseni.php",
				data		: $("#odhlaseniform").serializeArray(),
				success: function(data) {
					$.fancybox(data);
				}
			});
		
			return false;
			
	});	
	
	
});

