jQuery(function(){
jQuery('#oras1').change(function() {
//jQuery('#zone_mare').hide();
ajax_request('/pages/zone/'+ jQuery('#oras1').val() +'','zone');
//jQuery('#zone_mare').slideDown(2000);
$("#ac").autocomplete('/pages/zonesuggest/', { minChars:1, matchSubset:false, matchContains:false, cacheLength:10, onItemSelect:selectItem, formatItem:formatItem, selectOnly:1 });
}).change();
jQuery('#oras15').change(function() {
this.checked = true;
//jQuery('#zone_mare').hide();
ajax_request('/pages/zone/'+ jQuery('#oras15').val() +'','zone');
//jQuery('#zone_mare').slideDown(2000);
$("#ac").autocomplete('/pages/zonesuggest15/', { minChars:1, matchSubset:false, matchContains:false, cacheLength:10, onItemSelect:selectItem, formatItem:formatItem, selectOnly:1 });
});

jQuery('#arata_zone').click(function() {
jQuery('#zone_mare').slideDown(1000);
jQuery('#arata_zone').fadeOut(1000);
jQuery('#ascunde_zone').fadeIn(1000);
});

jQuery('#ascunde_zone').click(function() {
jQuery('#zone_mare').slideUp(1000);
jQuery('#ascunde_zone').fadeOut(1000);
jQuery('#arata_zone').fadeIn(1000);
});

});
// function update_zone(oras) {
// 	ajax_request('/pages/zone/'+ oras +'','zone');
// }

function selectItem(li) {
	if (li.extra) {
		alert("That's '" + li.extra[0] + "' you picked.")
	}
}
function formatItem(row) {
	return row[0] + "<br><i>" + row[1] + "</i>";
}
$(document).ready(function() {
	$("#ac").autocomplete("search.php", { minChars:3, matchSubset:1, matchContains:1, cacheLength:10, onItemSelect:selectItem, formatItem:formatItem, selectOnly:1 });
	//$("#ac_me2").autocomplete("search.php", { minChars:3, matchSubset:false, matchContains:false, cacheLength:10, onItemSelect:selectItem, formatItem:formatItem, selectOnly:1 });
});


$(function() {
	$('#gallery a').lightBox();
});