function showGoogleMap(var_id,var_gps_x,var_gps_y,var_title,var_zoom)
{
	var myLatlng = new google.maps.LatLng(var_gps_x,var_gps_y);
	var myOptions = {
		zoom: var_zoom,
		center: myLatlng,
		mapTypeId: google.maps.MapTypeId.ROADMAP
	}
	var map = new google.maps.Map(document.getElementById(var_id), myOptions);
	
	if(var_title!=false)
	{
		var contentString = var_title;
      
		var infowindow = new google.maps.InfoWindow({
			content: contentString
		});
	}
	
	var marker = new google.maps.Marker({
		position: myLatlng,
		map: map
	});
	
	if(var_title!=false)
	{
		google.maps.event.addListener(marker, 'click', function() {
			infowindow.open(map,marker);
		});
	}
}
function show_cart()
{
	if(document.getElementById("query_menu").style.display=='none') document.getElementById("query_menu").style.display = '';
	else document.getElementById("query_menu").style.display = 'none';
}


$(function() {
	$("a.lightbox").fancybox({titlePosition:'over'});
	$('.img_hover').each(function() {
		$(this).hover(function() {
			$(this).stop().animate({ opacity: 0.6 }, 200);
			},
		function() {
			$(this).stop().animate({ opacity: 1.0 }, 500);
		});
	});
	$(".addToCart").click(function(){
		$.fancybox.showActivity();
		$.ajax({type:"POST",
				  cache:false,
				  url:$(this).attr("href"),
				  data:({ajax:1,addToCart:1,quantity:$('#quantity').val()}),
				  success:function(data) { $.fancybox(data,{'hideOnOverlayClick':false,'enableEscapeButton':false,'centerOnScroll':true,'showCloseButton':false}); }
				});
		return false;
	});
	$(".showRegulamin").click(function(){
		$.fancybox.showActivity();
		$.ajax({type:"POST",
				  cache:false,
				  url:$(this).attr("href"),
				  data:({showRegulamin:1}),
				  success:function(data) { $.fancybox(data,{'hideOnOverlayClick':false,'enableEscapeButton':false,'centerOnScroll':true}); }
				});
		return false;
	});
	$.fn.clearDefault = function(){
		return this.each(function(){
			var default_value = $(this).val();
			$(this).focus(function(){
				if ($(this).val() == default_value) $(this).val("");
			});
			$(this).blur(function(){
				if ($(this).val() == "") $(this).val(default_value);
			});
		});
	};
	$('.dynamic').clearDefault();
	$('#show_photo').click(function(e){
		e.preventDefault();
		var href = $(this).attr('href');
		$.get(href, function(data){
			$('#gallery').html(data);
			$('#gallery').show();
		});
	});
});

