function tSecToHHMMSST(i)

	{

	h = Math.floor(i / 3600000);

	i = i-h*3600000;

	m = Math.floor(i/60000);

	if (m<10) { m='0'+m;}	

	i = i-m*60000

	s = Math.floor(i/1000);

	if (s<10) { s='0'+s;}	

	i = i-s*1000;

	t = Math.floor(i);

	return h+':'+m+':'+s+'.'+t;

	}

	
function HHMMSSTTotSec(i)

	{

	h = i.substring(0,i.indexOf(':'));

	m = i.substring(i.indexOf(':')+1,i.lastIndexOf(':'));

	s = i.substring(i.lastIndexOf(':')+1,12);

	return h*3600000+m*60000+s*1000;

	}
		

function SetStart()

	{

	document.form1.start.value=tSecToHHMMSST(document.embeds[0].GetPosition());

	}
	

function SetEnd()

	{

	document.form1.end.value=tSecToHHMMSST(document.embeds[0].GetPosition());

	}
	

function GotoStart()

	{

	document.embeds[0].DoPause();

	document.embeds[0].SetPosition(HHMMSSTTotSec(document.form1.start.value));

	document.embeds[0].DoPlay();

	}
	

function GotoPostion(theHHMMSS,theHHMMSSoffset)

	{

	document.embeds[0].DoPause();

	var tempPosition = HHMMSSTTotSec(theHHMMSS) - HHMMSSTTotSec(theHHMMSSoffset);
	// alert (theHHMMSS + ' - ' + theHHMMSSoffset + ' = ' + tSecToHHMMSST(tempPosition));
	document.embeds[0].SetPosition(tempPosition);

	document.embeds[0].DoPlay();

	}
	

function GotoEnd()

	{

	document.embeds[0].DoPause();

	document.embeds[0].SetPosition(HHMMSSTTotSec(document.form1.end.value)-5000);

	document.embeds[0].DoPlay();

	aktiv = window.setInterval("PauseOn()",100);

	}
	

function PauseOn()

	{

	if (document.embeds[0].GetPosition()<HHMMSSTTotSec(document.form1.end.value))

		{



		}

	else

		{

		window.clearInterval(aktiv); 

		document.embeds[0].DoPause();

		}

	}
	

function CheckSubmit()

	{

	if (HHMMSSTTotSec(document.form1.start.value)>HHMMSSTTotSec(document.form1.end.value))

		{

		alert('Startposition grösser als Endposition!');

		}

	else

		{

		document.form1.submit();

		}

	}
	

function MoveStart(i)

	{

	document.form1.start.value=tSecToHHMMSST(HHMMSSTTotSec(document.form1.start.value)+i);

	}
	

function MoveEnd(i)

	{

	document.form1.end.value=tSecToHHMMSST(HHMMSSTTotSec(document.form1.end.value)+i);

	}





