$(function() {
	

	    $('#sprawdzGPS').click(function() {
		  var streat = $('#address').val();
		  var city = $('#city').val();

		  var address = streat + "," + city + ",Polska";

		  if (GBrowserIsCompatible()) {
		    geocoder = new GClientGeocoder();

		    geocoder.getLatLng(
		      address,
		      function(point) {
			if (!point) {
			  alert("Nie mozna zlokalizowa\u0107 punktu. Sprawdź czy podany adres jest poprawny!");
			} else {
			  $('#lat').val(point.y);
			  $('#lang').val(point.x);
			}
		      }
		    );
		  }
	    });

	$(".tabs").tabs(".slide", {

	    // enable "cross-fading" effect
	    effect: 'fade',
	    fadeOutSpeed: "slow",

	    // start from the beginning after the last tab
	    rotate: true

	// use the slideshow plugin. It accepts its own configuration
	}).slideshow();

	var myTimer = window.setTimeout(play2, 3500);
	function play2() {
	    $('.forward').trigger('click');
	    myTimer = window.setTimeout(play2, 3500);
	}

	function mainmenu(){
	$(" #menu ul ul ").css({display: "none"}); // Opera Fix
	$(" #menu ul li").hover(function(){
			$(this).find('ul:first').css({visibility: "visible",display: "none"}).show();
			},function(){
			$(this).find('ul:first').css({visibility: "hidden"});
			});
	}

	 $(document).ready(function(){
		mainmenu();
	});

	$('#revs').cycle({
		fx: 'fade',
		cleartypeNoBg:   true,
		timeout: 8000
	});

	$('a.lightbox').lightBox();
});