function SwitchImage(imagePath, imageDescription)
{
	document.getElementById('shownimage').src = 'photos/content/' + imagePath;
	document.getElementById('shownimage').title = imageDescription;
	document.getElementById('shownimage').alt = imageDescription;
	
	// Return from here
	return;
	
	//document.getElementById(arrowID).src = arrowPath;
}

function RemoveArrow(arrowID)
{
	// Disable function
	return;

	document.getElementById(arrowID).src = 'assets/images/arrow_empty.png';
}

function SwitchArticle(languageID, imageStatus, imageID, articleHTML, articleTitle, arrowID, arrowPath, orderHTML)
{
	document.getElementById('shownimage').src = 'destijds.asp?IsThumbnail=False&PhotoID='+imageID + "&LanguageID="+languageID + "&StatusID="+imageStatus;
	document.getElementById('text').innerHTML = articleHTML;
	document.getElementById('title').innerHTML = '<h1>' + articleTitle + '</h1>';
	
	document.getElementById('order').innerHTML = orderHTML;
	// Return from here
	return;
	
	document.getElementById(arrowID).src = arrowPath;
}

function GetCurrentImage(rowCount)
{
	
	for(imageCounter = 1; imageCounter <= rowCount; imageCounter++)
	{
		var thumbnailID = "thumbnail" + imageCounter;
		if (GetVisible(thumbnailID))
		{
			return imageCounter + 2;
		}
	}
	return 0;
}

function SetNewThumbnailRow(imageDirection, rowCount)
{
	var currentImage = GetCurrentImage(rowCount);
	CenterImage(currentImage + imageDirection, rowCount);
}

function CenterImage(imageNo, rowCount)
{
	// Check if there are more than 5 rows, if not, return
	if(rowCount <= 5)
	{
		return;
	}
	
	// There is more than 5 rows
	if (imageNo == 1 || imageNo == 2 || imageNo == (rowCount - 1) || imageNo == rowCount)
	{
		// The first 2 or last 2 are selected, return
		return;
	}
	else
	{
		for (imageCounter = 1; imageCounter <= rowCount; imageCounter++)
		{
			var thumbnailID = "thumbnail" + imageCounter;

			if (imageCounter == (imageNo - 2) || imageCounter == (imageNo - 1) || imageCounter == imageNo || imageCounter == (imageNo - -1) || imageCounter == (imageNo - -2))
			{
				ShowLayer(thumbnailID);
			}
			else
			{
				HideLayer(thumbnailID);
			}
		}
	}
}

function ShowLayer( whichLayer )
{
	var elem, vis;
	if( document.getElementById ) // this is the way the standards work
		elem = document.getElementById( whichLayer );
	else if( document.all ) // this is the way old msie versions work
		elem = document.all[whichLayer];
	else if( document.layers ) // this is the way nn4 works
		elem = document.layers[whichLayer];
	
	vis = elem.style;
	// if the style.display value is blank we try to figure it out here
	if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
	{
		vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
	}

	vis.display = 'block';
}

function HideLayer( whichLayer )
{
	var elem, vis;
	if( document.getElementById ) // this is the way the standards work
		elem = document.getElementById( whichLayer );
	else if( document.all ) // this is the way old msie versions work
		elem = document.all[whichLayer];
	else if( document.layers ) // this is the way nn4 works
		elem = document.layers[whichLayer];
	
	vis = elem.style;
	// if the style.display value is blank we try to figure it out here
	if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
	{
		vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
	}

	vis.display = 'none';
}

function GetVisible(whichLayer)
{
	var elem, vis;
	if( document.getElementById ) // this is the way the standards work
		elem = document.getElementById( whichLayer );
	else if( document.all ) // this is the way old msie versions work
		elem = document.all[whichLayer];
	else if( document.layers ) // this is the way nn4 works
		elem = document.layers[whichLayer];
	
	vis = elem.style;
	// if the style.display value is blank we try to figure it out here
	if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
	{
		vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
	}
	
	if (vis.display == 'none')
	{
		return false;
	}
	else
	{
		return true;
	}
}