var uppod_st_='/img/uppod.style';
var uppod_pl_='/img/uppod.swf'

function videorefresh(){
  var vp_n=1;
  $("a.VIDEO").each(function(){
    var fv={st:uppod_st_,file:$(this).attr('href')};
    var ps={bgcolor:"#eeeeee",allowFullScreen:"true",allowScriptAccess:"always"};
    var atr={id:'player_'+vp_n,name:'player_'+vp_n};
    $(this).replaceWith('<div id="player_'+vp_n+'"></div>');
    swfobject.embedSWF(uppod_pl_,'player_'+vp_n,'520','390','9.0.0',false,fv,ps,atr); 
    vp_n++;
  })
}


var chesspayer_ = '/img/chesspayer.swf';
var chesspayer_w_ = '960';
var chesspayer_h_ = '450';

function chessplayerrefresh(){
  var chp_n=1;
  $("a.CHESS").each(function(){
    var fv={xml:$(this).attr('href')}; // параметри для флеш -- param:val,..
	var atr={id:'chesspayer_'+chp_n,name:'chesspayer_'+chp_n};
    var ps={
      bgcolor:"#eeeeee",
      allowFullScreen:"false",
      allowScriptAccess:"always",
      /*width:chesspayer_w_,
      height:chesspayer_h_,*/
      loop:"false",
      play:"true",
      quality:"high",
      /*salign:"lt",
      scale:"noscale",
      type:"application/x-shockwave-flash",*/
      pluginspage:"http://get.adobe.com/flashplayer/"
    };
    $(this).replaceWith('<div id="'+atr.id+'"></div>');
    swfobject.embedSWF(chesspayer_,atr.id,chesspayer_w_,chesspayer_h_,'9.0.0',false,fv,ps,atr); 
    chp_n++;
  });
  var chph_n=1;
  $("a.CHESS_HIDE").each(function(){
    var xml_ = $(this).attr('href');
	var atr={id:'hchesspayer_'+chph_n,name:'hchesspayer_'+chph_n};
    $(this).click(function(){
    var fv={xml:xml_}; // параметри для флеш -- param:val,..
      var ps={
        bgcolor:"#eeeeee",
        allowFullScreen:"false",
        allowScriptAccess:"always",
        /*width:chesspayer_w_,
        height:chesspayer_h_,*/
        loop:"false",
        play:"true",
        quality:"high",
        /*salign:"lt",
        scale:"noscale",
        type:"application/x-shockwave-flash",*/
        pluginspage:"http://get.adobe.com/flashplayer/"
      };      
      $(this).replaceWith('<div id="'+atr.id+'"></div>');
      swfobject.embedSWF(chesspayer_,atr.id,chesspayer_w_,chesspayer_h_,'9.0.0',false,fv,ps,atr);
      return false;
    });
    $(this).attr('href','#');
    chph_n++;
  });
}
