<!--
try {
  document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}
// -->

//òû èå?
var ie = 0/*@cc_on+@_jscript_version*10/10@*/;

function popup(width,height,filename) {

   width = width+2;
   height = height+28;

                      $('#TB_overlay').show();

/////////ñ÷èòàåì îòñòóïû ñâåðõó-ñëåâà
        hght=height /* ÂÛÑÎÒÀ òàáëèöû  */
        wdth = width //øèðèíà

        var theBody = document.getElementsByTagName('body')[0];

function getClientHeight()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}

function getClientWidth()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}

    height2 = getClientHeight();
    width2 = getClientWidth();

        mg = height2-hght;
        mg=mg/2;

        wg = width2-wdth;
        wg=wg/2;

/*        if(ie)
        {
          alert(ie);
          $("#TB_window").css('padding-top', mg);
          $("#TB_window").css('padding-left', wg);
        }
        else
        {*/
          $("#TB_window").css('margin-top', mg);
          $("#TB_window").css('margin-left', wg);
//        }
/////ïîñ÷èòàëè

                      $('#TB_window').show();

                   $('#TB_window').append('<div id="pvideo"></div>');

                   flashembed("pvideo",
                     {
                            src:'/flash/FlowPlayerDark.swf',
                                   width: width,
                                   height: height
                     },
                     {config: {
                                   videoFile: '/video/'+filename,
                                   loop: false,
                                   autoPlay: false,
                                   showMenu: false,
                                   initialScale: 'scale',
                                   useNativeFullScreen: true,
                                   showPlayButton: true,
                                   showStopButton: false,
                                   showScrubber: true,
                                   showVolumeSlider: true,
                                   showMuteVolumeButton: true,
                                   showFullScreenButton: false,
                                   showMenu: false,
                                   autoBuffering: false
                     }}

              );

              $('#TB_window').prepend('<div id="close" style="background-color: black;" align="right"><a style="color: white;" onclick="closeme();return false;" href="#">çàêðûòü îêíî ?</a></div>');
}

//çàêðûâàåì ïîïàï
function closeme() {

  $('#pvideo').remove();
  $('#close').remove();  
  $('#TB_window').hide();
  $('#TB_overlay').hide();
}
