// JavaScript Document
var curId = 0;
var st = 0;
function OpenItem(url, width, height) {
	
        window.open(url, '','');
	return false;
	
	var rnd = (Math.round((Math.random()*999)+1));
	var top=Math.round((screen.height-height)/2);
	var left=Math.round((screen.width-width)/2);
	var wnd=this.open(url, "elit"+rnd, "top="+top+",left="+left+",width="+width+",height="+height+",buttons=no,scrollbars=yes,location=no,menubar=no,resizable=no,status=no,directories=no,toolbar=no");
	wnd.focus();
}


$(window).resize(function(){
	if( $(window).width() > 1280 )
	{
		
			$('#s1').css( {
						 'position': 'absolute',
						 'left' : $('#container').offset().left-6,
						 'display' : 'block',
						 'height' : $('#container').height()
						 });
			
			$('#s2').css( {
						 'position': 'absolute',
						 'left' : $('#container').offset().left + $('#container').width(),
						 'display' : 'block',
						 'height' : $('#container').height()
						 });
		
	}else
	{
		$('#s1').css( 'display', 'none' );
		$('#s2').css( 'display', 'none' );
	}
					 
});

$(document).ready(function(){
			
	
	
	if( $.browser.msie )
	{
			document.getElementById('container').style.width = ((document.documentElement.clientWidth || document.body.clientWidth) < 1000) ? '1000px' : ((document.body.clientWidth > 1280) ? '1280px' : '100%');
			
	}
	

	if( $('#aboutc').length )
	{
		$('a.zoom2').fancybox({
				'zoomSpeedIn'		:	500,
				'zoomSpeedOut'		:	500,
				'overlayShow'		:	false
			});
	}

  // выпадающий список под ссылкой
	if( $.browser.opera == true )
	{
		/*$('#choosen_city').css('padding-top',0);*/
		if( $('#cat_search_box1').length )
		{
                    if( $('#mainpage').length )
				$('#cat_search_box1').css( 'padding-top', '0px' );
                            else
                                $('#cat_search_box1').css( 'padding-top', '3px' );
		}
	}
	
	da = 1;
			$('#toggler').click(function(e) {
										 	da=1
				x = 0;
				if( $.browser.mozilla == true )
					x = 35;
				if( $.browser.msie == true )
					x = 35;
				if( $.browser.opera == true )
					x = 35;
				
				$('#drop-down-list').css({
					'position' 	: 'absolute',
					'top' 		: ($('#toggler').offset().top) + x + 'px',
					'left' 		: ($('#toggler').offset().left + 10) + 'px'
				});
				if( $('#drop-down-list').is( ':visible') ) $('#drop-down-list').hide(); else	$('#drop-down-list').show();
				$('#drop-down-list').focus();
				
			});
			
			
			$('#drop-down-list').mousemove(function() {
							
				da=1;
			});
			
			$('#drop-down-list').mouseout(function() {
							
				da=0;
			});
			
			$('#drop-down-list').blur(function() {
							
				if( da==0) $('#drop-down-list').hide();
			});
			
			$(document).click(function() {
				if( (da==0) && ( $('#drop-down-list').is( ':visible'))) 
				{;$('#drop-down-list').hide();}
									   }
			);
			
			
			
			
	
	
	
	
	
	
	$('#cats_list a, #cats_list span').mousemove(function(e){
		$('#swimming_block ul').hide();
		u = $(this).attr( 'id' );
		u = '#u'+u;
		$(u).show();
		$('#swimming_block').css({
							'position' : 'absolute',
							  'top' : ($(this).offset().top) + 'px',
							  'left' : ($('#cats_list').offset().left +200) + 'px'
							  });
				/*if(!$('#swimming_block').is(':visible')) $('#swimming_block').fadeIn('fast');*/
				
				$('#swimming_block').fadeIn('fast');
				
			
				
		
		
	});
	
	if( $('#cur_cat').length )
	{
		id = $('#cur_cat').val();
		
		if( id != 0 )
		{
			curId = id;
		$('#u'+id).show();
		$('#swimming_block').css({
								'position' : 'absolute',
							  'top' : ($('#'+id).offset().top) + 'px',
							  'left' : ($('#cats_list').offset().left +200) + 'px'
							  });
				/*if(!$('#swimming_block').is(':visible')) $('#swimming_block').fadeIn('fast');*/
				
		$('#swimming_block').fadeIn('fast');
		}
		
		
	}
	$(window).resize();
	
	
	

});



