function isEditMode()
{
	return typeof(objDock) != 'undefined';
}

function showOverlay(in_strId)
{
	document.getElementById(in_strId).style.display = 'block';
}

function hideOverlay(in_strId)
{
	document.getElementById(in_strId).style.display = 'none';
}


function initNav_1_4()
{
	var objNodeContainer = document.getElementById('nav_1_4_container');
	var objNodeDolly = document.getElementById('nav_1_4_dolly');
	if (objNodeContainer != null && objNodeDolly != null)
	{
		objNodeContainer.appendChild(objNodeDolly);
	}
}

var arrPictures = new Array();
var intCurrentPictureIndex = null;

function initSlideShow()
{
	if (document.getElementById('pictures') != null)
	{
		var arrPicLayer = document.getElementById('pictures').childNodes;
		for (i = 0; i < arrPicLayer.length; i++)
		{
			if (arrPicLayer[i].nodeType == 1 && arrPicLayer[i].id != null)
			{
				var strInnerHtml = arrPicLayer[i].innerHTML;
				if (isEditMode() || strInnerHtml.match(/<img/i))
				{
					arrPictures.push(arrPicLayer[i].id);
				}
			}
		}
		if (arrPictures.length > 0)
		{
			intCurrentPictureIndex = 0;
			showCurrentPicture();
			for (i = 0; i < arrPictures.length; i++)
			{
				document.getElementById(arrPictures[i] + '_button').style.display = 'inline';
			}
		}
		else
		{
//TODO hier noch Pfeile ausblenden				
		}
	}
}

function showCurrentPicture()
{
	for (i = 0; i < arrPictures.length; i++)
	{
		document.getElementById(arrPictures[i]).style.display = 'none';
	}
	document.getElementById(arrPictures[intCurrentPictureIndex]).style.display = 'block';

	for (i = 0; i < arrPictures.length; i++)
	{
		document.getElementById(arrPictures[i] + '_button').src = document.getElementById(arrPictures[i] + '_button').src.replace(/_active/, '_passive');
	}
	document.getElementById(arrPictures[intCurrentPictureIndex] + '_button').src = document.getElementById(arrPictures[intCurrentPictureIndex] + '_button').src.replace(/_passive/, '_active');
}

function showPreviousPicture()
{
	intCurrentPictureIndex = intCurrentPictureIndex > 0 ? intCurrentPictureIndex - 1 : arrPictures.length - 1;
	showCurrentPicture();
}

function showNextPicture()
{
	intCurrentPictureIndex = intCurrentPictureIndex < arrPictures.length - 1 ? intCurrentPictureIndex + 1 : 0;
	showCurrentPicture();
}

function showPicture(in_strId)
{
	intCurrentPictureIndex = getPictureIndexById(in_strId);
	showCurrentPicture();
}

function getPictureIndexById(in_strId)
{
	for (i = 0; i < arrPictures.length; i++)
	{
		if (arrPictures[i] == in_strId)
		{
			return i;
		}
	}
	return null;
}
