function toggleItem(item) {
	if (document.getElementById("showContent_" + item).style.display == "none" || document.getElementById("showContent_" + item).style.display == "") {
		document.getElementById("accordShow_" + item).style.height = "auto";
		document.getElementById("accordMore_" + item).innerHTML = "close...";
		$('#showContent_' + item).slideDown('slow');
	} else {
		$('#showContent_' + item).slideUp('slow');
		document.getElementById("accordMore_" + item).innerHTML = "read more...";
	}
}

function toggleEvent(item) {
	if (document.getElementById("showContent_" + item).style.display == "none") {
		document.getElementById("accordShow_" + item).style.height = "auto";
		document.getElementById("accordMore_" + item).innerHTML = "close...";
		$('#showContent_' + item).slideDown('slow');
	} else {
		$('#showContent_' + item).slideUp('slow');
		document.getElementById("accordMore_" + item).innerHTML = "read more...";
	}
}

function toggleComment(item) {
			if(document.getElementById("showNewComment_" + item).style.display != "none") {
				$('#showNewComment_' + item).hide();
			}
			if(document.getElementById("showComment_" + item).style.display == "none" || document.getElementById("showComment_" + item).style.display == "") {
				//$('#showComment_' + item).slideDown('slow');
				$('#showComment_' + item).show("slide", { direction: "up" }, 1000);			
			} else {
				//$('#showComment_' + item).slideUp('slow');
				$('#showComment_' + item).hide("slide", { direction: "up" }, 1000);			
			}
		}
		
function toggleNewComment(item) {
			if(document.getElementById("showComment_" + item).style.display != "none") {
				$('#showComment_' + item).hide();
			}
			if(document.getElementById("showNewComment_" + item).style.display == "none" || document.getElementById("showNewComment_" + item).style.display == "") {
				$('#showNewComment_' + item).show("slide", { direction: "up" }, 1000);			
			} else {
				$('#showNewComment_' + item).hide("slide", { direction: "up" }, 1000);
			}
		}

function openPage1() {
			document.getElementById("commentPage2").style.display = "none";
			document.getElementById("commentPage3").style.display = "none";
			document.getElementById("commentPage1").style.display = "block";
}

function openPage2() {
			document.getElementById("commentPage1").style.display = "none";
			document.getElementById("commentPage3").style.display = "none";
			document.getElementById("commentPage2").style.display = "block";
}

function openPage3() {
			document.getElementById("commentPage1").style.display = "none";
			document.getElementById("commentPage2").style.display = "none";
			document.getElementById("commentPage3").style.display = "block";
}

function gMapLoad() {
			if (GBrowserIsCompatible()) {
				var map = new GMap2(document.getElementById("map"));
				map.setCenter(new GLatLng(47.50590309009929, 19.060683846473694), 12);
				var point = new GLatLng(47.50590309009929, 19.060683846473694);
				map.addControl(new GSmallMapControl());
				map.addControl(new GMapTypeControl());
				var marker = new GMarker(point);
				GEvent.addListener(marker, "click", function() {
					marker.openInfoWindowHtml("1066 Budapest,<br/>Ó utca 51.<br/><a href='http://maps.google.com/maps?saddr=Budapest, Hungary&daddr=1066 Budapest, Ó utca 51' target='_blank'>Útvonal tervezése ide</a>");
				});
				map.addOverlay(marker);
			}
		}

function checkRegister() {
	var	pattern = /^[0-9a-zA-Z\.-_]+@[0-9a-zA-Z\.-]+\.[a-zA-Z]{2,4}$/i;
	if (document.forms.registerForm.name.value == "" || document.forms.registerForm.email.value == "" || document.forms.registerForm.code.value == "" || document.forms.registerForm.name.value == "name" || document.forms.registerForm.email.value == "e-mail address" || document.forms.registerForm.code.value == "type in code") {
		alert("Please fill out the form");
		return false;
	} else if (pattern.test(document.forms.registerForm.email.value) == false) {
		alert("Invalid e-mail address");
		return false;
	} else {
		return true;
	}
}

function checkCommentInnerForm() {
	var	pattern = /^[0-9a-zA-Z\.-_]+@[0-9a-zA-Z\.-]+\.[a-zA-Z]{2,4}$/i;
	if (document.forms.innerForm.commentName.value == "" || document.forms.innerForm.commentMail.value == "" || document.forms.innerForm.commentText.value == "" || document.forms.innerForm.code.value == "" || document.forms.innerForm.commentName.value == "name" || document.forms.innerForm.commentMail.value == "e-mail address" || document.forms.innerForm.code.value == "type in code") {
		alert("Please fill out the form");
		return false;
	} else if (pattern.test(document.forms.innerForm.commentMail.value) == false) {
		alert("Invalid e-mail address");
		return false;
	} else {
		return true;
	}
}

function checkCommentMainForm() {
	var	pattern = /^[0-9a-zA-Z\.-_]+@[0-9a-zA-Z\.-]+\.[a-zA-Z]{2,4}$/i;
	if (document.forms.mainForm.commentName.value == "" || document.forms.mainForm.commentMail.value == "" || document.forms.mainForm.commentText.value == "" || document.forms.mainForm.code.value == "" || document.forms.mainForm.commentName.value == "name" || document.forms.mainForm.commentMail.value == "e-mail address" || document.forms.mainForm.code.value == "type in code") {
		alert("Please fill out the form");
		return false;
	} else if (pattern.test(document.forms.mainForm.commentMail.value) == false) {
		alert("Invalid e-mail address");
		return false;
	} else {
		return true;
	}
}
