function initialize() {
	var geocoder = new google.maps.Geocoder();
	geocoder.geocode( {
		address : 'Poleska 4, Kołobrzeg'
	}, function(results, status) {
		if (status == google.maps.GeocoderStatus.OK) {
			var myLatlng = results[0].geometry.location;
			var myOptions = {
				zoom: 13,
				center: myLatlng,
				mapTypeId: google.maps.MapTypeId.ROADMAP,
				mapTypeControl: false,
				streetViewControl: false
			}
			var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

			var marker = new google.maps.Marker({
				map: map,
				position: results[0].geometry.location
			//				animation: google.maps.Animation.BOUNCE
			});
		}
	});
}

function loadScript() {
	var script = document.createElement("script");
	script.type = "text/javascript";
	script.src = "http://maps.google.com/maps/api/js?sensor=false&callback=initialize";
	document.body.appendChild(script);
}

window.onload = loadScript;

function mycarousel_initCallback(carousel) {
	jQuery('.jcarousel-control a').bind('click', function() {
		carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
		return false;
	});
}

function mycarousel_itemVisibleInCallbackBeforeAnimation(carousel, item, idx, state) {
	idx %= 5;
	$('.jcarousel-control a').removeClass('active').eq(idx-1).addClass('active');
	$('#jcarousel-info p').hide().eq(idx-1).show();
	return;
};

jQuery(document).ready(function() {

	jQuery(".fancybox").fancybox({
		cyclic: true,
		titlePosition: 'over'
	});

	jQuery("#mycarousel").jcarousel({
		scroll: 1,
		auto: 5,
		wrap: 'circular',
		animation: 1500,
		initCallback: mycarousel_initCallback,
		itemVisibleInCallback: {
			onBeforeAnimation: mycarousel_itemVisibleInCallbackBeforeAnimation
		}
	});

	jQuery("#contact-form input:not(#send)").click( function() {
		$(this).unbind('click');
		$(this).attr('value','');
	});
	jQuery("#contact-form textarea").click( function() {
		$(this).unbind('click');
		$(this).html('');
	});

});

