$(document).ready(function() {
	
	$("input").uniform();
	
	$("#js_info").hide();
	
	/*
	if ($("#valid").val() == "1") {
		$("#step_2").fadeIn(1000);
	} else {
		$("#step_1").fadeIn(1000);
	}
	*/
	
	
	$("#miasto").change(function(){
		if ($(this).val() != "Inne") {
			$("#miasto_inne_container").removeClass().addClass('miasto_inne_container_hidden');
		}
		if ($(this).val() == "Inne") {
			$("#miasto_inne_container").removeClass().addClass('miasto_inne_container_visible');
		} 
	});
	/*
	$("input[name=pytanie_1_n_1]").change(function(){
		if ($(this).val() == "tak") {
			$("#pytanie_1_n_1_n_sub").hide();
			$("#pytanie_1_n_1_t_sub").fadeIn(1000);
		}
		if ($(this).val() == "nie") {
			$("#pytanie_1_n_1_t_sub").hide();
			$("#pytanie_1_n_1_n_sub").fadeIn(1000);
		} 
	});
	*/
	/*
	$("input[name=pytanie_3_1]").change(function(){
		if ($(this).val() == "inne") {
			$("#pytanie_3_1_inne").fadeIn(1000);
		} else {
			$("#pytanie_3_1_inne").hide();
		}
	});

	$("input[name=pytanie_6]").change(function(){
		if ($(this).val() == "inne") {
			$("#pytanie_6_inne").fadeIn(1000);
		} else {
			$("#pytanie_6_inne").hide();
		}
	});
	*/
	$("select[name=miasto]").change(function(){
		if ($(this).val() == "inne") {
			$("#inne_miasto").fadeIn(1000);
		} else {
			$("#inne_miasto").hide();
		}
	});
	$('#back0').bind('click',function(e){
		document.location='index.php';
		e.preventDefault();
		
	});
	$('#back1').bind('click',function(e){
		document.location='page1.php';
		e.preventDefault();
		
	});
	/*
	$("ul.form li input").focus(function(){
		$(this).parentsUntil("ul").css("background-color", "#f1f1f1");
	});

	$("ul.form li input").blur(function(){
		$(this).parentsUntil("ul").css("background-color", "#fff");
	});
	
	$("ul.form li select").focus(function(){
		$(this).parentsUntil("ul").css("background-color", "#f6f6f6");
	});

	$("ul.form li select").blur(function(){
		$(this).parentsUntil("ul").css("background-color", "#fff");
	});
	*/
	/*
	$(document).ready(function() {
		$("#formularz").validationEngine({
			success :  function() { callSuccessFunction() },
			failure : function() { callFailFunction() }
		});
	});
*/
	//$("#formularz").submit(function(e){
	//	return false;
	//});
	//$("#form_submit").bind('click',function(e){
	//	e.preventDefault();
	//	
	//});
	//$("input[type=radio]").change(function() {
		//$(".formError").hide();
	//});
});

/*
function callFailFunction(e) {
	
}

function callSuccessFunction() {
	$("#step_1").fadeOut(500);
	$("#step_2").fadeIn(500);
	$("#valid").attr("value", "1");
}

function validate31() {
	if ($("#pytanie_3_tak:checked").size() == 1) {
		if ($("input[name=pytanie_3_1]:checked").size() > 0) {
			return false;
		} else {
			return true;
		}
	} else {
		return false;
	}
}
function validate31inne() {
	if ($("#pytanie_3_tak:checked").size() == 1) {
		if ($("#pytanie_3_1_d:checked").size() > 0) {
			if ($("#pytanie_3_1_inne_val").val() == "") {
				return true;
			} else {
				return false;
			}
		} else {
			return false;
		}
	} else {
		return false;
	}
}
function validateStep2() {
	if ($("#valid").val() == "0") {
		return false;
	} else {
		return true;
	}
}
function validateInneMiasto() {
	if ($("#miasto").val() == "inne") {
		if ($("#miasto_inne").val() == "") {
			return false;
		} else {
			return true;
		}
	} else {
		return false;
	}
}
*/

