var VideoPlayer = Class.create();
VideoPlayer.prototype = {
	initialize : function(obj) {
		this.scrollToolTip(obj);
	},
	scrollToolTip : function(obj) {
		this.createOption(obj);
		this.createScrollTimer();
	},
	createOption : function(obj) {
		var found = taskManager.find("Video Player");
		if(!found) return alert("실행 중인 비디오 플레이어가 없습니다. No video player is running");
		var btn = found.taskButton;
		this.option = {
			target : found,
			msg : "-----현재 표시 중인 비디오 명 : " + obj + "-----",
			x : btn.offsetLeft,
			y : btn.offsetTop + 64
		};
	},
	createScrollTimer : function(option) {
		if(this.timer) {
			this.timer.stop();
			this.timer = null;
		}
		this.timer = new Timer(function() {
			var msg = this.option.msg;
			if(msg.length > 0) {
				msg = msg.substring(1);
				this.option.msg = msg + msg.substring(0, 1);
			}
			this.option.target.tooltipElem.innerHTML = msg;
			this.option.target.showToolTip(this.option.x, this.option.y);
		});
		this.timer.option = this.option;
		this.timer.tick = 300;
		this.timer.iter();
	}
};
function setVideoName(name) {
	if(!window.aVideoPlayer) {
		window.aVideoPlayer = new VideoPlayer(name);
	} else {
		window.aVideoPlayer.scrollToolTip(name);
	}
}
