<html>
<head>
<title>Documento senza titolo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<script>
var end;
function start_player()
{
//gets the page location with the querystring
var loc_string = top.location.href;
var res = loc_string;
//extract only the querystring
res = loc_string.substring(loc_string.indexOf('?')+1,loc_string.length);
//split the 3 querystrings
var com = res.split("&");
//get the start time
var start = com[0].substring(com[0].indexOf('=')+1,com[0].length);
//get the end time
end = com[1].substring(com[1].indexOf('=')+1,com[1].length);
//get the location with unescape function
var location = unescape(com[2].substring(com[2].indexOf('=')+1,com[2].length));
//set media file url
document.wmedia.Url = location;
//set start position
document.wmedia.Controls.currentPosition = start;
//play the file
document.wmedia.Controls.play();
}
</script>

<body onload="start_player()">
<object classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="280" height="228" hspace="0" vspace="0" id="wmedia">
        <param name="AutoStart" value="False">
        <param name="UIMode" value="full">
        <param name="Volume" value="100">
        <param name="CanSeek" value="True">
        <param name="CanSeekToMarkers" value="True">
        <param name="ShowStatusBar" value="False">
        <param name="URL" value="">
</object>
<form name="form1" method="post" action="">
  <input type="hidden" name="textfield" id="textfield">
</form>
<script language="javascript" type="text/JavaScript">



//sets the timer every 100ms
var idI = window.setInterval("timerWmp();", 100);
document.form1.textfield.value=idI;

function timerWmp()
{
        //gets the current positon
        var cur_pos = document.wmedia.Controls.currentPosition;
        //if current position is bigger than end position, stop the player
        var stop_pos = end;
        if(cur_pos>=stop_pos)
        {
                //set state to "PAUSE"
                document.wmedia.Controls.pause();
                //kill timer
                window.clearInterval(document.form1.textfield.value);
        }
}

</script>
</body>

</html>