function check(field,event) {
  var keyCode = event.keyCode ? event.keyCode :
                event.which ? event.which : event.charCode;

 if ( keyCode == 13 ){
  var frm = document.loginform;
  if ( frm.userid.value == "" ) {
    alert("ID¸¦ ÀÔ·ÂÇÏ½Ã±â ¹Ù¸³´Ï´Ù.");
    frm.userid.focus();
    return;
  }
  else if ( frm.passwd.value == "" ) {
    alert("ºñ¹Ð¹øÈ£¸¦  ÀÔ·ÂÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.");
    frm.passwd.focus();
    return;
  }
    //alert(top.location.href);
    frm.submit();
 }else
        return true;

}

function check2() {

  var frm = document.loginform;
  if ( frm.userid.value == "" ) {
    alert("ID¸¦ ÀÔ·ÂÇÏ½Ã±â ¹Ù¸³´Ï´Ù.");
    frm.userid.focus();
    return;
  }
  else if ( frm.passwd.value == "" ) {
    alert("ºñ¹Ð¹øÈ£¸¦  ÀÔ·ÂÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.");
    frm.passwd.focus();
    return;
  }else{
    //alert(parent.location.href);
    frm.reUrl.value = top.location.href;
    frm.submit();
  }

}

function LogOut() {
       if (confirm('·Î±×¾Æ¿ô ÇÏ½Ã°Ú½À´Ï±î?'))
               top.location.href='http://www.epg.co.kr/epg-cgi/logoff.cgi?www=20010719180117';
}

function Move(szUrl)
{
        self.location.href=szUrl;
}

function LoginOkMove(szUrl)
{
        alert('·Î±×ÀÎÈÄ ÀÌ¿ëÇÏ½Ç¼ö ÀÖ½À´Ï´Ù.'); 
	return;
}
function getCookieVal (offset) {	var endstr = document.cookie.indexOf (";", offset);	if (endstr == -1)		endstr = document.cookie.length;	return unescape(document.cookie.substring(offset, endstr));}function GetCookie (name) {	var arg = name + "=";	var alen = arg.length;	var clen = document.cookie.length;	var i = 0;	while (i < clen) {		var j = i + alen;		if (document.cookie.substring(i, j) == arg)			return getCookieVal (j);		i = document.cookie.indexOf(" ", i) + 1;		if (i == 0) break; 	}	return null;}function DoFocus(){  	var last_name = GetCookie("LAST_NAME");  	if(last_name == "" || last_name == null) {		document.loginform.userid.focus();  	} else  {    		document.loginform.userid.value = last_name;		document.loginform.passwd.focus();  	}}function PopupTvya(){        TvyaWindow  =  window.open('http://211.108.60.37/tvya/tvya.php','Tvya','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=425,height=570,left=0,top=0');        TvyaWindow.opener = self;}


function PopupDamoa() {
               DamoaWindow  =  window.open('http://damoa.epg.co.kr','Damoa','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=696,height=685,left=0,top=0');
                                 damoaWindow.opener = self;
}   

function PopupSigngate() {
               TempWindow2  =  window.open('http://tca.signgate.com/TCAP_ViewTCMark.jsp?tcm_no=0100024','TempWindow2','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=560,height=730,left=0,top=0');
}

function PopupTemp() {
if ( GetCookie( "popup" ) != "no" )
{
               TempWindow  =  window.open('http://www.epg.co.kr/event/090306.htm','TempWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=380,height=510,left=0,top=0');
}
}   
PopupTemp();

selmenu = new Array(8);
for(i=0; i<8; i++)
selmenu[i] = "";

if ( g_top_bgcolor=='#D04475' ) selmenu[1] = '_1';
else if ( g_top_bgcolor=='#D4911D' ) selmenu[2] = '_1';
else if ( g_top_bgcolor=='#E1732B' ) selmenu[3] = '_1';
else if ( g_top_bgcolor=='#18ABE2' ) selmenu[4] = '_1';
else if ( g_top_bgcolor=='#5CA850' ) selmenu[5] = '_1';
else if ( g_top_bgcolor=='#6D7DC1' ) selmenu[7] = '_1';
i=0;document.write(''
//+'<img src="http://adzeos.zena2001.com/adj.zena/adcode=4726" border="0" width="0" height="0" style="display:none">'
+'<!-- 1.»ó´Ü ¸Þ´º START  -->'
+'		  <table width="877" height="180" border="0" align="center" cellpadding="0" cellspacing="0">'
+'                    <tr>'
+'                      <td width="266" height="25">'
+'			<table width="246" height="19" border="0" align="center" cellpadding="0" cellspacing="0">'
+'                          <tr>'
+'                            <td width="9" height="19">'
+' <img src="http://schedule.epg.co.kr/epg_new_homepage/images/top_menu/top_menu_01.gif" width="9" height="17">'
+'                            </td>'
+'                            <td width="49"><FONT style="FONT-SIZE: 7pt; font-width: 80%" color=#1f3f3f>'
+'                         <a href="http://www.epg.co.kr/new/member/register.php" target="_parent">È¸¿ø°¡ÀÔ</a>'
+'                               </font></td>'
+'                            <td width="9"><div align="center">'
+' <img src="http://schedule.epg.co.kr/epg_new_homepage/images/top_menu/top_menu_01.gif" width="9" height="17"></div></td>'
+'                            <td width="40"><FONT style="FONT-SIZE: 9pt; font-width: 80%" color=#1f3f3f>'
+'                         <a href="javascript:Move(\'http://www.epg.co.kr/new/sms/sms.php?leftmenu=charge\')" target="_parent">ÃæÀü¼Ò</a>'
+' 			      </font></td>'
+'                            <td width="12"><div align="center">'
+' <img src="http://schedule.epg.co.kr/epg_new_homepage/images/top_menu/top_menu_01.gif" width="9" height="17"><br>'
+'                              </div></td>'
+'                            <td width="46"><FONT style="FONT-SIZE: 9pt; font-width: 80%" color=#1f3f3f>'
+'                              <a href="http://www.epg.co.kr/new/sitemap/sitemap.php" target="_parent">Sitemap</a></font></td>'
+'                            <td width="18"><div align="center">'
+' <img src="http://schedule.epg.co.kr/epg_new_homepage/images/top_menu/top_menu_01.gif" width="9" height="17"><br>'
+'                              </div></td>'
+'                            <td width="63"><FONT style="FONT-SIZE: 9pt; font-width: 80%" color=#1f3f3f>'
+'                              <a href="mailto:webmaster@epg.co.kr">°ü¸®ÀÚ¿¡°Ô</a></font>'
+'                            </td>'
+'                          </tr>'
+'                        </table>'
+'		        </td>'
+'                      <td width="611" height="96" rowspan="3"><div align="center">'
+'<iframe src=http://schedule.epg.co.kr/banner/ad.php?pos=1&uid='+GetCookie("EPG_ID")+' width=600 height=90 border=0 frameborder=0 scrolling=no marginheight=0 marginwidth=0 align=center></iframe>'+'                      </div></td>'
+'                    </tr>'
+'                    <tr>'
+'                      <td height="36"><div align="center"><a href="/">'
+'<img src="http://schedule.epg.co.kr/epg_new_homepage/images/main/epg_lo.gif" width="192" height="45" border="0"></a></div></td>'
+'                    </tr>'
+'                    <tr>'
+'                      <td height="33">'
+''
+'			<table width="267" border="0" align="center" cellpadding="0" cellspacing="0">'
+'<form name=loginform AUTOCOMPLETE="off" onSubmit="return check();" method=post action="https://www.epg.co.kr/php/etc/login_check_new.php" >'
+'<input type=hidden name=reUrl value="' + ReUrl + '">'
+'<input type=hidden name=topmenu value="">'
+'                          <tr> '
+'                            <td width="26" height="25"><div align="right"><img src="http://schedule.epg.co.kr/epg_new_homepage/images/main/id.gif" width="18" height="12"></div></td>'
+'                            <td width="56"><INPUT '
+'                  style="BORDER-RIGHT: #d0d0d0 1px solid; BORDER-TOP: #d0d0d0 1px solid; BORDER-LEFT: #d0d0d0 1px solid; CURSOR: text; BORDER-BOTTOM: #d0d0d0 1px solid" '
+'                  size=8 name=userid tabindex=1></td>'
+'                            <td width="27"><div align="center"><img src="http://schedule.epg.co.kr/epg_new_homepage/images/main/pw.gif" width="19" height="12"></div></td>'
+'                            <td width="59"><INPUT '
+'                  style="BORDER-RIGHT: #d0d0d0 1px solid; BORDER-TOP: #d0d0d0 1px solid; BORDER-LEFT: #d0d0d0 1px solid; CURSOR: text; BORDER-BOTTOM: #d0d0d0 1px solid" '
+'                  size=8 type=password name=passwd tabindex=2 ONKEYPRESS="return check(this, event)"></td>'
+'                            <td width="31"><div align="center">'
+'				<a href="javascript:check2();"><img src="http://schedule.epg.co.kr/epg_new_homepage/images/main/go.gif" width="26" height="19" border="0"></a></div></td>'
+'                            <td width="68"><div align="right">'
+'				<a href=http://www.epg.co.kr/new/login/log_advice.php><img src="http://schedule.epg.co.kr/epg_new_homepage/images/main/idpw.gif" width="60" height="14" border=0></a></div></td>'
+'                          </tr>'
+'</form>'
+'                        </table>'
+''
+'		      </td>'
+'                    </tr>'
+'<!-- 1.1 ¸Þ´º END   -->'
+'<!-- 1.2 ¸Þ´º START -->'
+'                    <tr>'
+'                      <td colspan="2">'
+'			<table width="75" border="0" align="center" cellpadding="0" cellspacing="0">'
+'                          <tr>'
+'                            <td>'
+'                       <table width="769" height="44" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#efefef">'+'                          <tr>'+'                            <td width="108" height="44"><a href="http://schedule.epg.co.kr/new/tvguide/tvguide.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image1091\',\'\',\'http://www.epg.co.kr/epg_new_homepage/images/main/new_top_menu_01.gif\',1)"><img src="http://www.epg.co.kr/epg_new_homepage/images/main/new_top_menu_1.gif" name="Image1091" width="108" height="34" border="0" id="Image1091"></a></td>'+'                            <td width="106"><a href="javascript:PopupDamoa()" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image1101\',\'\',\'http://www.epg.co.kr/epg_new_homepage/images/main/new_top_menu_02.gif\',1)"><img src="http://www.epg.co.kr/epg_new_homepage/images/main/new_top_menu_2.gif" name="Image1101" width="106" height="34" border="0" id="Image1101"></a></td>'+'                            <td width="110"><a href="http://epg.epg.co.kr/starguide/rank/index.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image1111\',\'\',\'http://www.epg.co.kr/epg_new_homepage/images/main/new_top_menu_03.gif\',1)"><img src="http://www.epg.co.kr/epg_new_homepage/images/main/new_top_menu_3.gif" name="Image1111" width="110" height="34" border="0" id="Image1111"></a></td>'+'                            <td width="111"><a href="http://epg.epg.co.kr/cinema/week_movie.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image1121\',\'\',\'http://www.epg.co.kr/epg_new_homepage/images/main/new_top_menu_04.gif\',1)"><img src="http://www.epg.co.kr/epg_new_homepage/images/main/new_top_menu_4.gif" name="Image1121" width="111" height="34" border="0" id="Image1121"></a></td>'+'                            <td width="70"><a href="http://epg.epg.co.kr/schedule/netizen/view.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image1131\',\'\',\'http://www.epg.co.kr/epg_new_homepage/images/main/new_top_menu_05.gif\',1)"><img src="http://www.epg.co.kr/epg_new_homepage/images/main/new_top_menu_5.gif" name="Image1131" width="111" height="34" border="0" id="Image1131"></a></td>'+'                            <td width="49"><a href="http://epg.epg.co.kr/poll/poll_list.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image1141\',\'\',\'http://www.epg.co.kr/epg_new_homepage/images/main/new_top_menu_06.gif\',1)"><img src="http://www.epg.co.kr/epg_new_homepage/images/main/new_top_menu_6.gif" name="Image1141" width="102" height="34" border="0" id="Image1141"></a></td>'+'                            <td width="23"><a href="http://www.epg.co.kr/new/sms/sms.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image1151\',\'\',\'http://www.epg.co.kr/epg_new_homepage/images/main/new_top_menu_07.gif\',1)"><img src="http://schedule.epg.co.kr/epg_new_homepage/images/main/new_top_menu_7.gif" name="Image1151" width="113" height="34" border="0" id="Image1151"></a></td>'+'                            <!--td width="26"><a href="http://epg.epg.co.kr/bbs/list.asp?board_type=1201" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image1161\',\'\',\'http://schedule.epg.co.kr/epg_new_homepage/images/main/new_top_menu_08.gif\',1)"><img src="http://schedule.epg.co.kr/epg_new_homepage/images/main/new_top_menu_8.gif" name="Image1161" width="107" height="34" border="0" id="Image1161"></a></td-->'+'                          </tr>'+'                        </table>'+'			    </td>'
+'                          </tr>'
+'                          <tr>'
+'                            <td>'
+'			      <TABLE WIDTH=869 BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0>'
+'                                <TR bgcolor="#EFEFEF">'
+'                                  <TD width="869" height="28" bgcolor="#EFEFEF">'
+'                                    <table width="846" border="0" align="center" cellpadding="0" cellspacing="0">'
+'<form name="s_search" action="http://epg.epg.co.kr/search/searchlist.asp" method="post" >'
+'                                      <tr>'
+'                                        <td width="75"><div align="center">'
+'                                         <a href="JavaScript:LoginOkMove(\'http://www.epg.co.kr/new/tvguide/mychannel.php\')">'
+' <img src="http://schedule.epg.co.kr/epg_new_homepage/images/main/my_ch.gif" width="64" height="23" border=0></a>'
+'					</div></td>'

+ '<td width="70">' 
+'                                         <a href="javascript:LoginOkMove(\'http://epg.epg.co.kr/starguide/mystar/index.asp\')">'
+'<img src="http://schedule.epg.co.kr/epg_new_homepage/images/main/my_st.gif" width="63" height="23" border=0></a>'
+'					</td>'
+'                                        <td width="96"><a href="http://www.epg.co.kr/new/tvguide/searchtv.php">'
+'<img src="http://schedule.epg.co.kr/epg_new_homepage/images/main/my_se.gif" width="89" height="23" border=0></a></td>'
+'                                        <td width="97"><a href="Javascript:PopupTvya()" title="ÀÚ¿¬¾î °Ë»öÀ¸·Î ½±°Ô Ã£ÀÚ!">'
+'<img src="http://schedule.epg.co.kr/ETRI_1/images/tvtv_icon.gif" width="71" height="22" border=0></a></td>'
+'                                        <td width="81">'
+'				<select name="s_key">'
+'                                 <option value="all" >ÅëÇÕ°Ë»ö</option>'
+'                                 <option value="10" >½ºÅ¸</option>'
+'                                 <option value="20" >Ä³¸¯ÅÍ</option>'
+'                                 <option value="30" >¹æ¼Û</option>'
+'                                 <option value="40" >¿µÈ­</option>'
+'                                </select></td>'
+'                                        <td width="155"><INPUT'
+' style="BORDER-RIGHT: #d0d0d0 1px solid; BORDER-TOP: #d0d0d0 1px solid; BORDER-LEFT: #d0d0d0 1px solid; CURSOR: text; BORDER-BOTTOM:'
+'#d0d0d0 1px solid"  size=20 name="s_keyword"></td>'
+'                                        <td width="62"><a href="javascript:document.s_search.submit()">'
+'<img src="http://schedule.epg.co.kr/epg_new_homepage/images/main/my_search_01.gif" width="44" height="19" border=0></a></td>'
+'                                        <td width="210"><font style="FONT-SIZE: 9pt; font-width: 80%" color=#1f3f3f><strong>ÀÎ±â°Ë»ö'
+'                                          </strong> : </font>'
+'');

StarKeyword2();

document.write('' 
+'                </tr>'
+'</form>'
+'                                    </table>'
+'				  </TD>'
+'                                </TR>'
+'                              </TABLE>'
+'			    </td>'
+'                          </tr>'
+'                        </table>'
+'		      </td>'
+'                    </tr>'
+'<!-- 1.2¸Þ´º END -->'
+'                  </table>'
+'<!-- 1.»ó´Ü ¸Þ´º END  -->			' 
+'');DoFocus();
