	function emptyEmail() {
		email = document.getElementById("bulletinMail") ;
		if (email.value == 'Запиши своя e-mail') {
			email.value = '' ;
		}
	}

	function fillEmail() {
		email = document.getElementById("bulletinMail") ;
		if (email.value == '') {
			email.value = 'Запиши своя e-mail' ;
		}
	}

	function sendBulletin() {
		email = document.getElementById("bulletinMail") ;
		$.ajax({
			type: "GET",
			url: "bulletin-request.php",
			data: "emailaddress=" + email.value ,
			success: function(result){
				alert(result);
				email.value = 'Запиши своя e-mail';
			}
		});
		return false;
	}

	function fillCalendar(month,year) {
		$.ajax({
			type: "GET",
			url: "calendar.php",
			data: "month=" + month + "&year=" + year,
			success: function(result){
				$("#calendar").html(result);
			}
		});
	};

	$(document).ready(function(){
		$("a[href*='http://']:not([href*='"+location.hostname+"'])").attr("target","_blank");
		fillCalendar();
	});

	function getBulletin() {
		window.location = "get.php?item=bulletin&id=" + document.getElementById("bulletins").value ;
	};
	
	function fillGallery(id,page) {
		$.ajax({
			type: "GET",
			url: "gallery.php",
			data: "id=" + id + "&page=" + page ,
			success: function(result){
				$("#gInside").html(result);
			}
		});
	}
