function onChangeHandlers(val) {
	window.location.href = '?club_id=' + val;
}

$(document).ready(function() {

    $i = 0;

	$('.zamok-popup').hide();
	$('.zamok-popup-save').hide();
	
	$('.zamok').mouseover( function() {
		$('.zamok').toggleClass('zamok-clr').click( function() {
			//$('.zamok-popup').hide();
			$('.zamok-popup-save').show();

			var club_name = $('form[name=sel_metro] span.jquery-selectbox-currentItem').text();
			var club_id = $('form[name=sel_metro] option:contains(' + club_name + ')').attr('value');
			
			$.cookie('club_id', null);
			$.cookie("club_id", club_id, { path: '/' });
				
			//alert($.cookie("club_id"));
			//alert(city_id);
		
			//$.post(
			//	"/", 
			//	{
			//		club_id: city_id
			//	},
			//	function(data) {
			//		//alert("Data Loaded: " + data);
			//	}
			//);
		});

		//$('.zamok-popup').show();
		}).mouseout( function (){
		$('.zamok').toggleClass('zamok-clr');
		//$('.zamok-popup').hide();		
		$('.zamok-popup-save').hide();		
	});
	
	$('div.block-selectors').hover(
		function(){
			if ($i == 0) {
				$('.zamok-popup').show();
				$i = $i + 1;
			}
		},
		function(){
			$('.zamok-popup').hide();
		}
	);
	
	$('.zamok-popup').click(function(){
		$(this).hide();
	});
	


	
	
	

	

	$('.popup-enter').hide();							 
	$('.open-popup-enter').click( function() {
		$('.popup-enter').toggle();							 
	});
	
	$('#slider').anythingSlider({
		width               : 640,   // if resizeContent is false, this is the default width if panel size is not defined
		height              : 300,   // if resizeContent is false, this is the default height if panel size is not defined
		animationTime: 1000,
		delay:6000,
		easing:"swing",
        //startText:"Start",
        //stopText:"Stop",
		autoPlay:true,
        //pauseOnHover:true,
        stopAtEnd:false,
        resizeContents      : false, // If true, solitary images/objects in the panel will expand to fit the viewport
		//startStopped        : true,  // If autoPlay is on, this can force it to start stopped
		navigationFormatter : function(index, panel){ // Format navigation labels with text
			//return ['Сердечный фитнес', 'Друзья приносят удачу', 'Лыжные сборы', 'Скидки на мульти-<br />карты весь январь'][index - 1];
			return arElem[index - 1];//берется из хедера шаблона, генерируется через элементы ИБ
		}
	});
	
	$("select.select-decor").selectbox();


	$('input.click_empty').click(function(){
		$cur_field_val = $(this).attr('value');
		$(this).attr('value', '');
	});
	
	$('input.click_empty').focusout(function(){
		if ($(this).attr('value') == '') {
			$(this).attr('value', $cur_field_val);
		}
	});


	//$('.scroll-pane').jScrollPane({ scrollbarWidth:6, dragMinHeight: 70, dragMaxHeight:70, showArrows:false});
	
	$('.scrollbox-gr').hide();
	
	/*$('.box-close .key').click( function () {
		$(this).parent().toggleClass('box-close').toggleClass('box-open');
		$('.scrollbox-gr').fadeOut();
		$(this).parent().next('.scrollbox-gr').fadeIn();
		
	});
	
	$('.box-open .key').click( function () {
		$(this).parent().toggleClass('box-close').toggleClass('box-open');
		$(this).parent().next('.scrollbox-gr').fadeOut();
	});*/
	
	$('.box-close').click( function () {
		$(this).parent().removeClass('box-close').addClass('box-open');
	});
	
 $('#scrollbar1').tinyscrollbar();
 $("#menu li.m-dropdown").hover(function(){
     $(".b-dropdown").css("visibility","visible");
     $(".b-dropdown h2 *").css("visibility","visible");
 },
 function(){
     $(".b-dropdown").css("visibility","hidden");
     $(".b-dropdown h2 *").css("visibility","hidden");
 });
	

});







