document.write('<div style="z-index: 3000;" style="hidden" class="jqmWindowReg jqmID1" id="soapModal"></div>');

$(document).ready(function () {
	$('#soapModal').jqm();
	
	$("#legalDeclarationBtn").click(function() {
		ajaxGetUpdate("soapModal", "/jogi-nyilatkozat", false);
		return false;
	});
	
	$("div#menucol li").each(function(i, li) {
		if (!$(this).hasClass("active")) {
				$("ul", this).css({'display': 'none'});
			}
	});
	$("a").each(function(i, a) {
		$(this).click(function(){
			this.blur(); // most browsers
			this.hideFocus = false; // ie
			this.style.outline = null; // mozilla
		});
	});

	$("div#menucol li.level1").each(function(i, li) {
		$("a:first", this).click(function(){

			$("div#menucol li.level1 ul").css({'display': 'none'});
			$(this).next().slideToggle("fast");
			this.blur(); // most browsers
			this.hideFocus = false; // ie
			this.style.outline = null; // mozilla
		});
	});

	$(".adminForm").submit(function () {
		ajaxPostUpdate (this.id, this.action + (this.action.indexOf("?") == -1 ? "?" : "&") + "ajax=true", "dialog", false);
		return false;
	});

	$(".delBtn").click(function() {
		if (confirm("Valóban törli a kijelölt tételt?\n A törlés nem visszavonható!")) {
			return true;
		} else {
			return false;
		}
		this.blur(); // most browsers
		this.hideFocus = false; // ie
	});

	$(".imageDiv img").click(function() {
		$("#galleryDialog").html("<table class='showpic'><tbody><tr><td colspan='2'><img src='" + this.src.replace(regExpExt, "_800x600.php") + "' alt='" + this.alt + "' onclick='$(\"#galleryDialog\").jqmHide(); return false;'/></td></tr><tr><td class='details'>" + this.alt + "</td><td class='close'><img src='/images/closelabel.gif' onclick='$(\"#galleryDialog\").jqmHide(); return false;'/></td></tr></tbody></table>");
		$("#galleryDialog").jqmShow();
		this.blur(); // most browsers
		this.hideFocus = false; // ie
		this.style.outline = null; // mozilla
	})
});