var currentPosition=0;var currentVolume=0;var currentMute=false;var currentState="NONE";var currentOpen="";var player=null;function playerReady(a){player=window.document[a.id];addListeners();}function addListeners(){if(player){addAllControllerlListeners();addAllModelListeners();}else{setTimeout("addListeners()",100);}}function addAllControllerlListeners(){player.addControllerListener("ITEM","doNothing");player.addControllerListener("MUTE"," doNothing");player.addControllerListener("PLAY","doNothing");player.addControllerListener("PLAYLIST","doNothing");player.addControllerListener("QUALITY","doNothing");player.addControllerListener("RESIZE","doNothing");player.addControllerListener("SEEK","positionListener");player.addControllerListener("STOP","doNothing");player.addControllerListener("VOLUME","doNothing");}function addAllModelListeners(){player.addModelListener("BUFFER","doNothing");player.addModelListener("ERROR","doNothing");player.addModelListener("LOADED","doNothing");player.addModelListener("META","doNothing");player.addModelListener("STATE","stateListener");player.addModelListener("TIME","positionListener");}function doNothing(a){}function positionListener(b){currentPosition=b.position;clipduration=b.duration;var a=document.getElementById("posId");if(a){a.innerHTML="position: "+currentPosition+" / "+clipduration;}if(currentOpen==""){alertStatValue("OPEN",currentPosition,clipduration,player.name);}}function stateListener(b){currentState=b.newstate;var a=document.getElementById("statId");if(a){a.innerHTML="state: "+currentState;}alertStatValue(b.newstate,currentPosition,clipduration,player.name);}function alertStatValue(a,e,d,c){var b=s_gi("interhypdeprod");if(a=="OPEN"){currentOpen="true";b.Media.open(c,d,"Longtail JW-Mediaplayer");}if(a=="COMPLETED"){b.Media.stop(c,e);b.Media.close(c);}if(a=="PLAYING"){b.Media.play(c,e);}if(a=="PAUSED"){b.Media.stop(c,e);}}