function ChangeImage(OldImage, NewImagePath)
{
	OldImage.src = NewImagePath;
}

function MakeGray(obj, state, text)
{
	if (state && obj.value == '')
		obj.value = text;
	else if (!state && obj.value == text)
		obj.value = '';
}

function OpenWindow(Url, Width, Height)
{
	var _left = (screen.availWidth - Width)/2;
	var _top = (screen.availHeight - Height)/2;
	
	window.open(Url, '', "location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,width=" + Width + ",height=" + Height + ",top=" + _top + ",left=" + _left);
}

function FillData(FirstViewID, FirstValueID, SecondViewID, SecondValueID, SaveID)
{
	FillInlineData(FirstViewID, FirstValueID, true);
	
	if (SecondValueID != null)
	{
		FillInlineData(SecondViewID, SecondValueID);
		Show(document.getElementById(SaveID));
	}
	else
		Show(document.getElementById(SecondViewID));
}

function Hide(Object)
{
	Object.style.display = 'none';
}

function Show(Object)
{
	Object.style.display = 'block';
}

function FillInlineData(ViewID, ValueID, Focus)
{
	var view = document.getElementById(ViewID);
	Hide(view);
	
	var input = document.getElementById(ValueID);
	Show(input);
	
	input.value = view.innerHTML;
	Resize(input);
	
	if (Focus)
		input.focus();
}

function showRedBg(leftId,rightId,centerId)
{
	var leftDiv = document.getElementById(leftId);
	var rightDiv = document.getElementById(rightId);
	var centerDiv = document.getElementById(centerId);
	
	leftDiv.className = 'active-lborder';
	rightDiv.className = 'active-rborder';
	centerDiv.className = 'aktive-link menu-s';
}
function hideRedBg(leftId,rightId,centerId)
{
	var leftDiv = document.getElementById(leftId);
	var rightDiv = document.getElementById(rightId);
	var centerDiv = document.getElementById(centerId);
	
	leftDiv.className = 'lborder';
	rightDiv.className = 'rborder';
	centerDiv.className = 'link';
}				