
function listChange(name,type)
{
	if(type=='city')
	{
		$('#cityNameSpan').html(name);
		$(".h1_metro").html('<br /><br /><h1>Все фитнес-клубы г. '+name+'</h1><br /><br />');
		document.title='Все фитнес-клубы г. '+name;
		curr_okrug="";
		$('#okrugNameSpan').html("Округ");
		 curr_metro="";
		$('#metroNameSpan').html("Метро");
	}
	if(type=='okrug')
	{
		$('#okrugNameSpan').html(name);
		document.title='Фитнес-клубы, '+name+' округ';
		$(".h1_metro").html('<br /><br /><h1>Фитнес-клубы, '+name+' округ</h1><br /><br />');
		//curr_metro=""
		curr_city=0;
		curr_metro="";
		$('#metroNameSpan').html("Метро");
		$('#cityNameSpan').html("Москва");
	}
	if(type=='metro')
	{
		$('#metroNameSpan').html(name);
		document.title="фитнес м. "+name+", фитнес-клуб м. "+name+", фитнес-клубы м. "+name+", фитнес-клубы на м. "+name+", фитнес на метро "+name;
		$(".h1_metro").html('<br /><br /><h1>Все фитнес-клубы на м. '+name+'</h1><br /><br />');
		curr_city=0;
		curr_okrug="";
		$('#cityNameSpan').html("Москва");
	}
	
	 if($('#poolChB').attr('checked'))
	   {
		   isPool=1;
	   }
	   else
	   {
		   isPool=0;
	   }
	  
	   if($('#24hChB').attr('checked'))
	   {
		   is24Ch=1;
	   }
	   else
	   {
		   is24Ch=0;
	   }
	    $('#loadImg').css('display','block');
		$.post("/ajax/ajaxListClubs.php", 
		{    o : "listChange",
			 isPool: isPool,
			 is24Ch: is24Ch,
			 curr_city: curr_city,
			 curr_okrug: curr_okrug,
			 curr_metro: curr_metro,
			 name_metro: name,
			 type: type
			}, function(data){ 
				//alert('sdf');
				//alert(data);
				data=eval(data);
				//alert(data[5]);
				$('#listClubContainer').html(data[0]);
				$('#pages_block').html(data[1]);
				$('#clubsCount').html(data[2]);
				$('#arrPrevContainer').html(data[3]);
				$('#arrNextContainer').html(data[4]);
				if(data[5]!='') $('#okrugNameSpan').html(data[5]);
				//$('#search-engines3_ul').html(data[5]);
				//$('#search-engines2_ul').html(data[6]);
			  /* $('#flat2').menu({ 
			content: $('#flat2').next().html(), // grab content from this page
			showSpeed: 400 
		});    */
			/*	$('#flat3').menu({ 
			content: $('#flat3').next().html(), // grab content from this page
			showSpeed: 400 
		});    */
				$('#loadImg').css('display','none');
			    checkedImgBorder();
		});
		
}

function change_pic(id,file_name,block_id)
{
	$('#bigPhoto'+block_id).attr('src','/upload/club_photo/'+id+'/'+file_name);	
}