var t;
window.onload = init;
function init () {
	$('.gps').hoverIntent({
                    sensitivity: 3, 
                    interval: 200, 
                    over: function() { $(".gps").animate( { left: -20 }, 300); }, 
                    timeout: 500, 
                    out: function() { $(".gps").animate( { left: -350 }, 300); }
     });
}
function hideInfo () {
	$(".markerInfo").animate( { opacity: 0 }, 300, null, function () {
		$(".markerInfo").css("display", "none");
	});
}
function submitForm () {
	if ($("input[@name='login']").val() != "") {
		if ($("input[@name='e-mail']").val() != "") {
			var reg=/^[a-zA-Z0-9\._-]+@[a-zA-Z0-9\._-]+\.[a-zA-Z]{2,4}$/;
			var result=reg.exec($("input[@name='e-mail']").val());
			if (result) {
				if ($("textarea[@name='content']").val() != "") {
					document.forms.contactForm.submit();
				} else {
					$(".mess").replaceWith("");
					$(".navPath").before('<div class="mess error">Введите текст сообщения</div>');
				}
			} else {
				$(".mess").replaceWith("");
				$(".navPath").before('<div class="mess error">Неправильный формат e-mail адреса</div>');
			}
		} else {
			$(".mess").replaceWith("");
			$(".navPath").before('<div class="mess error">Введите ваш e-mail</div>');
		}
	} else {
		$(".mess").replaceWith("");
		$(".navPath").before('<div class="mess error">Введите ваше имя</div>');
	}
}
function showMarkerInfo (text) {
	$(".markerInfo").css("opacity", 0);
	$(".markerInfo").css("display", "none");
	$(".markerInfo").stop();
	clearTimeout(t);
	$(".markerInfo").css("opacity", 0.5);
	$(".markerInfo").css("display", "block");
	$(".markerInfo").text(text);
	t = setTimeout(hideInfo, 1000);
}