/**************** warning *******************
this page only using english.
reason : UTF-8
*********************************************/

/******** core value preset ***********
* BT : broswer type
*   => value : IE, FF3, FF3, FF, Chr,Op, Sa
*   usage : if(BT == 'IE') { code }
*
* MWB : is mini web
*	=> value : boolean, true(miniweb) or false(web);
* MW : 
*   => value : string,  'app' or 'web'
*   usage
*	if(MW == 'app') { mini web js code }
*	else if(MW == 'web') { web js code }	
*
* onerror : window.onerror() overriding error msg 
**********************************/
//document.domain	= "gomtv.com";

var BT = (function x(){})[-5]=='x'?'FF3':(function x(){})[-6]=='x'?'FF2':/a/[-1]=='a'?'FF':'\v'=='v'?'IE':/a/.__proto__=='//'?'Saf':/s/.test(/a/.toString)?'Chr':/^function \(/.test([].sort)?'Op':'Unknown'; // Broswer Type
BT	= (navigator.userAgent.indexOf('safari') != -1) ? 'Sa' : BT;

var MWB	= /http:\/\/exp/g.test(document.URL) ? true : false;
var MW	= (MWB) ? "app" : "web";

onerror = function() {return;} 

/************* document.getElementById setting ***************
* name	: G  => Gretech or Gomtv 
* desc.	: DOM controller 
* function :
*		$ => set document.getElementById ; return G;
*		$L => document.location;
*		style => style setting, 
*			param. : object {id : 'div id'(optional), width : 100, height : 40, display : 'block'.......};
*		html	=> like xxx.innerHTML, 
*			param. : object { id : 'div id'(optional), content : '<table><tr><td>ad</td></tr></table>'};
*		ajaxRequest => ajax request
*			param. : object {url:,method:,param:,async,oncolplete:function()};
*		ajaxUpdate  => ajax update, like G.$(id).innerHTML;
*			param. : same request param;
*
* usage : 
*		G.$('asdf').style({display:'none'}).html({content:'gdgsdgfg');
*
*		G.$('asdf').html({content:'gdgsdgfg').style({display:'none'});
*
*		G.html({id : 'asdf', content:'gdgsdgfg'});
*
*		G.style({id : 'asdf', display:'none'});
*
*		G.ajaxRequest({
*			url : 'http://ch.gomtv.com/common/ajaxGet.gom',
*			param : 'intchid=111&intpid=222&intbid=333',
*			method : 'post',
*			oncomplete : function(request) {
*				var req = request.responseText;
*				alert(req);
*			}
*		}
*		G.$('test').ajaxUpdate({
*			url : 'http://ch.gomtv.com/common/ajaxGet.gom',
*			param : 'intchid=111&intpid=222&intbid=333',
*			method : 'post'
*		});
* 
**************************************/
var G	= {
/* private property */
	documentGid	: null,
	request	: null, //ajax request;
/* private method */
	setDocumentGid	: function(id) {
		this.documentGid	= document.getElementById(id);
		return this.documentGid;
	},
	getRequest : function() {
		if(BT != 'IE')
		{
			this.request	= new XMLHttpRequest();
		}
		else
		{
			try{
				this.request = new ActiveXObject("Msxml2.XMLHTTP");
			}catch(failed) {
				try{
					this.request = new ActiveXObject("Microsoft.XMLHTTP");
				}catch(failed){
					this.request = null;
				}
			}
		}
	},
/* public method */
	$ : function(id) {
		if(/^#/.test(id))
		{
			var tmpId	= id.replace(/#/, '');
			this.setDocumentGid(tmpId);
			return this.documentGid;
		}
		else
		{
			this.setDocumentGid(id);
			return this;
		}
	},
	B : document.body,
	insertBefore : function(val) {
		this.documentGid.insertBefore(val);
		return this;
	},
	val	: function(id) {
		if(id) 	this.setDocumentGid(id);
		return this.documentGid.value;
	},
	style : function(obj) {
		if(obj.id) {
			this.setDocumentGid(obj.id);
			for(var i in obj) {
				if(i != 'id')	this.documentGid.style[i]	= obj[i];
			}
		}
		else
		{
			for(var i in obj) {
				this.documentGid.style[i]	= obj[i];
			}
		}
		return this;
	},
	html : function(obj) {
		if(obj.id) this.setDocumentGid(obj.id);
		this.documentGid.innerHTML	= obj.content;
		return this;
	},
	href : function(url) {
		document.location.href = url;
	},
	replace : function(url) {
		document.location.replace(url);
	},
	ajaxRequest : function(obj) {
		this.getRequest();
		if(this.request == null)
		{
			alert("this broswer not suported ajax");
			return;
		}
		obj.method	= (obj.method == null || !obj.method) ? 'get' : obj.method;
		obj.async	= (obj.async == true || obj.async == false) ? obj.async : true;
		obj.param	= obj.param	? obj.param : "";
		if(obj.url) 
		{
			try
			{
				this.request.open(obj.method, obj.url, obj.async);
				this.request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
				this.request.send(obj.param);				
			}
			catch (crossDomain)
			{
				return; // cross domain;
			}
		}
		var completeFunction	= obj.oncomplete;
		var thisVal	= this;
		this.request.onreadystatechange = function() {
			switch (thisVal.request.readyState) 
			{
				case 0 :
				case 1 :
				case 2 :
				case 3 :
					break;
				case 4 :
				if (thisVal.request.status == 200) 
				{
					return completeFunction(thisVal.request);
				}
				else
				{
					alert("HTTP error: "+thisVal.request.status);
				}
				break;
			}
		}
	},
	ajaxUpdate : function(obj) {
		var thisValue	= this;
		obj.oncomplete = function(request) {
			thisValue.html({content : request.responseText});
		}
		this.ajaxRequest(obj);
	}
}

/**** login *********
* name : Login
* property :
*	adult	: 0(under 19), 1(over 19, search adult page), 2(over 19, common adult page)
*	url	: login page url;
*	target : web,app
*	rtnUrl : return url
*	state	: in, out
*	method : href, replace
* usage :
*	Login({
*		state : 'in', // login
*		adult : 1,
*		target : MW // mini web
*	});
********************/
Login = function(lObj) {
	lObj	= (lObj == null) ? new Object() : lObj;

	adult	= (lObj.adult)	? lObj.adult		: 0;
	target	= (lObj.target) ? lObj.target	: "web";
	rtnUrl	= (lObj.rtnUrl) ? escape(lObj.rtnUrl)	: escape(document.URL);
	state	= (lObj.state)	? lObj.state	: "in";
	method	= (lObj.method) ? lObj.method : "href";
	if(target == 'web')
	{
		url = (adult < 1) 
			? "http://private.gomtv.com/cgi-bin/log"+state+".cgi?returl=" + rtnUrl
			: "http://private.gomtv.com/cgi-bin/log"+state+".cgi?returl=" + rtnUrl + "&adult=" + adult;
	}
	else if(target == 'app')
	{
		url = (adult < 1) 
			? "http://private.gomtv.com/cgi-bin/log"+state+"_app.cgi?returl=" + rtnUrl
			: "http://private.gomtv.com/cgi-bin/log"+state+"_app.cgi?returl=" + rtnUrl + "&adult=" + adult;
	}
	G[method](url);
}

/** Login old version compatibility **/
Logout		= function(){Login({state:'out'});}
adultLogin	= function() {Login({state : 'in', adult : 1, target : MW});}
LoginGo		= function(url){Login({rtnUrl : url});}
/***************************************/


/**** flash write *********
* param : object 
*	=> key : flash parameter name, value : flash parameter value
* usage :
*	var video	= new Flash({
*		id : "GPlayer",
*		movie : "http://ch.gomtv.com/player/gomflash.swf?pid=24845&bid=248975",
*		bgcolor : "#000000",
*		width	: "416",
*		height	: "385",
*		allowFullScreen	: 'true'
*	});
*
*	video.resize({
*		width : 700,
*		height : 100
*	});
**************************/
Flash	= function(obj) {
	this.objects	= "";
	this.embed	= "";
	this.instance	= null;
	this.tag	= obj;

	if(typeof obj == "object")
	{
		this.tag.id		= this.tag.name	? this.tag.name	: this.tag.id;
		this.tag.name	= this.tag.id	? this.tag.id	: this.tag.name;
		this.tag.allowScriptAccess= this.tag.allowScriptAccess	? this.tag.allowScriptAccess	: "always";
		this.tag.allowFullScreen	= this.tag.allowFullScreen	? this.tag.allowFullScreen	: "false";
		this.tag.quality	= this.tag.quality	? this.tag.quality	: "high";
		this.tag.width	= this.tag.width ? this.tag.width : 0;
		this.tag.height	= this.tag.height ? this.tag.height : 0;
		this.tag.movie	= this.tag.src	? this.tag.src	: this.tag.movie;
		this.tag.src	= this.tag.movie? this.tag.movie: this.tag.src;
		this.tag.target	= this.tag.target ? this.tag.target : null;
		this.objects	= "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'  type='application/x-shockwave-flash' width='"+this.tag.width+"' height='"+this.tag.height+"' id='"+this.tag.id+"'>\n";

		this.embed		= "<embed type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' ";

		for(var key in this.tag)
		{
			if(this.tag[key] && key !='target')
			{
				if(key != 'src' && key !='width' && key !='height' && key !='id' && key !='name')
					this.objects += "<param name='"+key+"' value = '"+this.tag[key]+"'>\n";
				if(key != 'movie' && key !='id')
					this.embed += key + " = '" + this.tag[key] + "' ";
			}
		}
		this.embed	+= " /></object>";
		this.instance	= (BT == 'IE') ? window[this.tag.id] : document[this.tag.id];
		if(this.tag.target != null)
		{
			alert(this.objects+this.embed);
			var newElem	= document.createElement(this.objects+this.embed);
			G.$('#'+this.tag.target).insertBefore(newElem);
		}
		else
		{
			document.write(this.objects+this.embed);
		}
	}
	else
	{
		return;
	}
}

Flash.prototype	= {
	resize : function(obj)
	{
		this.instance.style.width	= (obj.width) ? obj.width : this.tag.width;
		this.instance.style.height	= (obj.height) ? obj.height : this.tag.height;
	}
}

/******** cookie controll ***********
* param :
*		get(name) => cookie name
*		set(object) => { cookieName : 'name', { day or hour or minute : 'vaelu'}};
* usage :
*	GCookie.get(cookie name);	// get cookie
*	GCookie.set({				// set cookie
*		'cookie name' : 'cookie value',
*		'expire' : { day : '1'} or {hour : 23} or {minute : 58}
*	}); 
*************************************/
var GCookie	= {
// public
	get : function(name) {
		var arg = name + "=";
		var alen = arg.length;
		var clen = document.cookie.length;
		var i = 0;
		var j = 0;
		while(i < clen){
			j = i + alen;
			if (document.cookie.substring(i, j) == arg)
				return this.getCookieVal(j);
			i = document.cookie.indexOf(" ", i) + 1;
			if(i == 0)
			break;
		}
		return null;
	},
	set : function(obj)	{
		this.setCookieVal(obj);
	},
// private
	getCookieVal : function(offset) {
	   var endstr = document.cookie.indexOf(";", offset);
	   if(endstr == -1){
		   endstr = document.cookie.length;
	   }
	   return unescape(document.cookie.substring(offset, endstr));
	},
	setCookieVal : function(obj) {
		if(obj.expire) {
			if(obj.expire.day || obj.expire.hour || obj.expire.minute)
			{
				var date	= new Date();
				if(obj.expire.day)		date.setTime(date.getTime()+(obj.expire.day*24*60*60*1000));
				if(obj.expire.hour)		date.setTime(date.getTime()+(obj.expire.hour*60*60*1000));
				if(obj.expire.minute)	date.setTime(date.getTime()+(obj.expire.minute*60*1000));
				var expires = "; expires="+date.toGMTString();
			}
			else
			{
				expires	= "";
			}
		}
		else
		{
			expires	= "";
		}
		document.cookie = obj.name + '=' + obj.value + expires + '; domain = .gomtv.com; path=/;';
	}
};

/**** get gox data *********
* param : object
*	common
*		{source:,uip:user ip,dsi:login cookie ,isweb:,isnav:,navurl:, ajaxUrl : get GoxUrl url, 
*			type : 'movie' or 'channel'...., callBack : function(array) { parameter array is gox url, after goxUrl get}}
*	movie or drame 
*		{dispid,vodid,part,level,serv}
*	clip
*		{dispid:, clipid:}
*	news
*		{newsid:}
*	live
*		{liveid:,chnum:,}
*	channel
*		{chid:, pid:,bid:,bjvid:,level}
* usage :
*	new Gox({
*		ajaxUrl : 'http://ch.gomtv.com/common/getGoxUrl.gom',
*		type : 'channel',
*		chid : 10170,
*		pid : 1234,
*		bid : 123245,
*		bjvid : 11235,
*		level : 1,
*		dsi : GCookie.get('dsi') ? GCookie.get('dsi') : 0,
*		uip : '221.148.56.127',
*		callBack : function(array) {
*			alert(array);
*		}
*	});
*	multi play : using array;
*	new Gox({
*		ajaxUrl : 'http://ch.gomtv.com/common/getGoxUrl.gom',
*		type : 'channel',
*		chid : [10170, 10170, 10170], // using array
*		pid : [21903, 21903,21903], // using array
*		bid : [233082,233082,233082], // using array
*		bjvid : [141654,141654,141654], // using array
*		level : [1,1,4], // using array
*		dsi : GCookie.get('dsi') ? GCookie.get('dsi') : 0,
*		uip : '221.148.56.127',
*		callBack : function(array) {
*			alert(array);
*		}
*	});
**************************/
Gox	= function(obj) {
	this.onlyIE	= (obj.onlyIE == 'n') ? false : true;
	this.type	= obj.type ? obj.type : null;
	this.ajaxUrl	= obj.ajaxUrl ? obj.ajaxUrl : null;
	this.parameter	= "&";
	this.callBack	= obj.callBack ? obj.callBack : function() {return;};
	this.errorCallBack	= obj.errorCallBack ? obj.errorCallBack : false;
	obj.isweb	= (MW == 'app') ? 0 : 1;
	obj.isnav	= obj.isnav	? obj.isnav : 1;
	obj.navurl	= obj.navurl ? obj.navurl : "";
	obj.source	= obj.source ? obj.source : "";
	this.dsi		= obj.dsi	? obj.dsi : GCookie.get('dsi');
	this.parameter	+= "dsi=" + this.dsi + "&";
	this.goxUrl = [];
	this.errorMsg	= [];
	for(var key in obj)
	{
		if(key !='type' && key != 'ajaxUrl' && key !='callBack' && key !='dsi')
		{
			if(obj.key instanceof Array)
			{
				for(var i in obj[key])
				{
					obj[key]	+= obj[key][i] + ",";
				}
			}
			this.addItem(key, obj[key]);
		}
	}
	this.parameter	= this.parameter.replace(/&/g, "|||||");
	if(this.onlyIE) {
		if(BT == 'IE') {
			this.sendParam();
		}
	}
	else
	{
		this.sendParam();
	}
}

Gox.prototype = {
	addItem : function(key, value) {
		this.parameter += key + '=' + value + '&';
	},
	sendParam : function() {
		thisValue	= this;
		G.ajaxRequest({
			url : this.ajaxUrl,
			param : "param="+this.parameter + '&property='+this.type,
			method : 'post',
			oncomplete : function(req) {
//				var tmpRtn	= {gox : { error : 0}};
				var tmpRtn	= eval( "(" + req.responseText + ")" );
				thisValue.callBack(tmpRtn);
				/*
				if(tmpRtn.gox.url)
				{
					var cnt	= tmpRtn.gox.url.length;
					for(var i=0;i<cnt;i++)
					{
						thisValue.goxUrl[i] = tmpRtn.gox.url[i];
					}
				}
				if(tmpRtn.gox.error != 0)
					thisValue.goxUrl[0] = tmpRtn.gox.error;
				alert(thisValue.goxUrl[0]);
				thisValue.callBack(thisValue.goxUrl);
				*/
			}
		});
	}
}

/**** play gomtv *********
* param : Object
*	common
*		{source:,uip:user ip,dsi:login cookie ,isweb:,isnav:,navurl:, 
*			type : 'movie' or 'channel'...}
*	movie or drame 
*		{dispid,vodid,part,level,serv}
*	clip
*		{dispid:, clipid:}
*	news
*		{newsid:}
*	live
*		{liveid:,chnum:,}
*	channel
*		{chid:, pid:,bid:,bjvid:,level}
* usage :
*	new Play({
*		type : 'channel',
*		chid : 10170,
*		pid : 1234,
*		bid : 123245,
*		bjvid : 11235,
*		level : 1
*	});
*	multi play : using array;
*	new Play({
*		type : 'channel',
*		series : true,
*		id0s : [10170, 10170, 10170], // using array
*		id1s : [21903, 21903,21903], // using array
*		id2s : [233082,233082,233082], // using array
*		id3s : [141654,141654,141654], // using array
*		level : [1,1,4], // using array
*		navurl : "http://www.daum.net"
*	});
**************************/
Play	= function(obj) {
	this.hiddenlyr	= obj.hiddenlyr ? obj.hiddenlyr : "hiddenlyr";
	this.parameter	= "";
	this.baseUrl	= obj.baseUrl ? obj.baseUrl : "http://tv.gomtv.com/cgi-bin/launcher/";
	this.type		= obj.type ? obj.type : null;
	this.series		= obj.series ? obj.series : false;
	if(this.series)
	{
		this.launcher	= this.baseUrl + "series_set.cgi";
		switch(this.type) {
			case 'channel' : this.type = 10000;break;
			case 'movie' : this.type = 100;break;
			case 'drama' : this.type = 110;break;
			case 'clip' : this.type = 200;break;
			case 'news' : this.type = 300;break;
			case 'live' : this.type = 500;break;
		}
	}
	else
	{
		if(this.type !='null')	
			this.launcher	= this.baseUrl + "launcher_"+this.type+".cgi";
		else	
			alert('play type not setted');
	}
	this.callBack	= obj.callBack ? obj.callBack : function() {return;};
	obj.isweb	= (MW == 'app') ? 0 : 1;
	obj.isnav	= obj.isnav	? obj.isnav : 1;
	obj.navurl	= obj.navurl ? obj.navurl : "";
	obj.source	= obj.source ? obj.source : "";
	for(var key in obj)
	{
		if(key !='type' && key !='callBack')
		{
			if(obj.key instanceof Array)
			{
				for(var i in obj[key])
				{
					obj[key]	+= obj[key][i] + ",";
				}
			}
			this.addItem(key, obj[key]);
		}
	}
	if(this.series) {
		this.addItem('type', this.type);
	}
	this.parameter	= this.parameter.substring(0, this.parameter.length-1);
//	alert(this.launcher+"?"+this.parameter);
	G.$(this.hiddenlyr).html({
		content : "<iframe name='runframe' id='runframe' src="+this.launcher+"?"+this.parameter+" widht=0 height=0></iframe>"});
}

Play.prototype = {
	addItem : function(key, value) {
		this.parameter += key + '=' + value + '&';
	}

}


/******** book mark *************
* param : Object
*
*		{type : 'movie' or 'channel', 'oncomplete' : complete callback function, 'ajaxUrl':ajax url}
*	movie or drame 
*		{dispid}
*	news
*		{newsid:}
*	live
*		{liveid:}
*	channel
*		{intchid:,intpid:,intbid:,intcateid:}
* usage :
*	var scrap	= new scrap({
*		ajaxUrl : http://ch.gomtv.com/~~
*	});
*	scrap.set({
*		'type' : 'channel',
*		'intpid'	: intpid,
*		'intbid'	: intbid,
*		'intcateid' : intcateid,
*		'oncomplete' : setBookMarkResult
*	});
**************************/
BookMark = function(obj) {
	this.ajaxUrl	= obj.ajaxUrl ? obj.ajaxUrl : null;
	this.param	= "";
	for(var key in obj)
	{
		if(key != 'ajaxUrl' && key != 'oncomplete')
		this.param	+= key + "=" + obj[key] + "&";
	}
}

BookMark.prototype = {
	set : function(obj) {
		this.ajaxUrl	= obj.ajaxUrl ? obj.ajaxUrl : this.ajaxUrl;
		for(var key in obj)
		{
			if(key != 'ajaxUrl' && key != 'oncomplete')
				this.param	+= key + "=" + obj[key] + "&";
		}
		this.param	= this.param.substring(0, this.param.length-1);
		if(this.ajaxUrl != null)
		{
			G.ajaxRequest({
				url : this.ajaxUrl,
				param : this.param,
				method : "post",
				oncomplete : obj.oncomplete
			});
		}
		else
		{
			alert("url not setted");
		}
		this.param	= "";
	},
	del : function(obj) {
		this.ajaxUrl	= obj.ajaxUrl ? obj.ajaxUrl : this.ajaxUrl;
		G.ajaxRequest({
			url : this.ajaxUrl,
			param : "mode=delete&intseq="+obj.intseq,
			method : "post",
			oncomplete : obj.oncomplete
		});
	},
	get : function(obj) {
		return;
	}
}

/********** gomtvx install **************
*/

gomtvxInstall = function() {
	var msg	= "Áö±Ý Á¢¼ÓÇÏ½Å ºê¶ó¿ìÀú´Â ÇöÀç Áö¿øÇÏÁö ¾Ê°í ÀÖ½À´Ï´Ù.";
	msg	= (BT == 'IE' || BT == 'FF' || BT == 'FF3') ? "" : msg;
	if(G.$('#gomtvx')) return;
	else 
	{
		if(msg != "") {
			alert(msg);
			return;
		}
		if(BT == 'IE')
		{
			var str="<OBJECT ID='gomtvx' WIDTH=0 HEIGHT=0 CLASSID='CLSID:BBFD2D10-EC6E-4259-91D1-1E38C826E5E2' codebase='http://app.gomtv.com/gomtv/gomtvx.cab#version=1,0,0,1'></OBJECT>";
    		document.body.insertAdjacentHTML('beforeEnd', str );
		}
		else
		{
			HTMLElement.prototype.insertAdjacentElement = function(where,parsedNode){ 
				switch (where){ 
					case 'beforeBegin': 
						this.parentNode.insertBefore(parsedNode,this) 
						break; 
					case 'afterBegin': 
						this.insertBefore(parsedNode,this.firstChild); 
						break; 
					case 'beforeEnd': 
						this.appendChild(parsedNode); 
						break; 
					case 'afterEnd': 
						if (this.nextSibling) this.parentNode.insertBefore(parsedNode,this.nextSibling); 
						else this.parentNode.appendChild(parsedNode); 
						break; 
				} 
			} 

			HTMLElement.prototype.insertAdjacentHTML = function(where,htmlStr) { 
				var r = this.ownerDocument.createRange(); 
				r.setStartBefore(this); 
				var parsedHTML = r.createContextualFragment(htmlStr); 
				this.insertAdjacentElement(where,parsedHTML) 
			}     

			HTMLElement.prototype.insertAdjacentText = function(where,txtStr){ 
				var parsedText = document.createTextNode(txtStr) 
				this.insertAdjacentElement(where,parsedText) 
			} 

			var str="<OBJECT ID='gomtvx' WIDTH=0 HEIGHT=0 type='application/gomtvx-plugin,version=1.0.0.2' codebase='http://app.gomtv.com/gomtv/GOMTVXNIESETUP.EXE'></OBJECT>";
			document.body.insertAdjacentHTML('beforeEnd', str);
		}
	}	
}
gsocketInstall	= function() {
	if(G.$('#gsocket')) {
		return;
	}
	else
	{
		var str="<OBJECT ID='gsocket' WIDTH=0 HEIGHT=0 CLASSID='CLSID:7DC79AE8-4C0D-4327-A459-F6F32358462C' codebase='http://app.gomtv.com/gomtv/gomtvx.cab#version=1,0,0,1'></OBJECT>";
    	document.body.insertAdjacentHTML('beforeEnd', str );
	}
}

/********* gomtv ax install *********
* param : object 
*	{ classId : 'WebCtl', target : display area element id }
* usage : 
*	var gax = new GomtvAx({
*		target : "tempArea",
*		id		: 'WebCtl' or not
*	})
*	
*	gax.init();
*	gax.addGoxUrl('http://xxxx');
*	gax.play();
* event : 
*	1. player stop event;
*	<script language="javascript" for="WebCtl" event="MediaPlayEnd()">
*		alert("MediaPlayEnd");
*	</script>
*/
GomtvAX	= function(obj) {
	this.width	= obj.width ? obj.width : '600';
	this.height	= obj.height ? obj.height : '380';
	this.isInstall	= false;
	this.installCheck();
	this.repImg	= obj.repImg ? obj.repImg : "http://adimg.gomtv.com/cgi-bin/imgview.cgi?type=0&nid=2954";
	this.classId	= (BT == 'IE' && this.installCheck()) 
		? (obj.id ? obj.id : "WebCtl") : null;
	this.target		= obj.target ? obj.target : G.B;
}

GomtvAX.prototype	= {
	installCheck	: function() {
		if(BT == 'IE')
		{
			try
			{
				var nObj	= new ActiveXObject("GomTVWeb.WebCtl.1");
				this.isInstall	= nObj ? true : false;
			}
			catch (e)
			{
				this.isInstall = false;
			}
		}
		else
		{
			this.isInstall = false;
		}
		return this.isInstall;
	},
	resize	: function(obj) {
		this.width	= obj.width;
		this.height	= obj.height;
	},
	write : function() {
		if(BT == 'IE')
		{
			var newElem	= document.createElement("<OBJECT ID='"+this.classId+"' type='application/x-oleobject' CLASSID='CLSID:36E5F486-B4EF-4D21-85E0-C58EBAA81A30' codebase='http://app.gomtv.com/ce/gomtvax/bin/gomtvax.cab#version=1,0,0,16' width = '"+this.width+"' height = '"+this.height+"'><param name='type' value='1' /></OBJECT>");
			G.$('#'+this.target).insertBefore(newElem);
		}
		else
		{
//			var newElem	= document.createElement("<img src='"+this.repImg+"' />");
			var newElem	= document.createElement("img");
			newElem.setAttribute("src", this.repImg);
			//newElem.setAttribute("width", 600);
			//newElem.setAttribute("height", 400);
			G.$('#'+this.target).appendChild(newElem);
		}
	},
	init : function() {
		this.clearUrl();
	},
	clearUrl	: function() {
		try
		{
			if(G.$('#'+this.classId) && this.isInstall) {
				G.$('#'+this.classId).ClearURL();
			}			
		}
		catch (e1)
		{
		}
	},
	onStop : function() {
		alert("stop");
	},
	addUrl	: function(url) {
		if(G.$('#'+this.classId) && this.isInstall) {
			G.$('#'+this.classId).AddURL(url);
		}
	},
	addGoxUrl : function(url) {
		try
		{
			if(G.$('#'+this.classId) && this.isInstall) {
				G.$('#'+this.classId).AddGoxURL(url);
			}
		}
		catch (e1)
		{
		}
	},
	play	: function() {
		try
		{
			if(G.$('#'+this.classId) && this.isInstall) {
				G.$('#'+this.classId).DirectPlay();
			}			
		}
		catch (e1)
		{
		}
//		G.$('#'+this.classId).DirectPlay();
	},
	addAxFace : function(url) {
		try
		{
			if(G.$('#'+this.classId) && this.isInstall)
			{
//				alert(url);
				G.$('#'+this.classId).SetAxFace(url);
			}
		}
		catch (e1)
		{
		}
	}
}