function runObj(string){
  if(string != undefined) {
    document.write(string);
  }
}

function onMoviePlay(movie) {
//  var Player = document.all["moviePlayer"];
  var Player = document.all.moviePlayer;

  if (Player.controls.isAvailable('Play')) {
    Player.controls.play();
    document.all.bu01.src = "../img/movie_play.gif";
    document.all.bu02.src = "../img/movie_stop.gif";
  } else {
    Player.controls.Pause();
    //document.all.paly_img.src = "http://www.blueb.co.kr/SRC/javascript/image5/movie/movie_player_bt2_17.gif";
    //document.all.paly_img.alt = "Àç»ý";
  }
}

function onMovieStop() {
  var Player = document.all["moviePlayer"];

  if (Player.controls.isAvailable('Stop'))    {
    Player.controls.stop();
	document.all.bu01.src = "../img/movie_play_ov.gif";
    document.all.bu02.src = "../img/movie_stop_ov.gif";
  }

}

function onMovieSoundoff() {
  var Player = document.all["moviePlayer"];
  if (Player.settings.volume == 0 ) {
    Player.settings.volume =  document.soundForm.volumnum.value;
    //document.all.soryButton.src = "http://www.blueb.co.kr/SRC/javascript/image5/movie/movie_player_bt2_10.gif";
  } else {
    document.soundForm.volumnum.value = Player.settings.volume;
    Player.settings.volume =  0 ;
    //document.all.soryButton.src = "http://www.blueb.co.kr/SRC/javascript/image5/movie/movie_player_bt_10.gif";
  }
}

function onMovieExpand() {
  FullSize();
}

var processTime;

function onMovieProcess() {

  try {
    var Player = document.all["moviePlayer"];
    var p;

    if( "object" != typeof(Player))
        return;

    if(0 > Player.controls.currentPosition) {
        p = 0;
    }
    else {
        p = parseFloat(parseInt(Player.controls.currentPosition) * 370 / parseInt(Player.currentMedia.duration));
    }

    if (0 < p && "undefined" != typeof(document.all.musicprocess)) {
        document.all.musicprocess.style.display = '';
        document.all.musicprocess.style.width = p * ((100-19)/100) ;
    }
    processTime = setTimeout('onMovieProcess()', 2000);
  }
  catch(e) {
    if(processTime > 0)    clearTimeout(processTime);
    return;
  }
}

function onInitVol() {
  ex = event.clientX;
  ey = event.clientY;

  volpx = vol.style.pixelLeft;
  volpy = vol.style.pixelTop;

  bDragCheck = true;

  document.onmousemove = onVolumnControl;
//  document.all.soryButton.src = "http://www.blueb.co.kr/SRC/javascript/image5/movie/movie_player_bt2_10.gif";

  if (document.all) {
    document.onmouseup = new Function('bDragCheck=false');
  }
}

/*function onVolumnControl() {
  if(bDragCheck) {
    var mPos = volpx + event.clientX - ex;

    if (mPos > -1 && mPos < 100) {
      document.all.vol.style.pixelLeft = mPos;
      var soundness = mPos - 14;
      if (-14 < soundness)    {
        var Player = document.all["moviePlayer"];
        Player.settings.volume = 10 + (soundness);
      }
      else if (-14 > soundness ) {
        var Player = document.all["moviePlayer"];
        Player.settings.volume =  0 ;
      }
    }

    return false;
  }
}*/

function onVolumnControl() {
  if(bDragCheck) {
    var mPos = volpx + event.clientX - ex;

    if (mPos > -1 && mPos < 60) {		//»ç¿îµå¹Ù ¿îµ¿ ¹üÀ§
      document.all.vol.style.pixelLeft = mPos;
      var soundness = mPos - 14;
      if (-14 < soundness)    {
        var Player = document.all["moviePlayer"];
        Player.settings.volume = 10 + (soundness);
      }
      else if (-60 > soundness ) {
        var Player = document.all["moviePlayer"];
        Player.settings.volume =  0 ;
      }
    }

    return false;
  }
}

var idI;
function onMovieProgress() {
  var Player = document.all["moviePlayer"];
  var cnt = Player.network.bufferingProgress;
  if(cnt >= 100) {
    window.clearInterval(idI);
  }
}

