$(function() {
	$(".header").click(function() {
		document.location.href = "/";
	});
	if ($(".gmap").length > 0) loadGmap();
	$(".uutiskirje input").focus(function() {
		$(this).val("");
	});
});

function orderNewsletter()
{
	$.post("/ajax/getnewsletter", {email: $(".uutiskirje input").val()}, function() {
		$(".uutiskirje .subscribe").hide();
		$(".uutiskirje .thanks").show();
	});
}

function loadGmap()
{
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById("gmap"));
		var center = new GLatLng(60.197329,24.94935);
		map.setCenter(center, 15);
		map.addOverlay(new GMarker(center));
		map.addControl(new GSmallMapControl());
	}
}

function ilmoittaudu(kid) 
{
	var url = "/ilmoittautuminen/ilmoittaudu/?kid=" + kid;
	document.location.href = url;
}
