var mmove=0;
$(document).ready(function(){
	$('.gallery').each(function(){
		$(this).find('.container').wrapInner('<div class="slide" />');
	});
	$('.gallery .arrow.right').click(function(){
		if(mmove==0){
			mmove=1;
			dx=$(this).parent('.gallery').find('.item').first().outerWidth(true);
			$(this).parent('.gallery').find('.slide').animate({left: '-'+dx+'px'},dx, function(){
				$(this).css('left',0);
				$(this).find('.item').first().insertAfter($(this).find('.item').last());
				mmove=0;
			});
		}
	});
	
	$('.gallery .arrow.left').click(function(){
		if(mmove==0){
			mmove=1;
			dx=$(this).parent('.gallery').find('.item').last().outerWidth(true);
			$(this).parent('.gallery').find('.slide').css('left','-'+dx+'px');
			$(this).parent('.gallery').find('.item').last().insertBefore($(this).parent('.gallery').find('.item').first());
			$(this).parent('.gallery').find('.slide').animate({left: '0'},dx, function(){mmove=0; });
		}
	});
	$('.main_map .city').mouseover(function(){
		$('.main_map .tooltip').css('left',$(this).css('left'));
		$('.main_map .tooltip').css('top',$(this).css('top'));
		$('.main_map .tooltip').text($(this).text());
		$('.main_map .tooltip').css('display','block');
		$(this).css('z-index',12);
	});
	$('.main_map .city').mouseout(function(){
		$('.main_map .tooltip').css('display','none');
		$(this).css('z-index',10);
	});
});

