var numParentNavigationItems = '1,6';
var numParentNavigationItemsTopNumeric = 6;
var numSubNavigationItems = '1,2,3,4,5,6';
var numSubNavigationItemsTopNumeric = 6;

function swap_image(strImageId,strImageSrc)
{
	//alert(strImageId + ' : ' + strImageSrc);
	document.getElementById(strImageId).src = strImageSrc;
}
function swap_css_style(strElementId,strClassName)
{
	document.getElementById(strElementId).className = strClassName;
}
function image_reset(numParentImage,numChildImage)
{
	for(numParentCounter=1; numParentCounter<=numParentNavigationItemsTopNumeric; numParentCounter++)
	{
		//Activate selected arrow image
		if(numParentCounter == numParentImage)
		{
			swap_image('imgNavigationElement' + numParentImage,'images/navigation_element_on.gif');
		}
		else
		{
			//Check if id is in comma separated value. If it is, reset the image
			if(numParentNavigationItems.indexOf(numParentCounter) != -1)
			{
				swap_image('imgNavigationElement' + numParentCounter,'images/navigation_element_off.gif');
			}
		}
	}

	//Handle additional navigation element visibility
	if(numParentImage == numParentNavigationItemsTopNumeric)
	{
		switch(document.getElementById("divAdditionalNavigation").style.display)
		{
			case "none" :
				document.getElementById("divAdditionalNavigation").style.display = "block";
				break;
		}
	}
	else
	{
		switch(document.getElementById("divAdditionalNavigation").style.display)
		{
			case "block" :
				document.getElementById("divAdditionalNavigation").style.display = "none";
				break;
		}
	}

	//Check whether a child element needs to be selected
	if(!numChildImage == '')
	{
		for(numChildCounter=1; numChildCounter<=numSubNavigationItemsTopNumeric; numChildCounter++)
		{
			if(numChildCounter == numChildImage)
			{
				swap_image('imgNavigationSubElement' + numChildImage,'images/navigation_subelement_on.gif');
			}
			else
			{
				//Check if id is in comma separated value. If it is, reset the image
				if(numSubNavigationItems.indexOf(numChildCounter) != -1)
				{
					swap_image('imgNavigationSubElement' + numChildCounter,'images/navigation_subelement_off.gif');
				}
			}
		}
	}
	else
	{
		//All child elements need to be reset
		for(numChildCounter=1; numChildCounter<=numSubNavigationItemsTopNumeric; numChildCounter++)
		{
			//Check if id is in comma separated value. If it is, reset the image
			if(numSubNavigationItems.indexOf(numChildCounter) != -1)
			{
				swap_image('imgNavigationSubElement' + numChildCounter,'images/navigation_subelement_off.gif');
			}
		}
	}
}
function load_url(strUrl)
{
	if(strUrl == 'blank')
	{
		alert('Please enter a valid url in order to load an external site');
		return false;
	}
	else
	{
		window.open(strUrl,'popup_link');
		popup_link.focus();
	}
}

function check_measurements()
{
	var strDimensions = '';
	var numStaticHeight = 466;
	var numStaticWidth = 610;
	var numTopBottomMeasurement = 0;
	var numSideMeasurement = 0;
	var blnDebug = false;
	var strBrowser = navigator.appName;

	if (navigator.appName.substring(0,9) == "Microsoft") strBrowser = 'MSIE';

	if (strBrowser != 'MSIE')
	{
		strDimensions = 'Width : ' + innerWidth + '\nHeight : ' + innerHeight;
		numTopBottomMeasurement = (innerHeight-numStaticHeight)/2;
		numSideMeasurement = (innerWidth-numStaticWidth)/2;
	}
	else
	{
		strDimensions = 'Width : ' + document.body.clientWidth + '\nHeight : ' + document.body.clientHeight;
		numTopBottomMeasurement = (document.body.clientHeight-numStaticHeight)/2;
		numSideMeasurement = (document.body.clientWidth-numStaticWidth)/2;
	}
	if (numTopBottomMeasurement<0) numTopBottomMeasurement=0;
	if (numSideMeasurement<0) numSideMeasurement=0;
	//Resize top and bottom spacer divs
	//divTop element resize
	document.getElementById("divTop").style.top = '0px';
	document.getElementById("divTop").style.left = '0px';
	document.getElementById("divTop").style.height = numTopBottomMeasurement + 'px';

	//divMiddleCenter element resize
	document.getElementById("divMiddleCenter").style.top = numTopBottomMeasurement + 1 + 'px';
	document.getElementById("divMiddleCenter").style.left = numSideMeasurement + 'px';

	//divBottom element resize
	document.getElementById("divBottom").style.top = numTopBottomMeasurement + numStaticHeight + 'px';
	document.getElementById("divBottom").style.left = '0px';
	document.getElementById("divBottom").style.height = numTopBottomMeasurement + 'px';

	if(blnDebug){alert(strDimensions + '\nnumTopBottomMeasurement : ' + numTopBottomMeasurement + '\nnumSideMeasurement : ' + numSideMeasurement)};
}