function mail(u, s, d, img)
{
	var l="ilto";
	if (img == "txt")
	{document.write("<a"+" href="+"ma"+l+":"+u+"&#64;"+s+ "." +d+">"+u+"&#64;"+s+ "." +d+"</a>");}
	else
	{document.write("<a id=\"ico_m\" "+" href="+"ma"+l+":"+u+"&#64;"+s+ "." +d+"><img src=\"/design/sotalia/spacer.gif\" alt=\"E-mail\" /></a>");}
}

function wave(id, arg)
{
	document.getElementById(id).style.left = arg+"%";
}

function show(arg)
{
	if (document.getElementById(arg).style.visibility == "hidden")
	{
		document.getElementById(arg).style.visibility = "visible";
	}
	else
	{
		document.getElementById(arg).style.visibility = "hidden";
	}
}

function overlay(arg)
{
	document.getElementById(arg).style.zindex = "10";
}

function zoom(url, w, h, alt)
{
	if (document.getElementById("zoom_screen").style.display == "none")
	{
		document.getElementById("zoom_screen").style.display = "block";
		document.getElementById("zoomed_photo").src = url;
		document.getElementById("zoomed_photo").width = w;
		document.getElementById("zoomed_photo").height = h;
		document.getElementById("zoomed_photo").alt = alt;
		document.getElementById("zoomed_div").style.marginTop = -((Math.round (h/2))+(10+1))+"px";
		document.getElementById("zoomed_div").style.marginLeft = -((Math.round (w/2))+(10+1))+"px";
		document.getElementById("zoomed_div").style.height = (h+(8*2))+"px";
		document.getElementById("zoomed_div").style.width = (w+(8*2))+"px";
		document.getElementById("close_zoomed").style.display = "none";
	}
	else
	{
		document.getElementById("zoom_screen").style.display = "none";
		document.getElementById("zoomed_photo").src = "/img/spacer.gif";
		document.getElementById("zoomed_photo").width = "1";
		document.getElementById("zoomed_photo").height = "1";
		document.getElementById("zoomed_photo").alt = "";
		document.getElementById("zoomed_div").style.marginTop = "0";
		document.getElementById("zoomed_div").style.marginLeft = "0"
		document.getElementById("close_zoomed").style.display = "none";
	}
}

function closezoomed()
{
	if (document.getElementById("close_zoomed").style.display == "none")
	{document.getElementById("close_zoomed").style.display = "block";}
	else
	{document.getElementById("close_zoomed").style.display = "none";}
}

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 not_footerHeight = document.getElementById('not_footer').offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			if (windowHeight - (not_footerHeight + footerHeight) >= 0) {
				footerElement.style.position = 'relative';
				footerElement.style.top = (windowHeight - (not_footerHeight + footerHeight)) + 'px';
			}
			else {
				footerElement.style.position = 'relative';
			}
		}
	}
}
window.onload = function() {
	setFooter();
}
window.onresize = function() {
	setFooter();
}