$(function() {
			var search_menu = $('div.tabs > div');

			$('div.tabs ul.search_menu a').click(function() {
				var globalregion = $("#posted_region").val();
				var globallocation = $("#posted_location").val();
				search_menu.hide();
				search_menu.filter(this.hash).show();
				$('div.tabs ul.search_menu a').removeClass('selected');
				$(this).addClass('selected');
				$("#regions1 option[value =" + globalregion + "]").attr(
						"selected", "true");
				$("#regions2 option[value =" + globalregion + "]").attr(
						"selected", "true");
				$("#regions3 option[value =" + globalregion + "]").attr(
						"selected", "true");
				if (globalregion != 0) {
					$("#locations1").removeAttr("disabled")
							.html($("#regionslocations .sub_" + globalregion)
									.clone()).prepend("<option value=\"0\" selected=\"true\">...</option>");;
					$("#locations2").removeAttr("disabled")
							.html($("#regionslocations .sub_" + globalregion)
									.clone()).prepend("<option value=\"0\" selected=\"true\">...</option>");;
					$("#locations3").removeAttr("disabled")
							.html($("#regionslocations .sub_" + globalregion)
									.clone()).prepend("<option value=\"0\" selected=\"true\">...</option>");;
					$("#locations1 option[value =" + globallocation + "]")
							.attr("selected", "true");
					$("#locations2 option[value =" + globallocation + "]")
							.attr("selected", "true");
					$("#locations3 option[value =" + globallocation + "]")
							.attr("selected", "true");
				}

				if (globallocation != 0) {
					$("#locations1 option[value =" + globallocation + "]")
							.attr("selected", "true");
					$("#locations2 option[value =" + globallocation + "]")
							.attr("selected", "true");
					$("#locations3 option[value =" + globallocation + "]")
							.attr("selected", "true");
				}
				return false;
			});

			$("a[rel^='prettyPhoto']").prettyPhoto();

		});

