// FOOTER

// Reseni paticky kompatibilni ve vsech prohlizecich.
// Pokud je okno dostatecne velke, zobrazuje se paticka u jeho dolniho okraje,
// pokud je okno nizsi nez je vyska contentu a footeru, zobrazuje se footer v normalnim toku dokumentu.
// URL k reseni: http://www.alistapart.com/articles/footers/

function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}
				
function setFooter() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var contentHeight = document.getElementById('content').offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			if (windowHeight - (contentHeight + footerHeight) >= 0) {
				footerElement.style.position = 'relative';
				footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
			}
			else {
				footerElement.style.position = 'static';
			}
		}
	}
}


// PHOTOGALERY

function newPhotoWindow(photo_file) {

	var url = '../pict.html';
	var winName = '';
	var path = url + '?' + photo_file;

	window.open(path, winName, 'top=16, left=16,width=555, height=416, status=no, resizable=yes');
}

function resizePhotoWindow() {

	var width = document.photo.width;
	var height = document.photo.height ;

	if(navigator.appVersion.search(/safari/i) > 0) {
		// Safari
		height += 23;
	}
	else if(navigator.appVersion.search(/msie/i) > 0 && navigator.appVersion.search(/windows/i) > 0) {
		// Explorer PC
		height += 31;
		width += 12;
	}
	
	window.resizeTo(width, height);
}