 $(document).ready(function(){
   $("#b_o_nas").click(function(event){
     window.location.href = 'http://' + window.location.hostname;
   });
   $("#b_dojazd").click(function(event){
     window.location.href = 'http://' + window.location.hostname + '/index.php?p=dojazd';
   });
   $("#b_cennik").click(function(event){
     window.location.href = 'http://' + window.location.hostname + '/index.php?p=cennik';
   });
   $("#b_kontakt").click(function(event){
     window.location.href = 'http://' + window.location.hostname + '/index.php?p=kontakt';
   });
   $("#b_galeria").click(function(event){
     window.location.href = 'http://' + window.location.hostname + '/index.php?p=galeria';
   });


	// validate signup form on keyup and submit
	$("#form").validate({
		rules: {
			firstname: "required",
			lastname: "required",
			username: {
				required: true,
				minlength: 2
			},
			password: {
				required: true,
				minlength: 5
			},
			confirm_password: {
				required: true,
				minlength: 5,
				equalTo: "#password"
			},
			email: {
				required: true,
				email: true
			},
			topic: {
				required: "#newsletter:checked",
				minlength: 2
			},
			agree: "required"
		},
		messages: {
			firstname: "Please enter your firstname",
			lastname: "Please enter your lastname",
			username: {
				required: "Please enter a username",
				minlength: "Your username must consist of at least 2 characters"
			},
			password: {
				required: "Please provide a password",
				minlength: "Your password must be at least 5 characters long"
			},
			confirm_password: {
				required: "Please provide a password",
				minlength: "Your password must be at least 5 characters long",
				equalTo: "Please enter the same password as above"
			},
			email: "Please enter a valid email address",
			agree: "Please accept our policy"
		}
	});


 });




