		$(document).ready(function(){
			$("img[@id='sliderButton']").click(function() {
				$("div[@id='search']").slideToggle("slow");
				if($("div[@id='search']").css({display:"hidden"}))
					$("div[@id='mapa_slika']").hide();
				else
					$("div[@id='mapa_slika']").show();
			});
		});
		function enableSelect(check,what) {
			var selectedField = document.getElementById(check);
			var selectedOption = selectedField.options[selectedField.selectedIndex].value;
			if(selectedOption!='-') {
				$("select[@id='"+what+"']").attr("disabled", false);
			}
		}
		function fillAreas () {
			var selectedField = document.getElementById('id_city');
			var selectedOption = selectedField.options[selectedField.selectedIndex].value;
			if(selectedOption!='-') {
				$("div[@id='allAreas']").text('');
				$("div[@id='areas']").show();
				$("div[@id='allAreas']").show();
				$("div[@id='mapa_slika']").show();
			}
		}
		function showButton() {
			$("div[@id='button-submit']").show();
		}
		
		function enableOneSelect(what) {
			$("select[@id='"+what+"']").attr("disabled", false);
		}
		function showAllOtherFields() {
			var selectRent = document.getElementById("rent_sale");
			var selectedRentOption = selectRent.options[selectRent.selectedIndex].value;
			var selectBuilding = document.getElementById("id_building_type");
			var selectedBuildingOption = selectBuilding.options[selectBuilding.selectedIndex].value;
			if(selectedRentOption!='-'&&selectedBuildingOption!='-') {
				if(selectedRentOption=='1') {
					if(selectedBuildingOption=='7'||selectedBuildingOption=='2') {
						if(selectedBuildingOption=='7')
							$("div[@id='residental-rent']").show();
						else
							$("div[@id='commercial-rent']").show();
						$("div[@id='max-rent-price']").show();
						$("div[@id='min-no-rooms']").show();
						$("div[@id='min-size']").show();
						showButton();
					}
					if(selectedBuildingOption=='1'||selectedBuildingOption=='3'||selectedBuildingOption=='4'||selectedBuildingOption=='6') {
						showButton();
					}
					if(selectedBuildingOption=='5') {
						$("div[@id='project-rent']").show();
					}
				}
				if(selectedRentOption=='2') {
					if(selectedBuildingOption=='7'||selectedBuildingOption=='2'||selectedBuildingOption=='5') {
						$("div[@id='residental-rent']").show();
						$("div[@id='max-buy-price']").show();
						$("div[@id='min-no-rooms']").show();
						$("div[@id='min-size']").show();
						showButton();
					}
					else showButton();
				}
				if(selectedRentOption=='3') {
					if(selectedBuildingOption=='1'||selectedBuildingOption=='2'||selectedBuildingOption=='3'||selectedBuildingOption=='4'||selectedBuildingOption=='5'||selectedBuildingOption=='6'||selectedBuildingOption=='7') {
						showButton();
					}
				}
			}
		}
		function hideAll() {
			$("div[@id='residental-rent']").hide();
			$("div[@id='commercial-rent']").hide();
			$("div[@id='max-rent-price']").hide();
			$("div[@id='max-buy-price']").hide();
			$("div[@id='min-no-rooms']").hide();
			$("div[@id='min-size']").hide();
			$("div[@id='areas']").hide();
			$("div[@id='project-rent']").hide();
			$("div[@id='button-submit']").hide();
			$("select[@id='id_city']").attr("disabled", true);
			$("select[@id='id_area']").attr("disabled", true);
			$("select[@id='id_building_type']").attr("disabled", true);
			var selectBuilding = document.getElementById("id_city").selectedIndex = -0;
			var selectBuilding = document.getElementById("id_building_type").selectedIndex = -0;
		}
		function hideSome() {
			$("div[@id='residental-rent']").hide();
			$("div[@id='commercial-rent']").hide();
			$("div[@id='max-rent-price']").hide();
			$("div[@id='max-buy-price']").hide();
			$("div[@id='min-no-rooms']").hide();
			$("div[@id='min-size']").hide();
			$("div[@id='project-rent']").hide();
		}
		function getQueryVariable(variable) {
			var query = window.location.search.substring(1);
			var vars = query.split("&");
			for (var i=0;i<vars.length;i++) {
				var pair = vars[i].split("=");
				if (pair[0] == variable) {
					return pair[1];
				}
			}
			alert('Query Variable ' + variable + ' not found');
		}
		function switchImage(sta,cime) {
			document.getElementById(sta).src = '/images/'+cime+'.gif';
		}