$(document).ready(function() {
	$('.btn_city').click(function() {
		
		$('.btn_city').removeClass('active');
		$(this).addClass('active');
		city = $(this).attr('alt');
		loadMap();
		return false
	});

	$('.btn_address').click(function() {
		
		$('.btn_address').removeClass('active');
		$(this).addClass('active');
		ind = $(this).index();
		
		$('#contact table').hide();
		$('#contact table').eq(ind).show();
		return false
	});

	$('.btn_city_map').click(function() {
		
		$('.btn_city_map').removeClass('active');
		$(this).addClass('active');
		city = $(this).attr('alt');
		loadMap();
		return false
	});

	$('#ajax').cycle({timeout: 5000});


	function loadShowData(msg)
	{
		$container.css('marginLeft', '-3000px').show().html(msg).css({'marginTop': $container.height()/-2});
		$container.css({'marginLeft': $container.width()/-2});
	}

	function loadMap()
	{
		$container = overlay();
		loadShowData('<div id="map"></div>');

		if(city==1)
		{
			map_long = 50.27032306236832;
			map_lat = 19.141380786895752;
		}
		else
		{
			map_long = 50.13374554270693;
			map_lat = 18.968453407287598;
		}
	 
		$('#map').jmap('init', {'mapType':'map','mapCenter':[map_long,map_lat], 'mapZoom':16});
		$('#map').jmap('AddMarker', {'pointLatLng': [map_long,map_lat]}); 
	 }
 

	$('.map').click(function() {
		city=1;
		loadMap();
		return false;
	});
	 


});

