var g_baduksvr = "http://baduk.freechal.com";
var g_wwwsvr = "http://game.freechal.com";
var g_nzimgsvr = "http://fcimage.freechal.com/image4";
var g_gamedownsvr = "http://gamedown.freechal.com";
var g_2warsvr = "http://2war.freechal.com";


/*############*/
var numofitems = 1;

//menu constructor
function menu(allitems,thisitem,startstate){ 
  callname= "fcGnbMenu"+thisitem;
  divname="fcGameGnbSub"+thisitem;  
  this.numberofmenuitems = allitems;
  this.caller = document.getElementById(callname);
  this.thediv = document.getElementById(divname);
  this.thediv.style.display = startstate;
}

//menu methods
function ehandler(event,theobj){
/*
  for (var i=1; i<= theobj.numberofmenuitems; i++){
    var shutdiv =eval( "menuitem"+i+".thediv");
		if(shutdiv.style.display=="visible") {
			shutdiv.style.display="hidden";
			var menuImg = document.getElementById("fcGnbMenu"+i);
			menuImg.src = menuImg.src.replace("_on","_off");
		}
  }
*/
  theobj.thediv.style.display="block";
  fcSelectBoxStyle("none")
  
}



function closesubnav(e){
	var posx,posy; 

    if(e) { 
		
		tempX = document.body.scrollWidth / 2 + 150;

        posx=e.pageX; 
        posy=e.pageY; 


    }else{

		tempX = 0;

        posx=event.x; 
        posy=event.y;
    } 


	if ((posy < 0) || (posy > 165) || (posx > tempX + 350) || (posx < tempX)){

	  var shutdiv =eval('menuitem1.thediv');
			shutdiv.style.display='none';			
			fcSelectBoxStyle("")
	}
}

// added by ice 2009.11.6 ie6 ¿¡¼­ selectbox °¡ layer º¸´Ù »óÀ§·Î º¸ÀÌ´Â Çö»óÃ³¸®
function fcSelectBoxStyle(check){ 
 var useragent = navigator.userAgent;  
 var IE6 = (useragent.indexOf('MSIE 6')>0);  
 if(IE6){var obj = document.getElementsByTagName("select"); 
 if (obj.length > 0){
 try{if (typeof(frmSearch.selSearchKey) != "undefined"){frmSearch.selSearchKey.style.display = check;}}catch(ex){} 			
 try{if (typeof(FcSearch.srchType) != "undefined"){FcSearch.srchType.style.display = check;}}catch(ex){}
 }}}

document.writeln("<style type='text/css'>");
document.writeln(".fcGameGnbSub img  {border:0 none;}");
document.writeln(".fcGameGnbSub {");
document.writeln("	position:relative; width:350px; z-index:999;");
document.writeln("  top: 0px; right: 0px;");
document.writeln("	display: none;");
document.writeln("}");

document.writeln(".fcGameGnbSub ul {padding:0; margin:0;}");
document.writeln(".fcGameGnbSub li , .fcGameGnbSub dl, .fcGameGnbSub dt, .fcGameGnbSub dd {list-style-type:none;  padding:0; margin:0;}");
document.writeln(".fcGameGnbSub li.fcGame {float:left; }");
document.writeln(".fcGameGnbSub li.fcGame img {vertical-align:top;}");
document.writeln(".fcGameGnbSub .border {border: 2px solid #333333;}");
//document.writeln(".fcGameGnbSub .lt {background:url('" + g_nzimgsvr + "/menu/rbox_lt.gif') no-repeat left top; width:3px; height:3px; font-size:1px; line-height:0em;}");
//document.writeln(".fcGameGnbSub .rt {background:url('" + g_nzimgsvr + "/menu/rbox_rt.gif') no-repeat right top; width:3px; height:3px; font-size:1px; line-height:0em;}");
//document.writeln(".fcGameGnbSub .lb {background:url('" + g_nzimgsvr + "/menu/rbox_lb.gif') no-repeat left bottom; width:3px; height:3px; font-size:1px; line-height:0em;}");
//document.writeln(".fcGameGnbSub .rb {background:url('" + g_nzimgsvr + "/menu/rbox_rb.gif') no-repeat right bottom; width:3px; height:3px; font-size:1px; line-height:0em;}");
//document.writeln(".fcGameGnbSub .top {background:url('" + g_nzimgsvr + "/menu/rbox_t.gif') repeat-x top; height:3px; font-size:1px; line-height:0em;}");
//document.writeln(".fcGameGnbSub .left {background:url('" + g_nzimgsvr + "/menu/rbox_l.gif') repeat-y left; width:3px; font-size:1px; line-height:0em;}");
//document.writeln(".fcGameGnbSub .right {background:url('" + g_nzimgsvr + "/menu/rbox_r.gif') repeat-y top; width:3px; font-size:1px; line-height:0em;}");
//document.writeln(".fcGameGnbSub .bottom {background:url('" + g_nzimgsvr + "/menu/rbox_b.gif') repeat-x bottom; height:3px; font-size:1px; line-height:0em;}");
document.writeln(".fcGameGnbSub .contWrap { background:#FFF; padding:0 7px 5px 7px;}");
document.writeln(".fcGameGnbSub .gameWrap {float:left; }");
document.writeln(".fcGameGnbSub .gameWrap p {margin:0;padding:0;}");
document.writeln(".fcGameGnbSub .gameWrap img {vertical-align:top;}");
document.writeln(".fcGameGnbSub .gameWrap li {font-size:1px; line-height:0em; width:82px; text-align:center;}");
document.writeln(".fcGameGnbSub .gameWrap .gameList1 img {margin-bottom:4px;}");
document.writeln(".fcGameGnbSub .gameWrap .gameList2 img {margin-bottom:3px;}");

document.writeln("</style>");

document.writeln("	<div class='fcGameGnbSub' id='fcGameGnbSub1'  onMouseOut='closesubnav(arguments[0])'>");

document.writeln("		<table border='0' cellspacing='0' cellpadding='0' class='border'>");
//document.writeln("		<tr>");
//document.writeln("			<td class='lt'></td>");
//document.writeln("			<td class='top'></td>");
//document.writeln("			<td class='rt'></td>");
//document.writeln("		</tr>");
document.writeln("		<tr>");
//document.writeln("			<td class='left'></td>");
document.writeln("			<td class='contWrap'>");

document.writeln("				<ul>");

document.writeln("					<li class='gameWrap'>");
document.writeln("						<p><img src='" + g_nzimgsvr + "/menu/label_game1.gif' alt='FPS/RPG'></p>");
document.writeln("						<ul>");
document.writeln("							<li class='gameList1'><a href='http://2war.freechal.com'><img src='" + g_nzimgsvr + "/menu/img_game1_01.gif' alt='Åõ¿ö'></a></li>");
document.writeln("							<li class='gameList1'><a href='http://karcass.freechal.com/?wlog=freechalgame_gnb'><img src='" + g_nzimgsvr + "/menu/img_game1_02.gif' alt='Ä«¸£Ä«½º'></a></li>");
document.writeln("						</ul>");

document.writeln("					<li class='gameWrap'>");
document.writeln("						<p><img src='" + g_nzimgsvr + "/menu/label_game2.gif'></p>");
document.writeln("						<ul>");
document.writeln("							<li class='gameList1'><a href='" + g_wwwsvr + "/_gametown/default_cardnew.asp?tssn=33'><img src='" + g_nzimgsvr + "/menu/img_game2_01.gif'></a></li>");
document.writeln("							<li class='gameList2'><a href='" + g_wwwsvr + "/_gametown/default_cardnew.asp?tssn=34'><img src='" + g_nzimgsvr + "/menu/img_game2_05.gif'></a></li>");
document.writeln("							<li class='gameList2'><a href='" + g_wwwsvr + "/_gametown/default_cardnew.asp?tssn=2'><img src='" + g_nzimgsvr + "/menu/img_game2_04.gif'></a></li>");
document.writeln("							<li class='gameList2'><a href='" + g_wwwsvr + "/_gametown/default_cardnew.asp?tssn=18'><img src='" + g_nzimgsvr + "/menu/img_game2_02.gif'></a></li>");
document.writeln("						</ul>");

document.writeln("					<li class='gameWrap'>");
document.writeln("						<p><img src='" + g_nzimgsvr + "/menu/label_game3.gif'></p>");
document.writeln("						<ul>");
document.writeln("							<li class='gameList1'><a href='" + g_wwwsvr + "/_gametown/default_cardnew.asp?tssn=38'><img src='" + g_nzimgsvr + "/menu/img_game3_06.gif'></a></li>");
document.writeln("							<li class='gameList2'><a href='" + g_wwwsvr + "/_gametown/default_cardnew.asp?tssn=37'><img src='" + g_nzimgsvr + "/menu/img_game3_07.gif'></a></li>");
document.writeln("							<li class='gameList2'><a href='" + g_wwwsvr + "/_gametown/default_cardnew.asp?tssn=17'><img src='" + g_nzimgsvr + "/menu/img_game3_04.gif'></a></li>");
document.writeln("						</ul>");

document.writeln("					<li class='gameWrap'>");
document.writeln("						<p><img src='" + g_nzimgsvr + "/menu/label_game4.gif'></p>");
document.writeln("						<ul>");
document.writeln("							<li class='gameList1'><a href='" + g_gamedownsvr + "'><img src='" + g_nzimgsvr + "/menu/img_game4_01.gif'></a></li>");
document.writeln("							<li class='gameList2'><a href='http://norara.freechal.com'><img src='" + g_nzimgsvr + "/menu/img_game4_02.gif'></a></li>");
document.writeln("							<li class='gameList2'><a href='" + g_baduksvr + "/'><img src='" + g_nzimgsvr + "/menu/img_game4_03.gif'></a></li>");
document.writeln("							<li class='gameList2'><a href='" + g_wwwsvr + "/_gametown/default.asp'><img src='" + g_nzimgsvr + "/menu/img_game4_04.gif'></a></li>");
document.writeln("						</ul>");

document.writeln("				</ul>");

document.writeln("			</td>");
//document.writeln("			<td class='right'></td>");
document.writeln("		</tr>");
//document.writeln("		<tr>");
//document.writeln("			<td class='lb'></td>");
//document.writeln("			<td class='bottom'></td>");
//document.writeln("			<td class='rb'></td>");
//document.writeln("		</tr>");
document.writeln("		</table>");
document.writeln("	</div>");


var menuitem1 = new menu(1,1,"none");
