function isPPC()
{
	if (navigator.appVersion.indexOf("PPC") != -1) return true;
	else return false;
}

function sendPage(mailHeadline)
{
	if(!isPPC())
	{
		window.location="mailto:\?subject\=" + mailHeadline + "&body=" + mailHeadline + ": " + window.location;
	}
	else
	{
		window.location="mailto:\?body=" + mailHeadline + ": " + window.location;
	}

	return false;
}

function resizeDivs()
{
	var container = document.getElementById("container");
	var containerHeight = container.offsetHeight;

	document.getElementById("containerLeft").style.height = containerHeight + "px";
	document.getElementById("containerRight").style.height = containerHeight + "px";
}

function validateFormComment(jsAlert)
{
	var f = document.getElementById("formComments");

	if (f.ime.value == "" || f.naslov.value == "" || f.poruka.value == "")
	{
		alert(jsAlert);

		return false;
	}
}

function changeGalleryTitle(caption)
{
	if (caption != "" && caption != null)
	{
		document.getElementById("h2").innerHTML = document.getElementById("h2").innerHTML + " - " + caption;
	}

	return false;
}

function showRelatedNews()
{
	if (document.getElementById("similiarPagesList"))
	{
		var ul = document.getElementById("similiarPagesList");
		var lis = ul.getElementsByTagName("li");

		if (lis.length > 0)
		{
			for (var l = 0; l < lis.length; l++)
			{
				var li = lis[l];

				if (li.className != "")
				{
					li.className = (li.className != "hidden")? "hidden" : "visible";
				}
			}
		}
	}

	return false;
}

function changeTitle(pageId, newTitle)
{
	if (pageId && pageId == 84)
	{
		document.title = "LDP | " + newTitle;
	}
}