var htmlcontent = '<div style="width:250px;height:100px;"><p style="font-family:sans-serif;font-size:12px;"><b>Apartamenty i komfortowe pokoje - &quot;Cztery Pory Roku&quot; </b><br/><br/>pokaż wskazówki dojazdu:<form action="http://maps.google.pl/maps" method="get"><input type="hidden" name="daddr" value="Apartamenty i komfortowe pokoje - &quot;Cztery Pory Roku&quot;@54.38421,19.44020"><input type="hidden" name="hl" value="pl"><input type="hidden" name="ie" value="UTF8"><input type="text" style="width:150px;" name="saddr" value="wpisz adres"><input type="submit" value="pokaż"></form></p></div>';

$(document).ready(
		function() {
			$(".columns").equalHeights('400');
			/*$('#menu').accordion( {
				autoHeight : false,
				event : 'mouseover',
				header : '.head',
				navigation : true,
				active : 0
			});*/
			$(function() { $(".lavaLamp").lavaLamp({ fx: "backout", speed: 700 })});
			$("#mapa").gMap( {
				scrollwheel : false,
				markers : [ {
					latitude : 54.38421,
					longitude : 19.44020,
					html : htmlcontent,
					popup : true
				} ],
				zoom : 16
			});
			$('#mycarousel').jcarousel( {
				auto : 0,
				wrap : 'last',
				initCallback : mycarousel_initCallback
			});

			$("a[rel^='prettyPhoto'], a[href^='http://www.youtube.com']").prettyPhoto();
			autoFill($("#enteremail"), "Dodaj/usuń swój adres email");

		});

    function zamknij() {
      $.prettyPhoto.close();
    }
    
function resizeSidebar() {}

function autoFill(id, v) {
	$(id).attr( {
		value : v
	}).focus(function() {
		if ($(this).val() == v) {
			$(this).val("").addClass("afhov");
		}
	}).blur(function() {
		if ($(this).val() == "") {
			$(this).val(v).removeClass("afhov");
		}
	});
}

function mycarousel_initCallback(carousel) {
	// Disable autoscrolling if the user clicks the prev or next button.
	carousel.buttonNext.bind('click', function() {
		carousel.startAuto(0);
	});

	carousel.buttonPrev.bind('click', function() {
		carousel.startAuto(0);
	});

	// Pause autoscrolling if the user moves with the cursor over the clip.
	carousel.clip.hover(function() {
		carousel.stopAuto();
	}, function() {
		carousel.startAuto();
	});
};
