	// 플레이 초기화
	function flvPlayStart(kind, json) {
		this.imsyAutoPlay = false;

		if (kind == "play") {
			chPlayer.setflv(json);

			// 영상 힛트수 높히기
			if(hitDelay == false) {
				hitDelayInterval = setTimeout(function() {	// 채널 최초 로딩시 브라우저 죽는 현상 대처를 위해 적용 : alan - 20080822
					hitDelay = true;
					prgHitAction();
				}, 3000);
			} else {
				prgHitAction();
			}

			setTimeout( function () {
				watchedVideo();	// 최근본 동영상에 담기
			}, 1000);

		} else {
			chPlayer.onPlay();
		}
	}

	// time to seconde : 00:00:00 --> 0
	function getTime2Sec(argTime) {
		var sec = 0;
		var tmp = argTime.split(":");
		var len = tmp.length - 1;
		for(var i=len;i>=0;i--) {
			switch(len-i) {
				case 0 : sec = parseInt(tmp[i], 10);
					break;
				case 1 : sec += parseInt(tmp[i], 10) * 60;
					break;
				case 2 : sec += parseInt(tmp[i], 10) * (60 * 60);
					break;
			}
		}
		return sec;
	}

	/* MO Start ****************************************************************/
	var chMO = {
		 panset : "on"
		, _res       : null
		, _Imgres       : null
		, mi         : 0
		, mj         : 0
		, mk         : 0
		, snum       : ""
		, csnum      : ""
		, oldsum     : ""
		, dt         : new Date()
		, delaytime  : 21000
		, gettime    : 10100
		, inittime   : 1000
		, xsize      : 11
		, xborder    : 1
		, xdraw      : 1
		, tid1       : null
		, tid2       : null
		, tid3       : null
		, tid4       : null
		, tid5       : null
		, msc        : null
		, adMsg		: new Array()
		, imgpath	: "http://imgcdn.pandora.tv/static/"
		, currentShowLogo : 0
		, callback : function() {
		}
		, mo_stop : function () {
			var obj = this;
			try {
				this.clearCheck();
			} catch (e) {
				this.tid2 = setTimeout( function () { obj.mo_stop(); }, 2000);
			}
		}
		, mo_play : function () {
			this.mo_stop();
			if(this.panset == "off") {
				this.show_logo(0);
			} else {
				this.getImg();
				//this.writeHtml();
				this.show_logo(1);
			}
		}
		, writeHtml : function () {	// 메세지 출력
			try {
				var obj = this;
				this.mj++;
				this.csnum = GetCookie("snum");
				this.msc = this.dt.getSeconds() + "" + this.dt.getMilliseconds();

				//getMo("snum");

				if ((this.snum != this.oldsnum || this.mj < 2) && (this.snum != "" && this.csnum != this.snum)) {
					//this.getMo("msg");
				} else if(this.mj < 2) {
					this.initMsg();
				}

				if(this.mj < 2) {
					this.tid1 = setTimeout( function () { obj.writeHtml(); }, this.inittime);
				} else {
					clearTimeout(this.tid1);
					this.tid2 = setTimeout( function () { obj.writeHtml(); }, this.gettime);

				}
			} catch (e) {
				alert('writeHtml error');
			}
		}
		, initMsg : function () {	// 메세지 초기화
			document.getElementById("flvPlayer").setMo("blank");
		}
		, getImg : function () {
			var targetUrl   = "";
			targetUrl   =  "/php/mo/logo.ptv";

			$.post(targetUrl, function(data){
				if(data.length >0) {
					this._Imgres = data;

					if(this._Imgres != undefined) {
						var imgStr = "";
						for(var z=0; z<this._Imgres.length; z++) {
							imgStr = imgStr + this._Imgres[z] + ';';
						}
						imgStr = imgStr.substring(0, imgStr.length-1);
						var obj = this;
						var b_setting = "";
						if(this.panset == "off") {
							chMO.show_logo(0);
						} else {
							var moBannerImg = "http://imgcdn.pandora.tv/static/mo_1won.swf;http://imgcdn.pandora.tv/static/mo_8800_2008.swf?200803131802";
							var moBannerUrl = "http://mobile.pandora.tv/8800/?mpage=sms;http://mobile.pandora.tv/8800/teletext/?mpage=broad";
							b_setting = '{"b_url":"'+moBannerImg+'","b_clickURL":"'+moBannerUrl+'","b_screen":"true;true;true","b_rollingTime":"5;5;5"}';
							document.getElementById("flvPlayer").setMo("banner", b_setting);
							chMO.show_logo(0);
						}
					}
					clearTimeout(this.tid4);
				}
			});
		}
		, show_logo : function (num) {
			if(num == 1) {
				this.currentShowLogo = 1;
			} else {
				this.currentShowLogo = 0;
			}
		}
		, clearCheck : function () {
			try {
				document.getElementById("flvPlayer").stopMo("all");
				clearTimeout(this.tid1);
				clearTimeout(this.tid2);
				clearTimeout(this.tid3);
				clearTimeout(this.tid4);
			} catch (e) {
				//alert('error');
			}
		}
	}
	/* MO End ****************************************************************/

	/* PLAYER End ****************************************************************/
	var chPlayer = {
		flvInfo : null
		, onPlay : null
		, PLAYER : document.getElementById("flvPlayer")
		, options : {}
		, etcInfo : {}
		, isAutoBreak : null
		, target : 'divPlayer'
		, auto : 'off'
		, mo : 'on'
		, chmenu : 'video'
		, playerLoad : 0
		, callback : function() {
		}
		, setflv : function(param) {

			this._encode = [
				{ code:'30010', value:'0' },  //재생가능
				{ code:'30003', value:'0' },  //재생가능
				{ code:'30007', value:'0' },  //재생가능 (블라인드 처리 된거 채널 주인일때만 보임)
				{ code:'30002', value:'-2' }, //인코딩중
				{ code:'30001', value:'-3' }  //인코딩실패
			];
			this.flvInfo = param;

			for(var i=0; i<this._encode.length; i++) {
				if(this.flvInfo['encode'] == this._encode[i]['code']) {
					switch(parseInt(this.flvInfo['encode'], 10)) {
						case 30003 : this.options['level'] = {code:this._encode[i]['value'], url:""};
							break;
						default :
								this.options['level'] = {code:this._encode[i]['value'], url:"http://imgcdn.pandora.tv/gimg/player/new_ch_wait_other.swf"};
							break;
					}
					break;
				}
			}

			this.onPlay();
		}
		, onPlay : function() {
				try
				{
					if(!document.getElementById("flvPlayer")) {
						return;
					} else {
						//chMO.mo_play();
						this.isAutoBreak = true;
						if(this.options['level']['code'] != 10018) this.isAutoBreak = false;
						this.isPlaying = false;

							// smith.oh 추가 2008-07-08
							if (this.flvInfo['runtime'] && this.flvInfo['runtime'].toString().indexOf(":") > -1) {
								var runtime = this.flvInfo['runtime'] ? getTime2Sec(this.flvInfo['runtime']) : 0;
							} else {
								var runtime = this.flvInfo['runtime'];
							}

							var adInfo = {
											icf:['noicf'],
											buffer:{type:'nobuffer', url:''},
											middle:'nomiddle',
											slideCF:['noslide'],
											inner:"on",
											still:['nostill'],
											stillTime:2
										};

							var scrsize = this.flvInfo['scrsize'] ? this.flvInfo['scrsize'].split("*") : new Array(448, 336);	// 영상의 가로*세로 해상도

							var fixedDay = 1;
							if(this.flvInfo["prgRegDate"]) {
								var oDate1 = 20080801;	// 8월 1일
								var oDate2 = 20080914;	// 9월 14일
								var oDate = this.flvInfo["prgRegDate"].replace(/-/g, "");
								if(oDate1 <= oDate && oDate2 >= oDate) fixedDay = 0;
							}

							var vodInfo = {
								exception:this.options['level'],
									vodUrl:parseInt(this.flvInfo['vod_svr'], 10) == 88 ? this.flvInfo['flv'].replace('.pandora.tv', '2.pandora.tv'): this.flvInfo['flv'], // flvcdn.pandora.tv --> flvcdn2.pandora.tv, flvg.pandora.tv --> flvg2.pandora.tv
									prgid:this.flvInfo['prgid'],
									title:this.flvInfo['title'],
									chname:this.flvInfo['chname'],
									embed:this.flvInfo['embed'],
									userid:this.flvInfo['userid'],
									filesize:this.flvInfo['filesize'],
									fid:this.flvInfo['fid'],
									runtime:runtime,
									vodWidth:((scrsize[0] == undefined || scrsize[0] == 0 || scrsize[0] == "") ? ((this.flvInfo['isHD'] == 2) ? 1280: 448) : scrsize[0]),
									vodHeight:((scrsize[1] == undefined || scrsize[1] == 0 || scrsize[1] == "") ? ((this.flvInfo['isHD'] == 2) ? 720: 336) : scrsize[1]),
									isHD:((this.flvInfo['isHD'] == 2) ? "on":"off"),
									isMP4:(this.flvInfo['isHD'] == 1 || this.flvInfo['isHD'] == 2) ? "on" : "off",
									regDay:this.flvInfo['reg_date'],//this.getRegDay(this.flvInfo['reg_date']),
									gRegDay:this.flvInfo['greg_date'],//this.getRegDay(this.flvInfo['reg_date']),
									category:this.flvInfo['categ'],
									isAdult:(parseInt(this.flvInfo['isAdult'], 10) < 19 ? 0 : 1),
									orgPrgid:((this.flvInfo['orgPrgid'] > 0) ? this.flvInfo['orgPrgid'] : this.flvInfo['prgid']),
									orgChUserid:this.flvInfo['orgChUserid'],
									fixedDay:fixedDay
							};

							if ($.browser.opera == true) var browser = "OP";
							else var browser = "IE";

							/* 멀티비트 (Ray.Kim : 2010-08-10) */
							this.etcInfo['multibitrateVLD']	= this.flvInfo['multibitrateVLD'] ;
							this.etcInfo['multibitrateLD']	= this.flvInfo['multibitrateLD'] ;
							this.etcInfo['multibitrateSD']	= this.flvInfo['multibitrateSD'] ;
							this.etcInfo['multibitrateHD']	= this.flvInfo['multibitrateHD'] ;

							this.etcInfo['miniInst']		= "off" ;
							this.etcInfo['miniPlay']		= "off" ;
							this.etcInfo['login']			= (this.flvInfo['userid']) ? "on" : "off" ;
							this.etcInfo['classType']		= chInfoJson['classType'] ;
							this.etcInfo['countryCode']		= chInfoJson['ipCountry'] ;
							this.etcInfo['languageCode']	= chInfoJson['clientLang'] ;
							this.etcInfo['browser']			= browser ;

							document.getElementById("flvPlayer").init_Load_Info(adInfo, vodInfo, this.etcInfo);
					}
				}
				catch (e)
				{
					if (this.playerLoad < 10) {
						this.playerLoad++;
						setTimeout(function () {
							chPlayer.onPlay();
						}, 10);
					} else {
						//location.reload();
					}
				}
		}
		, endPlay : function(){
				alert('endPlay');
		}
		, isPlay : function() {
			return this.isPlaying;
		}/*,
		clickFlashInstall : function() {
			alert('clickFlashInstall');
		}
		, exceptionPlay : function() {
			alert('exceptionPlay : function() {');
		}
		, endVod : function(flg){
			alert('endVod : function(flg){');
		}
		, startVod : function() {
			alert('startVod');
		}
		, endIcf : function(cntICF) {
			alert("endIcf");
		}
		, setAutoPlay : function(flag){
			alert('setAutoPlay');
		}
		,getVodUrl : function(){
			alert('getVodUrl');
		}
		,setCupi : function(cnt) {
			alert('setcup');
		}
		, getRegDay : function(strDate) {
			alert('getRegDay');
		}
		,icfPlay : function(icfInfo) {
			alert('icfPlay : function(icfInfo) {');
		}
		, _isExist: function() {
			alert('_isex');
		},
		chkFlashVer : function() {
			alert('flashver');
		}
		, setCompleted : function(arg){
			alert('setcomplete');
		}
		, phoneSend : function() {
			alert('phonesend');
		}
		, endPlay : function() {
			alert("endplay");
		}
		, openHD : function() {
			alert('openHD');
		}
		, setIni : function() {
			alert('setIni');
		}
		, ax2flash : function() {
			alert('ax2flash');
		}
		, adOpenTag : function() {
			alert('adOpenTag');
		},
		getFlashVer : function() {
			alert('	getFlashVer : function() {');
		}*/
	}
