
/* JS: mod_photo_main*/
function openwin(elm, isImage) {

	if (!isImage) {
		window.open(elm.getAttribute('href'), '_blank');
		return true;
	}


	var msgWindow = window.open(elm.getAttribute('href'), '_blank', 'toolbar=no');
	msgWindow.document.write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>');
	msgWindow.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
	msgWindow.document.write('<html>');
  	msgWindow.document.write('<meta http-equiv="content-type" content="text/html; charset=utf-8">');
  	msgWindow.document.write('<head>');
	msgWindow.document.write('<title>sys_image_title</title>');
	msgWindow.document.write('<style media="screen,tv,projection"  type="text/css"> html, body {margin:0;padding:0} a, img {border: 0px solid #fff}</style>');
	msgWindow.document.write('<script type="text/javascript">');
	msgWindow.document.write('	function imgSize() {');
	msgWindow.document.write('		image =document.getElementById("image_elm");');
	msgWindow.document.write('		if (screen.height <= (image.height + 31)) {');
	msgWindow.document.write('			window.resizeTo(image.width + 12, screen.height - 100);');
	msgWindow.document.write('		} else {');
	msgWindow.document.write('			window.resizeTo(image.width + 12, image.height + 31);');
	msgWindow.document.write('		}');
	msgWindow.document.write('	}');
	msgWindow.document.write('</script>');
	msgWindow.document.write('</head>');
	msgWindow.document.write('<body style="margin:0;padding:0;background:#fff" onload="imgSize();">');
	msgWindow.document.write('<a style="border:0px solid #fff;" href="#" onclick="window.close();"><img src="'+elm.getAttribute('href')+'"style="border:0px solid #fff;" id="image_elm" alt=""></a>');
	msgWindow.document.write('</body>');
	msgWindow.document.write('</html>');
	msgWindow.document.close();
     msgWindow.focus();
     return true;
}


function open_win_external(elm) {
	window.open(elm.getAttribute('href'), '_blank');
	return true;
}

/* JS: mod_login_main*/
function mod_login_on_submit() {
	var form;
	if (form = document.getElementById('form_id_login')) {
		var inputs = form.elements;	var err = '';
		for (var i = 0; i < inputs.length; i++) {
			if ((inputs[i].name == 'ed_login') && (inputs[i].value == '')) {
				err = err + "Zadejte uživatelské jméno.";
			}
			if ((inputs[i].name == 'ed_password') && (inputs[i].value == '')) {
				err = err + "Zadejte heslo.";
			}
		}
		if (err != '') {alert(err);	return false;} else {return true;}
	}
}
