<!--
/* 
Get the current play state of the presentation. If the play state
is buffering, get the buffering time elapsed and the buffering time
remaining.
Returns an int32 value with the following meanings: 
0 — Stopped
1 — Contacting
2 — Buffering
3 — Playing
4 — Paused
5 — Seeking 
*/
function playState() 
{
		var bQuit = false;
		if (isMac) {var pstate = 6}
		else {var pstate=document.imageObject.GetPlayState();}
        //var pstate=document.RVOCX.GetPlayState();
        
        switch (pstate) 
        {
                case 1:
                        if (confirm("Your player is currently trying to contact the server and may not have completed the segment.\n\n" + 
							"Press \"OK\" to quit or \"Cancel\" to keep listening."))
							bQuit = true;
						else
							bQuit = false;
                        break
                case 2:
                        var totaltime=document.imageObject.GetBufferingTimeRemaining() * 1000;
                        if (confirm("Your player is currently buffering and has not completed the segment.\n" +
							"The remaining buffering time is " + totaltime + " milliseconds.\n\n" + 
							"If you quit now you will not receive credit for this segment.  You must be listening " +
							"to this segment for the duration of the segment timing in order to receive credit. " +
							"If you have listened to the entire segment during this session, and still cannot get to the " +
							"next segment please contact customer support.\t\n\n" +
							"Press \"OK\" to quit or \"Cancel\" to keep listening."))
							bQuit = true;
						else
							bQuit = false;
							
                        break
                case 3:
                        if (confirm("Your player is currently playing a course and may not have completed the segment.\n" +
							"If you quit now you will not receive credit for this segment.  You must be listening " +
							"to this segment for the duration of the segment timing in order to receive credit.\t\n\n" +
							"Press \"OK\" to quit or \"Cancel\" to keep listening."))
							bQuit = true;
						else
							bQuit = false;
                        break
                case 4:
                        if (confirm("Your player is currently paused and may not have completed the segment.\t\n" +
							"If you quit now you will not receive credit for this segment.  You must be listening " +
							"to this segment for the duration of the segment timing in order to receive credit.\t\n\n" +
							"Press \"OK\" to quit or \"Cancel\" to keep listening."))
							bQuit = true;
						else
							bQuit = false;
                        break
                case 5:
                        if (confirm("Your player is currently trying to fast foward and may not have completed the segment.\t\n" +
							"If you quit now you will not receive credit for this segment.  You must be listening " +
							"to this segment for the duration of the segment timing in order to receive credit.\t\n\n " +
							"Press \"OK\" to quit or \"Cancel\" to keep listening."))
							bQuit = true;
						else
							bQuit = false;
                        break
               
                case 6: case 0:
                        if (confirm("Please note that if you have not listened to the current segment \n" +
							"in its entirety, you will not receive credit for that segment.\t\n\n" +
							"Press \"OK\" to quit or \"Cancel\" to keep listening."))
							bQuit = true;
						else
							bQuit = false;
                        break        
                        
                        
                default:
                        bQuit = true;
                        break
        }
        return bQuit;
}
// -->

