function generateWMPAudioEventHandlers()
{
    // TODO: check if on PC (also does not work on Opera - only IE and FireFox)
    var _nMaxAudio = 3;
    if(isDefined('nAudioControls')) _nMaxAudio = maxAudio;
    var n;
    for(var i = 1; i <= _nMaxAudio; i++ ) {
	n = wmpAudioControlNameBase + i;
	if( Utils.isOpera() ) {
	    if( i == 1 ) {
		document.write( '<script type="text/javascript">function OnDSPlayStateChangeEvt(newState) { WMPAudioPlayStateChange( newState ); }</script>' );
		document.write( '<script type="text/javascript">function OnDSPositionChangeEvt(newState) { WMPAudioPositionChange( newState ); }</script>' );
	    }
	}
	else {
	    document.write( '<script type="text/javascript" for="' + n + 
		    '" event="playStateChange(newState)">' + 'WMPAudioPlayStateChange(newState,"' + n + '")</script>' );
	    document.write( '<script type="text/javascript" for="' + n +  
		    '" event="audioPositionChange(newState)">' + 'WMPAudioPositionChange(newState,"' + n + '")</script>' );
	}
    }
}
/**
 * kinda kludgy but we can event handlers to work only this way. We cannot
 * seem to attach them as we dynamically create audio controls. So we
 * create stuff "in anticpation". A particular page can define nAudioControls
 * variable to tell us how many to generate
 */
kinda kludgy but we can event handlers to work only this way. We cannot
seem to attach them as we dynamically create audio controls. So we
create stuff "in anticpation". A particular page can define nAudioControls
variable to tell us how many to generate
kinda kludgy but we can event handlers to work only this way . We cannot seem to attach them as we dynamically create audio controls . So we create stuff " in anticpation " . A particular page can define nAudioControls variable to tell us how many to generate
function generateWMPAudioEventHandlers()
{
    var _nMaxAudio = 3;
    if(isDefined('nAudioControls')) _nMaxAudio = maxAudio;
    var n;
    for(var i = 1; i <= _nMaxAudio; i++ ) {
	n = wmpAudioControlNameBase + i;
	if( Utils.isOpera() ) {
	    if( i == 1 ) {
		document.write( '<script type="text/javascript">function OnDSPlayStateChangeEvt(newState) { WMPAudioPlayStateChange( newState ); }</script>' );
		document.write( '<script type="text/javascript">function OnDSPositionChangeEvt(newState) { WMPAudioPositionChange( newState ); }</script>' );
	    }
	}
	else {
	    document.write( '<script type="text/javascript" for="' + n + 
		    '" event="playStateChange(newState)">' + 'WMPAudioPlayStateChange(newState,"' + n + '")</script>' );
	    document.write( '<script type="text/javascript" for="' + n +  
		    '" event="audioPositionChange(newState)">' + 'WMPAudioPositionChange(newState,"' + n + '")</script>' );
	}
    }
}
function generateWMPAudioEventHandlers ( ) { var _nMaxAudio = 3 ; if ( isDefined ( 'nAudioControls' ) ) _nMaxAudio = maxAudio ; var n ; for ( var i = 1 ; i <= _nMaxAudio ; i ++ ) { n = wmpAudioControlNameBase + i ; if ( Utils . isOpera ( ) ) { if ( i == 1 ) { document . write ( '<script type="text/javascript">function OnDSPlayStateChangeEvt(newState) { WMPAudioPlayStateChange( newState ); }</script>' ) ; document . write ( '<script type="text/javascript">function OnDSPositionChangeEvt(newState) { WMPAudioPositionChange( newState ); }</script>' ) ; } } else { document . write ( '<script type="text/javascript" for="' + n + '" event="playStateChange(newState)">' + 'WMPAudioPlayStateChange(newState,"' + n + '")</script>' ) ; document . write ( '<script type="text/javascript" for="' + n + '" event="audioPositionChange(newState)">' + 'WMPAudioPositionChange(newState,"' + n + '")</script>' ) ; } } }
kinda kludgy but we can event handlers to work only this way.
kinda kludgy but we can event handlers to work only this way .
// TODO: check if on PC (also does not work on Opera - only IE and FireFox)
