﻿

/***************************URL Information******************************************/
var __bLocal		= (location.href.indexOf("http://lc")==0);
var __bNewWWW		= (location.href.indexOf("http://new")==0);
var __urlPrefix    = __bLocal ? "lc-":(__bNewWWW ? "new-":"");

var __urlWWW        = "http://"+__urlPrefix+"www.webzen.net/";
var __urlMEMBER     = "http://"+__urlPrefix+"member.webzen.net/";
var __urlFORUM      = "http://"+__urlPrefix+"forum.webzen.net/";
var __urlMU         = "http://"+__urlPrefix+"muonline.webzen.net/";


function fnDisplayGNB(strGameCode, strAccountID, blnLogin)
{

    /* GNB Printing */
    document.write("<div id=\"global_gnb\">\n");
    document.write("<div id=\"header\">\n");
    document.write("	<table>\n");
    document.write("	<tbody>\n");
    document.write("	<tr>\n");
    document.write("		<td width=\"670\" nowrap=\"nowrap\">\n");
    document.write("		<h1><a href=\""+__urlWWW+"\"><img src=\"http://image.webzen.net/Global/Games/common/nav_logo.gif\" alt=\"\" /></a></h1>\n");
	document.write("		<ul id=\"nav_menu\">\n");
    document.write("			<li onmouseover=\"gnb.over(this);\">\n");
    document.write("				<img src=\"http://image.webzen.net/Global/Games/common/nav_games.gif\" width=\"48\" height=\"13\" alt=\"GAMES\" /><br />\n");
    document.write("				<div id=\"nav_gamebox\">\n");
    document.write("				<ul>\n");
    document.write("					<li><a href=\""+__urlMU+"\"><img src=\"http://image.webzen.net/Global/Games/common/nav_games_mu.gif\" alt=\"MUONLINE\" /></a></li>\n");
    /*
    document.write("					<li><a href=\"#\"><img src=\"http://image.webzen.net/Global/Games/common/nav_games_sun.gif\" alt=\"SUNONLINE\" /></a></li>\n");
    document.write("					<li><a href=\"#\"><img src=\"http://image.webzen.net/Global/Games/common/nav_games_archlord.gif\" alt=\"ARCHLORD\" /></a></li>\n");
    document.write("					<li><a href=\"#\"><img src=\"http://image.webzen.net/Global/Games/common/nav_games_r2.gif\" alt=\"R2\" /></a></li>\n");
    */
    document.write("				</ul>\n");
	document.write("				<div id=\"nav_pngbg\"></div>\n");
    document.write("				</div>\n");
    document.write("			</li>\n");
    document.write("			<li><a href=\""+__urlFORUM+"\"><img src=\"http://image.webzen.net/Global/Games/common/nav_forums.gif\" width=\"59\" height=\"13\" alt=\"FORUMS\" /></a></li>\n");
    /*document.write("			<li><a href=\"#\"><img src=\"http://image.webzen.net/Global/Games/common/nav_wcoin.gif\" width=\"50\" height=\"13\" alt=\"W COIN\" /></a></li>\n");*/
    document.write("			<li><a href=\""+__urlWWW+"_HTML/Download.aspx\"><img src=\"http://image.webzen.net/Global/Games/common/nav_download.gif\" width=\"70\" height=\"13\" alt=\"DOWNLOAD\" /></a></li>\n");
    document.write("		</ul>\n");
	document.write("		</td>\n");
    document.write("		<td nowrap=\"nowrap\">\n");
    document.write("		<table>\n");
    document.write("		<tbody>\n");
    document.write("		<tr>\n");
    document.write("			<td>\n");
    document.write("			<ul id=\"nav_register\">\n");
    if (blnLogin == "True")
    { // login
	    document.write("				<li class=\"username\"><span title=\"Your user ID\">"+strAccountID+"</span></li>\n");
    }
	document.write("				<li><a href=\""+__urlWWW+"Support/FAQ.aspx\"><img src=\"http://image.webzen.net/Global/Games/common/nav_support.gif\" width=\"55\" height=\"14\" alt=\"SUPPORT\" /></a></li>\n");
	document.write("				<li><a href=\""+__urlMEMBER+"MyPage/ModifyProfile/\"><img src=\"http://image.webzen.net/Global/Games/common/nav_myaccount.gif\" width=\"74\" height=\"14\" alt=\"MY ACCOUNT\" /></a></li>\n");
    if (blnLogin == "True")
    { // login
	    document.write("				<li><a href=\""+__urlMEMBER+"Login/LogOut.aspx?sGC="+strGameCode+"\"><img src=\"http://image.webzen.net/Global/Games/common/nav_logout.gif\" width=\"59\" height=\"14\" alt=\"LOG OUT\" /></a></li>\n");
    } else { // before login
	    document.write("				<li><a href=\""+__urlMEMBER+"Login/default.aspx?sGC="+strGameCode+"&amp;sRU="+ document.URL+"\"><img src=\"http://image.webzen.net/Global/Games/common/nav_login.gif\" width=\"47\" height=\"14\" alt=\"LOG IN\" /></a></li>\n");
	    document.write("				<li><a href=\""+__urlMEMBER+"Account/Join/registAccount.aspx\"><img src=\"http://image.webzen.net/Global/Games/common/nav_signup.gif\" width=\"50\" height=\"14\" alt=\"SIGN UP\" /></a></li>\n");
    }
    document.write("			</ul>\n");
    document.write("			</td>\n");
    document.write("		</tr>\n");
    document.write("		</tbody>\n");
    document.write("		</table>\n");
    document.write("		</td>\n");
    document.write("	</tr>\n");
    document.write("	</tbody>\n");
    document.write("	</table>\n");
    document.write("</div>\n");
    document.write("</div>\n");
}

/* GNB Layer */
var gnb = {
	over : function(el){
		depth = el.getElementsByTagName("div")[0];
		depth_list = depth.getElementsByTagName("li");
		depth_link = depth.getElementsByTagName("a");
		depth.style.display = "block";
		el.onmouseout = depth.onmouseout = function(){
			depth.style.display = "none";
		}
		for(var i=0; i<depth_list.length; i++){
			depth_list[i].onmouseover = function(){ gnb.rollover(this); }
			depth_list[i].onmouseout = function(){ gnb.rollout(this); }
			depth_link[i].onfocus = function(){ this.blur(); }
			depth_link[i].onclick = function(){ depth.style.display = "none"; }
		}
	},
	rollover : function(el){
		el.getElementsByTagName("img")[0].src =
			el.getElementsByTagName("img")[0].src.replace(".gif","_on.gif");
	},
	rollout : function(el){
		el.getElementsByTagName("img")[0].src =
			el.getElementsByTagName("img")[0].src.replace("_on.gif",".gif");
	}
};