/*-------------------------------------------------------------------
 General stuff
-------------------------------------------------------------------*/
function gid(name) {
	return document.getElementById(name);
}



/*-------------------------------------------------------------------
Player javascript API
-------------------------------------------------------------------*/
    function sendEvent(swf, typ, prm)
    {
      thisMovie(swf).sendEvent(typ, prm); 
    };
    function getUpdate(typ, pr1, pr2, swf)
    {
      if((typ == 'state') && (swf == 'jstest2'))
      {
        gid('stateshow').innerHTML = pr1;
      }
      if (typ == 'time')
      {
        gid('time').innerHTML = pr1;
      }
    };

    function loadFile(swf, obj)
    {
      thisMovie(swf).loadFile(obj); 
    };
function getLength(swf) { 
	var len = thisMovie(swf).getLength(); 
	alert('the length of the playlist is: '+len);
};
function addItem(swf,obj,idx) {
	thisMovie(swf).addItem(obj,idx);
};
function removeItem(swf,idx) {
	thisMovie(swf).removeItem(idx);
};
function itemData(swf,idx) { 
	var obj = thisMovie(swf).itemData(idx);
	var txt = "";
	for(var i in obj) { 
		txt += i+": "+obj[i]+"\n";
	}
	alert(txt);
};
    function thisMovie(movieName)
    {
      if(navigator.appName.indexOf("Microsoft") != -1)
      {
        return window[movieName];
      }
      else
      {
        // return gid(movieName);
        return document[movieName];
      }
    };
