$(function()
{

	$('#Turnus').chainSelect('#Camp','/GetCamp.php',
	{ 
		
	});
	$('#Camp').chainSelect('#city','/GetCamp.php',
	{ 

	});
	 
	$('#Turnus').chainSelect2('#Camp','/GetCamp.php',
	{ 
		
	});
	$('#Camp').chainSelect2('#city','/GetCamp.php',
	{ 

	});
	
	$('#Miasto').chainSelect('#Uniwersytet','/GetUniv.php',
	{ 
	
		before:function (target) //before request hide the target combobox and display the loading message
		{ 
			
			$("#loading").css("display","block");
			$(target).css("display","none");
		},
		after:function (target) //after request show the target combobox and hide the loading message
		{ 
			
			$("#loading").css("display","none");
			$(target).css("display","inline");
		}
	});
	
	
	
	$('#Uniwersytet').chainSelect('#Facultet','/GetUniv.php',
	{ 
		before:function (target) 
		{ 
			$("#loading").css("display","block");
			$(target).css("display","none");
		},
		after:function (target) 
		{ 
			$("#loading").css("display","none");
			$(target).css("display","inline");
		}
	});
	
});






function Toggle(thediv) {
document.getElementById("div1").style.display = "none";
document.getElementById("div2").style.display = "none";
document.getElementById(thediv).style.display = "block"
$('#Miasto').removeClass(':required').addClass('');
$('#Uniwersytet').removeClass(':required').addClass('');
$('#Facultet').removeClass(':required').addClass('');
$('#Specialization').removeClass('input_normal :required').addClass('input_normal');
}

function Toggle2(thediv) {
document.getElementById("div5").style.display = "none";
document.getElementById("div6").style.display = "none";
document.getElementById(thediv).style.display = "block";
}

