var TILDE = '~';

var monthsArray = $A(['Tammi', 'Helmi', 'Maalis', 'Huhti', 'Touko', 'Kesä', 'Heinä', 'Elo', 'Syys', 'Loka', 'Marras', 'Joulu']);

function createPlayer(container, playerId, file, type) {
  if(type == 'nsv'){
    var nsvPlayer = '<object id="' + playerId + '" codebase="nsvplayx_vp6_mp3.cab#Version=-1,-1,-1,-1" width="640" height="360" border="0"'
                         + ' classid="clsid:C5E28B9D-0A68-4B50-94E9-E8F6B4697516">'
                         + ' <param name="Location" value="' + file + '" />'
                         + ' <param name="_Version" value="65536" />'
                         + ' <param name="_ExtentX" value="16933" />'
                         + ' <param name="_ExtentY" value="12700" />'
                         + ' <param name="_StockProps" value="0" />'
                         + ' <param name="Bandwidth" value="value" />'
                         + ' <embed type="application/x-nsv-vp3-mp3" width="640"' 
                         + ' height="360" codebase="nsvmoz_vp3_mp3.xpi" location="http://vps218.zoner-asiakas.fi:3333/"></embed>'
                         + ' </object>';
    $(container).update(nsvPlayer);
    $(container).show();
  }
  else if(type == 'flv'){
    var s1 = new SWFObject('player-licensed.swf',playerId,'640','368','9');
    s1.addParam('allowfullscreen','true');
    s1.addParam('allowscriptaccess','always');
    s1.addParam('flashvars','file=' + file + '&autostart=true&stretching=exactfit&smoothing=false&image=videokirjasto_mainos.jpg&skin=../skins/stormtrooper.xml&bufferlength=3');
    $(container).show();
    s1.write(container);
  }else{
    var s1 = new SWFObject("mediaplayer.swf",playerId,"288","180","8");
    s1.addParam("allowfullscreen","true");
    s1.addParam('allowscriptaccess','always');
    s1.addVariable('displayclick','fullscreen');
		s1.addVariable("width","288");
		s1.addVariable("height","182");
		s1.addVariable("autostart","true");
		s1.addVariable("file",file);
    $(container).show();
    s1.write(container);
  }
}




