//-----------------------------------------------------------------------------
// Helper
//-----------------------------------------------------------------------------
	function getObject(id)
	{ return document.getElementById(id);
	}
	
	function show(id)
	{ getObject(id).style.display = 'inline';
	}
	
	function hide(id)
	{ getObject(id).style.display = 'none';
	}
	
	function disable(id)
	{ getObject(id).setAttribute('disabled','disabled','false'); 
	}

	function enable(id)
	{ getObject(id).removeAttribute('disabled','false');
	}

	function toggle(id)
	{
		var display = getObject(id).style.display;

		if(display == 'none')
		{ getObject(id).style.display = '';
		}
		else
		{ getObject(id).style.display = 'none';
		}
	}

//-----------------------------------------------------------------------------
// Action
//-----------------------------------------------------------------------------
	function jsAction(action,id)
	{
		document.theForm.H_action.value = action;
		document.theForm.H_id.value = id;
		document.theForm.submit();
	}

	function jsDelete(action,id,text)
	{
		if(confirm('Soll der Datensatz "'+text+'" wirklich gelöscht werden?'))
		{
			document.theForm.H_action.value = action;
			document.theForm.H_id.value = id;
			document.theForm.submit();
		}
	}

//-----------------------------------------------------------------------------
// WebCam
//-----------------------------------------------------------------------------

	var active = false;
	var camId = null;
	var timeout = 20;
	var timer = null;

	function startCam(id)
	{ 
		active = true;
		camId = id; 
		refreshImage();
	}
	function stopCam()
	{
		active = false;
		clearTimeout(timer);
		camId = null; 
	}
	function refreshImage()
	{
		var object = getObject(camId);
		var currentPath = object.src;
		var trimmedPath = new Array();
		
		trimmedPath = currentPath.split("?");
		object.src = trimmedPath[0] + "?" + Math.random();
		
		if(active == true)
		{ timer = setTimeout("refreshImage()", timeout * 1000);
		}
	}