
var GPictureCount = 6;
var GBannerAdCount = 1;

function HoverNavigation(ACell, AHovering)
{
	if (AHovering)
	{
		ACell.className = "NavigationHover";
	}
	else
	{
		ACell.className = "Navigation";
	}
}

function InnerNavigate(APage)
{
	document.getElementById("IFrameBody").src = APage;
}

function ResizeIFrameBody()
{
	if ((parent) && (parent.document) && (parent.document.getElementById("IFrameBody")))
	{
		var CMinimumHeight = 400;
		var VRequiredHeight;
		if (document.all)
		{
			VRequiredHeight = parseInt(document.body.scrollHeight);
		}
		else
		{
			VRequiredHeight = parseInt(document.body.offsetHeight);
		}

		if (VRequiredHeight > CMinimumHeight)
		{
			parent.document.getElementById("IFrameBody").style.height = VRequiredHeight + 50;
		}
		else
		{
			parent.document.getElementById("IFrameBody").style.height = CMinimumHeight;
		}
	}
}

function WrapIndex()
{
	if (!parent.document.getElementById("IFrameBody"))
	{
		window.location.href = "index.php?page=home.php";
	}
}


function ShowFrontPageImage(AShow)
{
	if ((parent) && (parent.document) && (parent.document.getElementById("DivFrontPageImage")))
	{
		if (AShow)
		{
			parent.document.getElementById("DivFrontPageImage").style.display = "inline";
			parent.document.getElementById("ImageFrontPage").src = GetRandomPicture();
		}
		else
		{
			parent.document.getElementById("DivFrontPageImage").style.display = "none";
		}
	}
}

function GetRandomPicture()
{
	var VRandomNumber = Math.ceil(Math.random() * GPictureCount);
	var VURL = 'images/pictures/' + VRandomNumber.toString() + '.jpg';
	return VURL;
}

function GetRandomBannerAd()
{
	var VRandomNumber = Math.ceil(Math.random() * GBannerAdCount);
	var VURL = 'images/bannerads/' + VRandomNumber.toString() + '.jpg';
	return VURL;
}


