// Browser Title---------
//document.title="Mabinogi";
document.write('<script type="text/javascript" src="/Common/js/es/common_url.js"></script>');

/*ActiveX Flash*/
// id: flash id
// url: source url
// w: source width
// h: source height
// t: wmode (window/transparent/opaque)
function Flash(id,url,w,h,bg,t){
document.write("\
<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9.0.12.0' width="+w+" height="+h+" id="+id+">\
<param name='movie' value="+url+" />\
<param name='wmode' value="+t+" />\
<param name='bgcolor' value="+bg+" />\
<param name='allowScriptAccess' value='always' />\
<param name='quality' value='high' />\
<param name='menu' value='false' />\
<embed src="+url+" width="+w+" height="+h+" wmode="+t+" name="+id+" bgcolor="+bg+" allowScriptAccess='always' quality='high' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\
</object>\
");
}

//2010-01-11 수정
hn = "0", sn = "0", cn = "0", tn = "0", globalId = "0", flaFarm = "0", logCheck = "0";
function TopNavi() { //상단네비
    try {
        var Depth = arguments.length;
        var DepthName = new Array("hn", "sn", "cn", "tn");
        for (i = 0; i < Depth; i++) {
            if (i == 0) hn = arguments[i]; if (i == 1) sn = arguments[i]; if (i == 2) cn = arguments[i]; if (i == 3) tn = arguments[i];
            if (arguments[i] != "") globalId = (i == 0) ? arguments[i] : globalId + "_" + arguments[i];
            if (arguments[i] != "") flaFarm = (i == 0) ? DepthName[i] + "=" + arguments[i] : flaFarm + "&" + DepthName[i] + "=" + arguments[i];
        }
        document.write("<div id='gnb-area'><div id='mnavHeight' class='mnavClose' onmouseover='mnavResize(1);' onmouseout='mnavResize(0);'>");
        Flash('top', 'http://mbimage.nexoneu.com/es/fla/gnb.swf', '980', '280', '#ffffff', 'transparent');
        document.write("</div></div>");
        //document.write("<img src='/img/es/temp/temp_sub_top_visual.gif'>");
    } catch (e) { }
}
//2010-01-11 수정
function mnavResize(type) {
    if (type == 1) document.getElementById("mnavHeight").style.height = "280px";
    else document.getElementById("mnavHeight").style.height = "148px";
}

function setString(node){
	var spStr = "" , last="";
	try{
		var url  = eval(node+"[0]");
		var name = eval(node+"[1]");
	}
	catch(e){
		document.write("ID not found : " + node);
	}
	var nodeId  = node;
	var spStr = " > ";
	if(node.lastIndexOf('_') != -1) setString(node.substring(0,node.lastIndexOf('_')));
	else lineMapStr += "<a href='"+eval("u0[0]")+"'>"+ eval("u0[1]")+"</a>" + spStr;
	if(currentPath != nodeId) lineMapStr += "<a href='"+url+"'>"+ name+"</a>" + spStr;
	else lineMapStr += "<strong>"+ name+"</strong>";
}

function setString2(node){
	var spStr = "" , last="";
	try{
		//var url  = eval(node+"[0]");
		var name = eval(node+"[1]");
	}
	catch(e){
	    document.write("ID not found : " + node);
	}
	var nodeId  = node;
	var spStr = " > ";
	if(node.lastIndexOf('_') != -1) setString2(node.substring(0,node.lastIndexOf('_')));
	else lineMapStr += eval("u0[1]")+ spStr;
	if(currentPath != nodeId) lineMapStr += name+ spStr;
	else lineMapStr += "<span>"+ name+"</span>";
}

function path(){ //파일패스
	try{
		lineMapStr ="";
		index = 0;
		currentPath="u"+globalId;
		setString("u"+globalId);
		document.write(lineMapStr);
	}catch(e){
		document.write("In Error : " +  e);
	}
}

function link(){
	var url = "";
	var depth = arguments.length;
	try {
		if(depth==0) return;
		else if(depth==1) url = eval("u"+arguments[0]+"[0]");
		else if(depth==2) url = eval("u"+arguments[0]+"_"+arguments[1]+"[0]");
		else if(depth==3) url = eval("u"+arguments[0]+"_"+arguments[1]+"_"+arguments[2]+"[0]");
		else if(depth==4) url = eval("u"+arguments[0]+"_"+arguments[1]+"_"+arguments[2]+"_"+arguments[3]+"[0]");
		else if(depth==5) url = eval("u"+arguments[0]+"_"+arguments[1]+"_"+arguments[2]+"_"+arguments[3]+"_"+arguments[4]+"[0]");
		if (url == "") alert("This feature will come to you soon with our upcoming Open-Beta!");
		else location.href = url;
} catch (e) { alert("This feature will come to you soon with our upcoming Open-Beta!"); }
}

function wikiLink() {
    var url = "";
    var depth = arguments.length;
    try {
        if (depth == 0) return;
        else if (depth == 1) url = eval("u" + arguments[0] + "[0]");
        else if (depth == 2) url = eval("u" + arguments[0] + "_" + arguments[1] + "[0]");
        else if (depth == 3) url = eval("u" + arguments[0] + "_" + arguments[1] + "_" + arguments[2] + "[0]");
        else if (depth == 4) url = eval("u" + arguments[0] + "_" + arguments[1] + "_" + arguments[2] + "_" + arguments[3] + "[0]");
        else if (depth == 5) url = eval("u" + arguments[0] + "_" + arguments[1] + "_" + arguments[2] + "_" + arguments[3] + "_" + arguments[4] + "[0]");
        if (url == "") alert("This feature will come to you soon with our upcoming Closed-Beta!");
        else document.getElementById("wikiframe").src = url;
    } catch (e) { alert("This feature will come to you soon with our upcoming Closed-Beta!"); }
}

// site map ----
function sitemap(){
	var Depth = arguments.length;
	var id = "";
	for(i=0;i<Depth;i++){
		id=(i==0)? "u"+arguments[i] : id+"_"+arguments[i] ;
	}
	document.write('<a href="'+eval(id+"[0]")+'" target="_self">'+eval(id+"[1]")+'</a>');
}

// flash
function TopBar(){
	document.write("<img src='http://mbimage.nexoneu.com/es/temp/temp_top_bar.gif'>");
	//Flash('top','/app/fla/main.swf?'+flaFarm,'100%','855','#ffffff','transparent');
}

function MainVisual(){
	//document.write("<img src='http://mbimage.nexoneu.com/es/temp/temp_main_bnr.gif'>");
    Flash('top', 'http://mbimage.nexoneu.com/es/fla/main_visual.swf', '980', '320', '#ffffff', 'transparent');
}

function MainBanner() {
    //document.write("<img src='http://mbimage.nexoneu.com/en/temp/temp_main_bnr.gif'>");
    Flash('top', 'http://mbimage.nexoneu.com/es/fla/banner/mainBanner.swf', '595', '157', '#ffffff', 'transparent');
}

function NoticeVisual(){
	//document.write("<img src='http://mbimage.nexoneu.com/es/temp/temp_main_bnr.gif'>");
    Flash('top', 'http://mbimage.nexoneu.com/es/fla/sub_vi_01.swf', '980', '190', '#ffffff', 'transparent');
}

function GuideVisual(){
	//document.write("<img src='http://mbimage.nexoneu.com/es/temp/temp_main_bnr.gif'>");
    Flash('top', 'http://mbimage.nexoneu.com/es/fla/sub_vi_02.swf', '980', '190', '#ffffff', 'transparent');
}

function WikiVisual(){
	//document.write("<img src='http://mbimage.nexoneu.com/es/temp/temp_main_bnr.gif'>");
    Flash('top', 'http://mbimage.nexoneu.com/es/fla/sub_vi_03.swf', '980', '190', '#ffffff', 'transparent');
}

function DownloadVisual(){
	//document.write("<img src='http://mbimage.nexoneu.com/es/temp/temp_main_bnr.gif'>");
    Flash('top', 'http://mbimage.nexoneu.com/es/fla/sub_vi_04.swf', '980', '190', '#ffffff', 'transparent');
}

function SupportVisual(){
	//document.write("<img src='http://mbimage.nexoneu.com/es/temp/temp_main_bnr.gif'>");
    Flash('top', 'http://mbimage.nexoneu.com/es/fla/sub_vi_05.swf', '980', '190', '#ffffff', 'transparent');
}

function CommunityVisual() {
    //document.write("<img src='/img/en/temp/temp_main_bnr.gif'>");
    Flash('top', 'http://mbimage.nexoneu.com/es/fla/sub_vi_06.swf', '980', '190', '#ffffff', 'transparent');
}

// footer 영역
function Footer() {
    el = document.getElementsByTagName("body");

    for (i = 0; i < el.length; i++) {
        if ((el.item(i).className == "member-login") || (el.item(i).className == "member-logout") || (el.item(i).className == "member") || (el.item(i).className == "certification member")) {
        } else {
            document.write("	<div id='FooterArea'>");
            document.write("		<div class='Footer'>");
            document.write("			<p class='logo'><a href='#'><img src='http://mbimage.nexoneu.com/es/common/img_logo.gif' alt='NEXON' /></a></p>");
            document.write("			<div class='foot-right'>");
            document.write("				<ul class='foot-list'>");
            document.write("					<li class='fir'><a href='http://en.nexoneu.com/NXEU.aspx?PART=/AboutNEXON'>About NEXON</a></li>");
            document.write("					<li><a href='http://en.nexoneu.com/NXEU.aspx?PART=/Legal/PrivacyPolicy'>Privacy Policy</a></li>");
            document.write("					<li><a href='http://en.nexoneu.com/NXEU.aspx?PART=/Legal/TermsOfUse'>Terms of use</a></li>");
            document.write("					<li><a href='http://en.nexoneu.com/NXEU.aspx?PART=/Legal/EULA'>EULA</a></li>");
            document.write("					<li><a href='http://blog.nexoneu.com/' target='_blank'>Press Blog</a></li>");
            document.write("					<li><a href='/NXEU.aspx?PART=/Support/SiteMap'>Sitemap</a></li>");
            document.write("					<li><a href='/NXEU.aspx?PART=/Support/Contact'>Contact Us</a></li>");
            document.write("				</ul>");
            document.write("				<address>Copyright ⓒ 2009 NEXON Corporation and NEXON Europe Limited. All Rights Reserved.</address>");
            document.write("				<p class='family'><select id='ddlFamSite' onchange='goSite()'><option>Family Website</option><option>MapleStory</option><option>Combat Arms</option></select></p>");
            document.write("			</div>");
            document.write("		<div class='top'><a href='#'><img src='http://mbimage.nexoneu.com/es/btn/btn_top.gif' alt='TOP'></a></div>");
            document.write("		</div>");
            document.write("	</div>");
        }
    }
}

function goSite() {
    var s = document.getElementById('ddlFamSite').selectedIndex;
    if (s == 0)
        alert("Select Family Site!");
    else if (s == 1)
        location.href = "http://en.maplestory.nexoneu.com/";
    else
        location.href = "http://combatarms.nexoneu.com/";
}

// 팝업
function pop(url,name,w,h){
//	var bw=new bwcheck();
//	if(bw.ie7) h = h-20; 
	window.open(url,name,'width='+w+',height='+h+',scrollbars=no') 
} //Popup(스크롤바없음)
function pops(url,name,w,h){
//	var bw=new bwcheck();
//	if(bw.ie7) h = h-20; 	
	window.open(url,name,'width='+w+',height='+h+',scrollbars=yes','top=');
} //Popup(스크롤바있음)

function popclose(url,name,w,h){ window.open(url,name,'width='+w+',height='+h+',scrollbars=no'); window.close(); } //Popup(스크롤바없음)


// 이미지 오버 
function over(obj, type) {
    if (type) obj.src = obj.src.replace("off.gif", "on.gif");
    else obj.src = obj.src.replace("on.gif", "off.gif");
}

function layerView(obj){ document.getElementById(obj).style.display = "block"; } /* layer open */
function layerClose(obj){ document.getElementById(obj).style.display = "none"; } /* layer close */


//레이어 열고 닫기
function showDiv() {
	var obj = document.getElementById('show');
	if(obj.style.display == "none") {
		obj.style.display = "block";
	} else {
		obj.style.display = "none";
	}
}


// Guide 2009-11-24 추가
function Guide() {
    //document.write("<img src='/img/en/temp/temp_launcher_bnr.gif'>");
    Flash('top', 'http://mbimage.nexoneu.com/es/fla/guide/guideMain.swf', '770', '600', '#ffffff', 'transparent');
}

// Movie 2010-01-12 수정
var movie_url = '';
function Movie(u, d) {
    //document.write("<img src='/img/en/temp/temp_launcher_bnr.gif'>");
    if (u != null)
        movie_url = u;
    Flash('top', 'http://mbimage.nexoneu.com/es/fla/movie_player.swf?flv=' + movie_url + '&downurl=' + d, '711', '456', '#ffffff', 'transparent');
}


// Guide lorna 2010-01-12 수정
var lornapan_url = '';
function GuideMovie(l, d) {
    if (l != null)
        lornapan_url = l;
    //document.write("<img src='http://mbimage.nexoneu.com/en/temp/temp_guide_movie.gif'>");
    Flash('top', 'http://mbimage.nexoneu.com/es/fla/lorna_player.swf?flv=' + lornapan_url + '&downurl=' + d, '711', '456', '#ffffff', 'transparent');
}

//Music 2010-01-12 추가
var music_url = '';
function DownloadMusic(t, s) {
    if (s != null)
        music_url = s;

    Flash('', 'http://mbimage.nexoneu.com/es/fla/mp3_palyer.swf?src=' + music_url + '&title=' + t, '711', '95', '#ffffff', 'transparent');
}

/*Copy Url*/

function copyContent(meintext) {
    if (window.clipboardData) {
        window.clipboardData.setData("Text", meintext);
        alert("Copied into your clipboard.");
    } 
    /*else if (window.netscape) {
        netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
        var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
        if (!clip) return;
        var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
        if (!trans) return;
        trans.addDataFlavor('text/unicode');
        var str = new Object();
        var len = new Object();
        var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
        var copytext = meintext;
        str.data = copytext;
        trans.setTransferData("text/unicode", str, copytext.length * 2);
        var clipid = Components.interfaces.nsIClipboard;
        if (!clip) return false;
        clip.setData(trans, null, clipid.kGlobalClipboard);
    }*/
    else {
        alert("This function cannot be supported in this browser.");
    }
}
