$(function(){

	$('#worldmap .marker, #europemap .marker').each(function(){
		$(this).css({
			"top"  : $(this).find('.y').text() + "px",
			"left" : $(this).find('.x').text() + "px",
			"zIndex" : $(this).find('.z').text()
		});
	});

	$('.marker .label').prepend('<span class="arrow"></span>');

	$('#worldmap .marker, #europemap .marker').hover(function(){
		$(this).animate({opacity:.8});
		$(this).find('.label').fadeIn();
		$(this).css('zIndex', '1000');
	}, function(){
		$(this).animate({opacity:1});
		$(this).find('.label').fadeOut();
		$(this).css('zIndex', $(this).find('.z').text());
	});

	// europe
	$('#europemap').hide();
	$('.europe').click(function(){
		$('#worldmap').hide();
		$('#europemap').fadeIn();
		$('.store').show();
	});
	$('#europemap .back').click(function(){
		$('#europemap').hide();
		$('#worldmap').fadeIn();
	});

	// filtr sklepów



		$('.marker').not('.europe').click(function(){
			if($.browser.msie){
				//var klasa = (($(this).attr('class')).slice(7, -11)).toString();
				var klasa = (($(this).attr('class')).slice(7, 1000)).toString();
			} else {
				var klasa = (($(this).attr('class')).slice(7, 1000)).toString();
			}
			$('.store').show();
			$('.store').not(".store." + klasa).hide();
			$('.col h2').text('');
			$(this).find('.label').clone().prependTo('.col h2');


		});

}); // $() end
