tUrl = document.location;
function setCookie(name, value, expires, path, domain, secure) {
	var curCookie = name + "=" + escape(value) +
	((expires) ? "; expires=" + expires.toGMTString() : "") +
	((path) ? "; path=" + path : "") +
	((domain) ? "; domain=" + domain : "") +
	((secure) ? "; secure" : "");
	
	if ((name + "=" + escape(value)).length <= 4000) {
			document.cookie = curCookie;
	} else {
		if (confirm("Cookie exceeds 4KB and will be cut!")) {
			document.cookie = curCookie;
		}
	}
	return true;
}
function SetUrl() 
{
	setCookie("URL",tUrl,null,"/","fgtv.com");
	ID		= escape(GetCookie("User_Id"))
	if (ID == ""){
		location.href="http://www.fgtv.com/login/login.html"
		return;
	}
	location.href=tUrl;	
}


function GetCookie(NameCookie) {
        var i = document.cookie.indexOf(NameCookie + '=' );                                                       
        if (i != -1) { 
                i += NameCookie.length + 1;
                NameEnd = document.cookie.indexOf(';', i); 
                if (NameEnd == -1)
                    {  NameEnd = document.cookie.length; }              
                return  unescape(document.cookie.substring(i, NameEnd));                
        }
        else{
          return ""     
        }       
 }

function SetLogin() {
	
//	Name	= escape(GetCookie("User_Name"))
	ID		= escape(GetCookie("User_Id"))
	if (ID == ""){
//		document.write('<img src="http://nanum.fgtv.com/image/IG_top_icon_2.gif" width="9" height="28" border="0" align="absmiddle">&nbsp;<a href="http://www.fgtv.com/login/login.html" onClick="SetUrl()">·Î±×ÀÎ</a>&nbsp;&nbsp;<a href="http://www.fgtv.com/login/joinform_01.html" onClick="SetUrl()" onFocus=this.blur()><img src="http://nanum.fgtv.com/image/IG_top_icon_3.gif" width="10" height="28" border="0" align="absmiddle">&nbsp;È¸¿ø°¡ÀÔ&nbsp;&nbsp;</a>\n')
//		document.write('<a href="http://mail.fgtv.com/" target="_blank" onFocus=this.blur()><img src="http://www.fgtv.com/fgtv/http://nanum.fgtv.com/image/IG_top_icon_1.gif" width="4" height="28" border="0" align="absmiddle">&nbsp;e-mail&nbsp;&nbsp;</a>\n'
		
//		+'<a href="javascript:SetUrl()" onFocus=this.blur()><img src="http://www.fgtv.com/fgtv/http://nanum.fgtv.com/image/IG_top_icon_4.gif" width="8" height="28" border="0" align="absmiddle">&nbsp;·Î±×ÀÎ&nbsp;&nbsp;</a><a href="http://www.fgtv.com/login/bin/member_info.htm" ><img src="http://www.fgtv.com/fgtv/http://nanum.fgtv.com/image/IG_top_icon_3.gif" width="10" height="28" border="0" align="absmiddle">&nbsp;È¸¿ø°¡ÀÔ&nbsp;&nbsp;</a>\n')



	document.write('          <a href="javascript:SetUrl()" onFocus=this.blur()  class="s"><font color="#3399CC">·Î±×ÀÎ</font></a>&nbsp;&nbsp;<img src="http://nanum.fgtv.com/image/IG_top_logmenu_bar.gif">&nbsp;\n'


	+'          <a href="http://www.fgtv.com/login/bin/member_info.htm" onFocus=this.blur() class="s"><font color="#3399CC">È¸¿ø°¡ÀÔ</font></a>&nbsp;&nbsp;<img src="http://nanum.fgtv.com/image/IG_top_logmenu_bar.gif">&nbsp;\n'
	+'          <a href="http://mail.fgtv.com/" target="_blank" onFocus=this.blur() class="s">e-¸ÞÀÏ</a>&nbsp;&nbsp;<img src="http://nanum.fgtv.com/image/IG_top_logmenu_bar.gif">&nbsp;\n'
	+'          <a href="http://nanum.fgtv.com/e_card/main.html" onFocus=this.blur() class="s">e-Ä«µå</a>&nbsp;&nbsp;<img src="http://nanum.fgtv.com/image/IG_top_logmenu_bar.gif">&nbsp;\n'
	+'          <a href="http://www.fgtv.com/fgtv/f2/sitemap.htm" onFocus=this.blur() class="s">»çÀÌÆ®¸Ê</a></div></td>\n')
	}	
	else{
		var m;
		var n = 1;
		var StrCheckNum = 0;
		var StrtUrl = new String(tUrl);
		for(m=0;m<StrtUrl.length;m++, n++)
		{ 
		CheckStr = StrtUrl.substring(m, n);
		if (CheckStr == "&") 
		StrCheckNum++; 
		}
				
		for(m=0; m<StrCheckNum; m++)
		{
		StrtUrl  = StrtUrl.replace("&", "|");
		}
	//	document.write('<a href="http://www.fgtv.com/login/logout.asp?turl='+StrtUrl+'"><img src="http://nanum.fgtv.com/image/IG_top_icon_2.gif" width="9" height="28" border="0" align="absmiddle">&nbsp;·Î±×¾Æ¿ô&nbsp;&nbsp;</a><a href="http://www.fgtv.com/login/joinform_memberEdit.asp" onFocus=this.blur()><img src="http://nanum.fgtv.com/image/IG_top_icon_3.gif" width="10" height="28" border="0" align="absmiddle">&nbsp;È¸¿ø¼öÁ¤&nbsp;&nbsp;</a></td><td width="120" align="right" class="copyright1">\n');
	//	document.write('<a href="http://www.fgtv.com/login/logout.asp?turl='+StrtUrl+'" onFocus=this.blur()><img src="http://www.fgtv.com/fgtv/http://nanum.fgtv.com/image/IG_top_icon_2.gif" width="9" height="28" border="0" align="absmiddle">&nbsp;·Î±×¾Æ¿ô&nbsp;&nbsp;</a><a href="http://www.fgtv.com/login/joinform_memberEdit.asp" onFocus=this.blur()><img src="http://www.fgtv.com/fgtv/http://nanum.fgtv.com/image/IG_top_icon_3.gif" width="10" height="28" border="0" align="absmiddle">&nbsp;È¸¿ø¼öÁ¤&nbsp;&nbsp;</a></td><td width="120" align="right" class="copyright1">\n');

//		document.write('<a href="http://mail.fgtv.com/servlet/crinity?paction=login&ptype=SSO" target="_blank" onFocus=this.blur()><img src="http://www.fgtv.com/fgtv/http://nanum.fgtv.com/image/IG_top_icon_1.gif" width="4" height="28" border="0" align="absmiddle">&nbsp;e-mail&nbsp;&nbsp;</a>\n'

//		+'<a href="http://www.fgtv.com/login/logout.asp?turl='+StrtUrl+'" onFocus=this.blur()><img src="http://www.fgtv.com/fgtv/http://nanum.fgtv.com/image/IG_top_icon_2.gif" width="9" height="28" border="0" align="absmiddle">&nbsp;·Î±×¾Æ¿ô&nbsp;&nbsp;</a><a href="http://www.fgtv.com/login/bin/member_02modify.asp" onClick="SetUrl()" onFocus=this.blur()><img src="http://www.fgtv.com/fgtv/http://nanum.fgtv.com/image/IG_top_icon_3.gif" width="10" height="28" border="0" align="absmiddle">&nbsp;È¸¿øÁ¤º¸&nbsp;&nbsp;</a></td><td width="120" align="right" class="copyright1">\n');
		
		
		document.write('          <a href="http://www.fgtv.com/login/logout.asp?turl='+StrtUrl+'" onFocus=this.blur()  class="s"><font color="#3399CC">·Î±×¾Æ¿ô</font></a>&nbsp;&nbsp;<img src="http://nanum.fgtv.com/image/IG_top_logmenu_bar.gif">&nbsp;\n'

		+'          <a href="http://www.fgtv.com/login/bin/member_02modify.asp" onClick="SetUrl()" onFocus=this.blur() class="s"><font color="#3399CC">È¸¿øÁ¤º¸</font></a>&nbsp;&nbsp;<img src="http://nanum.fgtv.com/image/IG_top_logmenu_bar.gif">&nbsp;\n'
		+'          <a href="http://mail.fgtv.com/servlet/crinity?paction=login&ptype=SSO" target="_blank" onFocus=this.blur()  class="s">e-¸ÞÀÏ</a>&nbsp;&nbsp;<img src="http://nanum.fgtv.com/image/IG_top_logmenu_bar.gif">&nbsp;\n'
		+'          <a href="http://nanum.fgtv.com/e_card/main.html" onFocus=this.blur() class="s">e-Ä«µå</a>&nbsp;&nbsp;<img src="http://nanum.fgtv.com/image/IG_top_logmenu_bar.gif">&nbsp;\n'
		+'          <a href="http://www.fgtv.com/fgtv/f2/sitemap.htm" onFocus=this.blur() class="s">»çÀÌÆ®¸Ê</a></div></td>\n'
		+'          <td background="http://nanum.fgtv.com/image/IG_top_logmenu_bg.gif">');
		MyCafeView();
		document.write('</td>\n');
		
	}
}


function MyCafeView(){

ID = escape(GetCookie("User_Id"))
if (ID != "")
	document.write('<iframe src="http://nanum.fgtv.com/myCafe.asp" border="0" framespacing="0" frameborder="NO"  scrolling="NO" WIDTH="120" HEIGHT="20"  name="a"></iframe>\n');
}

function G_menu(){
MM_swapImgRestore();
MM_swapImage();
document.write ('<table width="780" border="0" cellpadding="0" cellspacing="0">\n'
+'					<tr>\n'
+'					<a name="top"></a>\n'
+'						<td width="140"><a href="http://www.fgtv.com/" onFocus=this.blur()><img src="http://www.fgtv.com/fgtv/http://nanum.fgtv.com/image/IG_top_logo.gif" width="136" height="28" border="0"></a></td>\n'
+'						<td align="right" class="copyright1">\n'
+'						<a href="http://www.fgtv.com/fgtv/f2/sitemap.htm" onFocus=this.blur()><img src="http://www.fgtv.com/fgtv/http://nanum.fgtv.com/image/IG_top_icon_1.gif" width="4" height="28" border="0" align="absmiddle">&nbsp;»çÀÌÆ®¸Ê&nbsp;&nbsp;</a>\n'


+'						<a href="http://nanum.fgtv.com/e_card/main.html" onFocus=this.blur()><img src="http://www.fgtv.com/fgtv/http://nanum.fgtv.com/image/IG_top_icon_1.gif" width="4" height="28" border="0" align="absmiddle">&nbsp;e-Ä«µå&nbsp;&nbsp;</a>\n');
SetLogin();
document.write ('</td>\n'
+'					</tr>\n'
+'				</table>\n');
}
//G_menu();


function G_topmenu(){
MM_swapImgRestore();
MM_swapImage();
document.write ('<table width="947" border="0" align="center" cellpadding="0" cellspacing="0">\n'
+'  <tr>\n'
+'    <td align="right"><table border="0" cellpadding="0" cellspacing="0">\n'
+'        <tr>\n'
+'          <td width="7"><img src="http://nanum.fgtv.com/image/IG_top_logmenu_bgl.gif" width="7" height="25"></td>\n'
+'          <td width="95" background="http://nanum.fgtv.com/image/IG_top_logmenu_bg.gif"><a href="http://www.fgtv.com" onFocus=this.blur()><img src="http://nanum.fgtv.com/image/IG_top_logmenu_sunlogo.gif" width="82" height="19" border="0"></a>&nbsp;&nbsp;</td>\n'
+'          <td width="332" background="http://nanum.fgtv.com/image/IG_top_logmenu_bg.gif" align="center" class="gmenu_b"><div align="left"><img src="http://nanum.fgtv.com/image/IG_top_logmenu_blt.gif" width="7" height="7" valign="absmiddle">&nbsp;&nbsp;\n');
/*+'          <a href="http://www.fgtv.com" onFocus=this.blur()  class="s"><font color="#3399CC">·Î±×ÀÎ</font></a>&nbsp;&nbsp;<img src="http://nanum.fgtv.com/image/IG_top_logmenu_bar.gif">&nbsp;\n'
+'          <a href="http://www.fgtv.com/login/bin/member_info.htm" onFocus=this.blur() class="s"><font color="#3399CC">È¸¿ø°¡ÀÔ</font></a>&nbsp;&nbsp;<img src="http://nanum.fgtv.com/image/IG_top_logmenu_bar.gif">&nbsp;\n'
+'          <a href="http://mail.fgtv.com/" target="_blank" onFocus=this.blur()  class="s">e-¸ÞÀÏ</a>&nbsp;&nbsp;<img src="http://nanum.fgtv.com/image/IG_top_logmenu_bar.gif">&nbsp;\n'
+'          <a href="http://nanum.fgtv.com/e_card/main.html" onFocus=this.blur() class="s">e-Ä«µå</a>&nbsp;&nbsp;<img src="http://nanum.fgtv.com/image/IG_top_logmenu_bar.gif">&nbsp;\n'
+'          <a href="http://www.fgtv.com/fgtv/f2/sitemap.htm" onFocus=this.blur() class="s">»çÀÌÆ®¸Ê</a></div></td>\n'
+'          <td background="http://nanum.fgtv.com/image/IG_top_logmenu_bg.gif">Ä«Æä¾ÆÀÌÇÁ·¹ÀÓ</td>\n'*/
SetLogin();
document.write ('          <td width="6"><img src="http://nanum.fgtv.com/image/IG_top_logmenu_bgr.gif" width="6" height="25"></td>\n'
+'        </tr>\n'
+'      </table></td>\n'
+'  </tr>\n'
+'  <tr>\n'
+'    <td> \n'
+'      <table width="947" border="0" cellspacing="0" cellpadding="0">\n'
+'        <tr>\n'
+'          <td width="186" height="60"><a href="http://iticafe.fgtv.com" onFocus=this.blur()><img src="/image/IG_logo.gif" width="354" height="50" border="0"></a></td>\n'
+'          <td>&nbsp;</td>\n'
+'          <td width="102"><a href="http://www.fgtv.com/fgtv" onFocus=this.blur()><img src="http://nanum.fgtv.com/image/IG_logo_sfgtv.gif" width="98" height="20" border="0"></a></td>\n'
+'          <td width="130"><a href="http://yfgc.fgtv.com" onFocus=this.blur()><img src="http://nanum.fgtv.com/image/IG_logo_syfgc.gif" width="126" height="20" border="0"></a></td>\n'
+'          <td width="98"><a href="http://nanum.fgtv.com" onFocus=this.blur()><img src="http://nanum.fgtv.com/image/IG_logo_snanum.gif" width="94" height="24" border="0"></a></td>\n'
+'          <td width="86"><a href="http://ccm.fgtv.com" onFocus=this.blur()><img src="http://nanum.fgtv.com/image/IG_logo_sccm.gif" width="82" height="24" border="0" onFocus=this.blur()></a></td>\n'
+'          <td width="98"><a href="http://mobile.fgtv.com" target="_blank" onFocus=this.blur()><img src="http://nanum.fgtv.com/image/IG_logo_smobile.gif" width="94" height="26" border="0"></a></td>\n'
+'        </tr>\n'
+'      </table></td>\n'
+'  </tr>\n'
+'</table>');
}
G_topmenu();