var resultArr = new Array();
	resultArr[0]=[];
	resultArr[1]=[];
	resultArr[2]=[];
	resultArr[0]['id']='null';
	
	$(document).ready(function(){
		
		$("a[rel^='prettyPhoto']").prettyPhoto({theme:'light_square', showTitle:true, animationSpeed:'fast', allowresize:true});
		$("dd").hide();
		$("dt a").click(function(){
			$("dd:visible").slideUp("slow");
			$(this).parent().next().slideDown("slow");
			return false;
		});
		fixPNG(document.getElementById('loc_name1'));
		
		$("#loc_name1").autocomplete("/answer.php", {
		      delay:1000,
			  minChars:2,
		      matchSubset:1,
		      autoFill:true,
		      matchContains:1,
		      cacheLength:50,
		      selectFirst:true,
		      maxItemsToShow:50,
		      formatItem:formatcity,
		      onItemSelect:search_loc,
	      inputClass:'ac_input',
	      loadingClass:'ac_loading',
		      extraParams:{data:"city",step:"1"}
	     });
	     
	     function search_loc(li){
	     	if (li!=null){
	     		if (li.extra[1]=='-1') { //совпадений не найдено
	     			$('#loc_name1').val('');
	     			return false;
	     		}
	     		if(li.extra[11] != '' && parseInt(li.extra[1]) > 0) {
	     			top.location.href='/'+li.extra[11]+'_'+li.extra[1]+'_c.html#info';
	     		} else if(parseInt(li.extra[1]) > 0) {
	     			top.location.href='/index.php?city_id='+li.extra[1]+'#info';
	     		}
	     	}
	     }
	});
