
//-- ·Ñ¿À¹ö ÀÌ¹ÌÁö¿ë onmouseover="onImg(this)" onmouseout="offImg(this)"
function onImg(obj) {
	if (obj.className != "on") obj.src = obj.src.replace("_off.gif","_on.gif");
}
function offImg(obj) {
	if (obj.className != "on") obj.src = obj.src.replace("_on.gif","_off.gif");
}

// Main Menu //
function mainPromTab(id) {
	document.getElementById("popu_avi").style.display = "none";
	document.getElementById("popu_prg").style.display = "none";
	document.getElementById("popu_news").style.display = "none";
	document.getElementById(id).style.display = "block";
	document.getElementById("popu_avi_tab").src = document.getElementById("popu_avi_tab").src.replace("_on.gif","_off.gif");
	document.getElementById("popu_prg_tab").src = document.getElementById("popu_prg_tab").src.replace("_on.gif","_off.gif");
	document.getElementById("popu_news_tab").src = document.getElementById("popu_news_tab").src.replace("_on.gif","_off.gif");
	document.getElementById(id+"_tab").src = document.getElementById(id+"_tab").src.replace("_off.gif","_on.gif");
}

// //
function LayerTab(layer1,layer2){
	document.getElementById(layer1).style.display = "block";
	document.getElementById(layer2).style.display = "none";
}

// //
function LayerTab4(layer1,layer2,layer3,layer4){
	document.getElementById(layer1).style.display = "block";
	document.getElementById(layer2).style.display = "none";
	document.getElementById(layer3).style.display = "none";
	document.getElementById(layer4).style.display = "none";
}

// ¿ÀÇÂÃ¤³Î ½æ³×ÀÏÇü ¸®½ºÆ® ¿µ»óÁ¤º¸ on,off //
function snapLayerOn(obj) {
	obj.getElementsByTagName('div')[0].style.display = "block";
}
function snapLayerOff(obj) {
	obj.getElementsByTagName('div')[0].style.display = "none";
}

//-- ·Ñ¿À¹ö ¸®ºäµî±Þ onmouseover="onDivi(obj)" onmouseout="offDivi(obj)"
function onDivi(obj) {
	obj.getElementsByTagName('p')[0].style.display = "block";
}
function offDivi(obj) {
	obj.getElementsByTagName('p')[0].style.display = "none";
}

// id ¿¤¸®¸ÕÆ® display ¼³Á¤ 
function setDisplay(id,dp) {
	document.getElementById(id).style.display = dp;
}

// ·¹ÀÌ¾î on , off
// »ç¿ë¿¹ : layerDisplay(this,'layer','block');
//    obj : ·¹ÀÌ¾îÀÇ ºÎ¸ð°´Ã¼ 
//    cn  : ·¹ÀÌ¾îÀÇ class¸í
//    dp  : 'block' or 'none'
function layerDisplay(obj,cn,dp) {
	for(i=0;i<obj.childNodes.length;i++)
		if (obj.childNodes[i].className == cn) obj.childNodes[i].style.display = dp;
}

// tr ·Ñ¿À¹ö //
function fnBackColor(obj,color){
	obj.style.background = color;
}

function Login(){
	var returl = document.URL;
	returl = escape(returl);
	document.location.href = 'http://private.gomtv.com/cgi-bin/login.cgi?returl=' + returl;
}

function LoginGo(url)
{
	var returl = url;
	returl = escape(returl);
	document.location.href = 'http://private.gomtv.com/cgi-bin/login.cgi?returl=' + returl;
}
function adultLogin()
{
	var returl = document.URL;
	returl = escape(returl);
	document.location.href = 'http://private.gomtv.com/cgi-bin/adultCheck.cgi?returl=' + returl;
}

function Logout(){
	var returl = document.URL;
	returl = escape(returl);
	document.location.href = 'http://private.gomtv.com/cgi-bin/logout.cgi?returl=' + returl;
}

// cookie
function setCookie(name, value, expiredays, path, domain, secure) {
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	var curCookie = name + "=" + escape(value) +
     ((expiredays) ? "; expires=" + todayDate.toGMTString() : "") +
     ((path) ? "; path=" + path : "") +
     ((domain) ? "; domain=" + domain : "") +
     ((secure) ? "; secure" : "");
	document.cookie = curCookie;
}

// ¿ÀÇÂÃ¤³Î Æ÷½ºÅÍ ·¹ÀÌ¾î Ãâ·Â ÇÔ¼ö //
function initPosterView(width, height, pos) {
	var wrapObj   = document.getElementById('och_top');
	var divObj    = document.getElementById('poster_preview_layer');
	//var imgObj    = divObj.getElementsByTagName('IMG')[0];
	var pObj    = divObj.getElementsByTagName('P')[0];
	var iframeObj = divObj.getElementsByTagName('IFRAME')[0];
	divObj.style.display = "block";
	
	iframeObj.style.border = "0";
	iframeObj.width = width + 1;
	iframeObj.height = height;

	pObj.style.width = width;
	
	// class ¿¡ µû¶ó À§Ä¡ ¼³Á¤
	if (pos == "left") {
		divObj.style.left = "0";
	} else if (pos == "right") {
		//divObj.style.right = "0";
		divObj.style.left = wrapObj.offsetWidth - width;
	} else {
		divObj.style.left = (wrapObj.offsetWidth - width) / 2;
	}
	
	wrapObj.style.position = "relative";
	wrapObj.style.zIndex = "100";
	wrapObj.appendChild(divObj);
}

function hidePoster(seq){
	if (seq){
		var cName = 'gomtvPoster'+seq;
		setCookie(cName, 1, 1, '/', 'gomtv.com', '');
	}
	document.getElementById('poster_preview_layer').style.display='none';
}

//******************** text scroll *********************//
var roll_Class=function(){this.initialize.apply(this,arguments);} 
roll_Class.prototype={ 

initialize:function(){ 

this.className=arguments[0]?arguments[0]:null; 
this.foundit(arguments[1],'',false); 
this.contents=new Array('0'); 
this.contents_delay=null; 
this.nowdelay=null; 
this.foundit( 
this.roll.childNodes,this.foundvalue , 
function(rt,that){ 

if(that.constrain_size !== null) that.foundit(rt.childNodes,'IMG',function(rt,that){rt.style[(this.moving != 'left' ? 'width' : 'height')] = that.constrain_size;}); 
that.contents_delay=that.contents[that.contents.length]=that.contents_delay+-rt[(that.moving=='left'?'offsetWidth':'offsetHeight')];}); 

{ 
this.rollHeight=this.proll.style[(this.moving=='left'?'width':'height')]=Math.abs(this.contents[this.contents.length-1]); 
this.roll.appendChild(this.roll.cloneNode(true)); 
};}, 


foundit:function(tg,n){ 

var temp=new Array(); 

	for(var v in tg) 
		switch(typeof arguments[2]){ 
		case 'object':if(arguments[2].initialize(tg[v],n,this)==true) return; else break; 
		case 'function':if(tg[v].nodeName==n) arguments[2](tg[v],this); break; 
		case 'boolean':this[v]=tg[v]; break; 
		default:if(tg[v].nodeName==n) return tg[v]; 
	} 

return temp;}, 

inaction:function(time){ 

this.roll.style[this.moving]=time=time < 0 ?(this.fall==false && time <= -this.rollHeight?0:time):-this.rollHeight,null; 
this.foundit(this.contents,time,{initialize:function(rt,vrt,that){if(Math.abs(rt - vrt) <(that.fast==false?that.tick:that.ftick)){that.roll.style[that.moving]=rt; that.nowdelay=that.fast==true?that.lengthen:that.delay; that.fast=false; return true;} else that.nowdelay=that.lengthen;}}); 
{var ticks=this.fast==true?this.ftick:this.tick;} 
this.control=setTimeout(this.className+".inaction("+(parseInt(this.roll.style[this.moving])+(this.fall==true?ticks:-ticks))+");",this.nowdelay);}, 

stop:function(){ 

this.temp=parseInt(this.roll.style[this.moving]); 
clearTimeout(this.control);}    }; 
//******************** text scroll *********************//

// swf (remove IE border)
function showSwf(width, height, src, id, vars){
	var html = ''
	+ '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="'+id+'" width="'+width+'" height="'+height+'" align="middle">\n'
	+ '<param name="allowScriptAccess" value="always" />'
	+ '<param name="movie" value="'+src+'" />\n'
	+ '<param name="quality" value="high" />\n'
	+ '<param name="scale" value="exactfit" />\n'
	+ '<param name="wmode" value="transparent" />\n'
	+ '<param name="flashvars" value="'+vars+'" />\n'
	+ '<embed src="'+src+'" wmode="transparent" flashvars="'+vars+'" scale="exactfit" quality="high" width="'+width+'" height="'+height+'" id="'+id+'" name="'+id+'" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n'
	+ '</object>\n';
	document.write(html);
}

// search form check
function searchSubmit(){
	if (!document.getElementById('chSearchKey').value){alert('°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');document.getElementById('chSearchKey').focus();return false;}
}