document.domain='ipop.co.kr';
function LogOut()
{
	var url='http://c.ipop.co.kr/popcgi/logout.cgi';
	top.document.location.replace( url );
}
function zOpenNotice(seq)
{
	zFormat = 'toolbar=no, scrollbars=no, directories=no, status=no, menubar=no, width=574, height=550';
	zWin = window.open('http://www.ipop.co.kr/cgi-bin/noticedetail.cgi?type=read&seq=' + seq, 'NoticeDetail', zFormat);
	zWin.focus();
}

function submitthis()
{
    iForm = document.subform;
    if(iForm.username.value == '')
    {
        alert('»ç¿ëÀÚID¸¦ ÀÔ·ÂÇÏÁö ¾ÊÀ¸¼Ì½À´Ï´Ù.');
        iForm.username.focus();
        return false;
    }

    else if(iForm.passwd.value == '')
    {
        alert('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏÁö ¾ÊÀ¸¼Ì½À´Ï´Ù.');
        iForm.passwd.focus();
        return false;
    }
    else
    {
		if(iForm.ssllogin.checked == true)
        	iForm.action='https://private.ipop.co.kr/cgi-bin/login.cgi';
		else
        	iForm.action='http://private.ipop.co.kr/cgi-bin/login.cgi';
        //iForm.action='http://private.ipop.co.kr/cgi-bin/login.cgi';
        iForm.submit();
        return false;
    }
}

function IDSave()
{
	var tf=document.subform.idsave;
	if( tf.checked==true ) tf.checked=false;
	else document.subform.idsave.checked=true;
}

function makeIdSearch()
{
    window.open("https://private.ipop.co.kr/member_order/member_idpw_search_v2.html","UserID","toolbar=no, status=0, scrollbars=0, resizable=no, width=510, height=580");
}

function home_getCookie(name)
{
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length )
	{       
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ) 
		{
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ) 
				endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}       
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
			break;  
	}       
	return "";
}
function initForm()
{
	var dsi = home_getCookie('dsi');
	if( dsi != '' ) return; 
	iForm = document.subform;
	var idsave = home_getCookie('idsave');
	if( idsave == 1 )
	{       
		iForm.idsave.checked=true;
	}       
	var username = home_getCookie('li');
	if( idsave == '1' )
	{       
		nameFocus();
		iForm.username.value=username;
		if( username == '' ) iForm.username.focus();
		else iForm.passwd.focus();
	}       
	else    
	{       
		iForm.username.focus();
	}       
}
function nameFocus()
{
	document.subform.username.style.backgroundImage = "";
}
function passFocus()
{
	document.subform.passwd.style.backgroundImage = "";
}

// GOM TV
function RunGom(url)
{ 
	if(ipopx.IsInstall)							// ¼³Ä¡µÉ¶§±îÁö ´ë±â
	{
		// ±âº» Á¤º¸ ¼¼ÆÃ
		ipopx.SetVersionURL("http://app.ipop.co.kr/gom/GrVersion.ini");
		ipopx.SetClassName("GomPlayer1.x");
		ipopx.SetProgramID("GOMPLAYER");			// º£Å¸ÀÌ¸é "GOMPLAYERBETA", Á¤½ÄÀÌ¸é "GOMPLAYER"

		// ÀÚµ¿ ¼³Ä¡ ¸·±â
		ipopx.bAutoInstall=0;
		ipopx.bSilentInstall=0;

		// °õ ½ÇÇà
		ipopx.Run("/nosetup", "", "");
		
		// ¸í·É¾î º¸³»±â
		ipopx.SendCommand("/showtv");					// tvÃ¢ ¿­±â
		var param = "/navtv \"" + url + "\"";			// tvÃ¢¿¡ ºê¶ó¿ìÂ¡ 
		ipopx.SendCommand(param);
	}
	else
	{
		var param = "RunGom(" + "\"" + url + "\"" + ")";
		setTimeout(param, 100);					// ¼³Ä¡ÇÒ¶§±îÁö Àç½Ãµµ.
	}
}


function OpenTV(url)
{
	// ipopx activex ¼³Ä¡ "½Ãµµ" ÇÏ±â
	ipopxInstall_gom();

	var realurl;
	realurl = "http://tv.ipop.co.kr/cgi-bin/index.cgi?gourl=" + escape(url);

	// sub ÇÔ¼ö ½ÇÇà..
	RunGom(realurl);
}

