var logonNeedReload = false;

function galleryOpen(path, gallery_id, page) {
	if (path) window.open('/modules/photogallery/photogallery_show.php?path='+path+'&gallery='+gallery_id+'&page='+page, 'gallery', 'toolbar=no,location=no,menubar=no,status=yes,scrollbars=no,resizable=yes,width=670,height=510');
}

function opw(path, width, height) {
	if (!width) width = 800;
	if (!height) height = 600;
	if (path) {
		var win = window.open(path, '_blank', 'toolbar=no,location=no,menubar=no,status=yes,scrollbars=no,resizable=yes,width='+width+',height='+height);
		if (win) win.focus();
		else alert("Máte blokované otváranie nových okien!");
	}
}

function menu(id) {
	var menuItem;
	if (id) {
		menuItems = document.getElementById(id);
		if (menuItems) menuItems.style.display = 'block';
	} else menuItems = document.getElementsByTagName('li');
	if (menuItems.length > 1) {
		for(var i in menuItems) {
			if (menuItems[i] && (menuItems[i].name == 'sub-item')) menuItems[i].style.display = 'block';
		}
	}
}

function validate_form(form) {
	if (form) {
		for (var i in form.elements) {
			if (form.elements[i] && (form.elements[i].title != '') && (form.elements[i].value == '')) {
				alert('Položka ' + form.elements[i].title + ' nesmie byť prázdna!');
				form.elements[i].focus();
				return false;
			}
		}
		return true;
	} else return false;
}

function confirmDelete(forward) {
	if (confirm("Skutočne chcete zmazať tuto polozku?", "Áno", "Nie") == true) 	{
		window.location.reload(forward);
	}
}

function writeFlash(src, width, height) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" align="middle">'
	+ '<param name="allowScriptAccess" value="sameDomain" />'
	+ '<param name="allowFullScreen" value="false" />'
	+ '<param name="movie" value="'+src+'" />'
	+ '<param name="quality" value="high" />'
	+ '<param name="bgcolor" value="#ffffff" />'
	+ '<embed src="'+src+'" quality="high" bgcolor="#ffffff" width="'+width+'" height="'+height+'" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
	+ '</object>');
}

