﻿if(this.GLOBAL_UFORIA_URL == undefined)
{
	this.GLOBAL_UFORIA_URL = "http://www.uforia.com";
}

if(this.GLOBAL_NOSTAL_URL == undefined)
{
	this.GLOBAL_NOSTAL_URL = "http://nostale.uforia.com";
}

function main01() { location.href="/";}

/****** main menu ******/
function menu1() { location.href = "/News/"; }
function menu2() { location.href = "/About/"; }
function menu3() { location.href = "/Shop/"; }
function menu4() { location.href = "http://forum.uforia.com/?C=1";}
function menu5() { location.href = "/Download/"; }
function menu6() { location.href = "/Support/"; }


/******* News ******/
function menu1sub1() { location.href = "/News/"; }
function menu1sub2() { location.href = "/News/Ranking.aspx"; }
function menu1sub3() { location.href = "/News/Event.aspx"; }


/******* About Nostale ******/
function menu2sub1() { location.href = "/About/"; }
function menu2sub2() { location.href = "/About/Classes.aspx"; }
function menu2sub3() { location.href = "/About/Map.aspx"; }
function menu2sub4() { location.href = "/Guide/"; }

/******* shop ******/
function menu3sub1() { location.href = "/Shop/"; }

/******* Forum ******/
function menu4sub1() { location.href = "http://forum.uforia.com/?C=1";}

/******* Download ******/
function menu5sub1() { location.href = "/Download/"; }
function menu5sub2() { location.href = "/Download/Movies.aspx"; }
function menu5sub3() { location.href = "/Download/Wallpaper.aspx"; }

/******* Support ******/
function menu6sub1() { location.href = "/Support/"; }
function menu6sub2() { location.href = "/Support/Rules.aspx"; }
function menu6sub3() { location.href = this.GLOBAL_UFORIA_URL + "/Help/QnA.aspx?game=1"; }

/******* LeftMenu *******/
function view_gamedb() { 
	var win_gamedb;
	win_gamedb = window.open("http://www.nostale.net/ingame/gamedb/index.html", "gamedb", "width=773,height=550");
}

function activeNostale() { 
        document.getElementById("activatePop").style.left = (document.body.clientWidth / 2) - 150;
        document.getElementById("activatePop").style.top = ((document.body.clientHeight / 2) - 180) + document.body.scrollTop;
	document.getElementById("activatePop").style.display = "";
}

function goActivate() { 
        location.href = "/auth_nostale.aspx?refUrl=" + escape(document.URL);
}

function close_active() {
	document.getElementById("activatePop").style.display = "none";
	SetCookie("activatePop", "N", 0, "/", "uforia.com");
}

function ClickJoin() {
	location.href = this.GLOBAL_UFORIA_URL + "/member/?home=nostale";
}

document.writeln("<div id='activatePop' style='position:absolute; left:300; top:300; width:300; height:360; z-index:99;display:none;'>");
document.writeln("    <table width='303' height='364' border='0' cellpadding='9' cellspacing='0'>");
document.writeln("        <tr>");
document.writeln("	        <td align='center' valign='top' background='http://image.uforia.com/common/popup_account001.jpg' bgcolor='dff2ff'>");
document.writeln("		        <table border='0' align='center' cellpadding='0' cellspacing='0'>");
document.writeln("			        <tr>");
document.writeln("				        <td height='305'> </td>");
document.writeln("			        </tr>");
document.writeln("			        <tr>");
document.writeln("				        <td align='center'>");
document.writeln("					        <table border='0' align='center' cellpadding='0' cellspacing='0'>");
document.writeln("						        <tr>");
document.writeln("							        <td width='104'><a href='javascript:goActivate();'><img src='http://image.uforia.com/common/btn_popup_ok.gif' alt='OK' width='104' height='29' border='0'></a></td>");
document.writeln("							        <td width='10'>&nbsp;</td>");
document.writeln("							        <td width='104'><a href='javascript:close_active();'><img src='http://image.uforia.com/common/btn_popup_cancel.gif' alt='Cancel' width='104' height='29' border='0'></a></td>");
document.writeln("						        </tr>");
document.writeln("					        </table>");
document.writeln("				        </td>");
document.writeln("			        </tr>");
document.writeln("		        </table>");
document.writeln("	        </td>");
document.writeln("       </tr>");
document.writeln("   </table>");
document.writeln("</div>");

if (getCookie("activatePop") != "N") {
	activeNostale();
}

/******* Game Start ******/
function menu7() { location.href = "#"; }

this.GLOBAL_MENU_MAIN = 0;
this.GLOBAL_MENU_SUB = 0;

function SolveMenuPath()
{

    arrMenuInfo = new Array();
    arrMenuInfo[arrMenuInfo.length] = {url:'/News/',main:1,sub:1}
    arrMenuInfo[arrMenuInfo.length] = {url:'/News/Default.aspx',main:1,sub:1}
    arrMenuInfo[arrMenuInfo.length] = {url:'/News/Ranking.aspx',main:1,sub:2}
    arrMenuInfo[arrMenuInfo.length] = {url:'/News/Event.aspx',main:1,sub:3}
    arrMenuInfo[arrMenuInfo.length] = {url:'/About/',main:2,sub:1}
    arrMenuInfo[arrMenuInfo.length] = {url:'/About/Default.aspx',main:2,sub:1}
    arrMenuInfo[arrMenuInfo.length] = {url:'/About/Default2.aspx',main:2,sub:1}
    arrMenuInfo[arrMenuInfo.length] = {url:'/About/Classes.aspx',main:2,sub:2}
    arrMenuInfo[arrMenuInfo.length] = {url:'/About/Classes2.aspx',main:2,sub:2}
    arrMenuInfo[arrMenuInfo.length] = {url:'/About/Map.aspx',main:2,sub:3}
    arrMenuInfo[arrMenuInfo.length] = {url:'/Guide/',main:2,sub:4}
    arrMenuInfo[arrMenuInfo.length] = {url:'/Guide/Default.aspx',main:2,sub:4}
    arrMenuInfo[arrMenuInfo.length] = {url:'/Guide/Default2.aspx',main:2,sub:4}
    arrMenuInfo[arrMenuInfo.length] = {url:'/Guide/Default3.aspx',main:2,sub:4}
    arrMenuInfo[arrMenuInfo.length] = {url:'/Guide/Default4.aspx',main:2,sub:4}
    arrMenuInfo[arrMenuInfo.length] = {url:'/Guide/Default5.aspx',main:2,sub:4}
    arrMenuInfo[arrMenuInfo.length] = {url:'/Guide/Default6.aspx',main:2,sub:4}
    arrMenuInfo[arrMenuInfo.length] = {url:'/Guide/Default7.aspx',main:2,sub:4}
    arrMenuInfo[arrMenuInfo.length] = {url:'/Guide/Default8.aspx',main:2,sub:4}
    arrMenuInfo[arrMenuInfo.length] = {url:'/Guide/Default9.aspx',main:2,sub:4}
    arrMenuInfo[arrMenuInfo.length] = {url:'/Guide/Default10.aspx',main:2,sub:4}
    arrMenuInfo[arrMenuInfo.length] = {url:'/Guide/Default11.aspx',main:2,sub:4}
    arrMenuInfo[arrMenuInfo.length] = {url:'/Guide/Default12.aspx',main:2,sub:4}
    arrMenuInfo[arrMenuInfo.length] = {url:'/Shop/',main:3,sub:1}
    arrMenuInfo[arrMenuInfo.length] = {url:'/Shop/Default.aspx',main:3,sub:1}
    arrMenuInfo[arrMenuInfo.length] = {url:'/Shop/Detail.aspx',main:3,sub:1}
    arrMenuInfo[arrMenuInfo.length] = {url:'/Download/',main:5,sub:1}
    arrMenuInfo[arrMenuInfo.length] = {url:'/Download/Default.aspx',main:5,sub:1}
    arrMenuInfo[arrMenuInfo.length] = {url:'/Download/Movies.aspx',main:5,sub:2}
    arrMenuInfo[arrMenuInfo.length] = {url:'/Download/Wallpaper.aspx',main:5,sub:3}
    arrMenuInfo[arrMenuInfo.length] = {url:'/Support/',main:6,sub:1}
    arrMenuInfo[arrMenuInfo.length] = {url:'/Support/Default.aspx',main:6,sub:1}
    arrMenuInfo[arrMenuInfo.length] = {url:'/Support/Rules.aspx',main:6,sub:2}
    
    var curpath = self.location.pathname;
    
    for(var intLoop = 0; intLoop < arrMenuInfo.length; intLoop++)
	{
	    if(curpath.toLowerCase() == arrMenuInfo[intLoop].url.toLowerCase())
	    {
	        this.GLOBAL_MENU_MAIN = arrMenuInfo[intLoop].main;
            	this.GLOBAL_MENU_SUB = arrMenuInfo[intLoop].sub;
            break;
	    }
	}
    
}

SolveMenuPath();

document.writeln("<div id='menu' style='position:absolute; left:0; top:38; width:100%; height:300; z-index:2;'>																																																	");
document.writeln("<table width='100%' border='0' cellspacing='0' cellpadding='0'>                                                                                                                               ");
document.writeln("	<tr>                                                                                                                                                                                        ");
document.writeln("		<td>&nbsp;</td>                                                                                                                                                                           ");
document.writeln("		<td width='976'><" + "script language=\"javascript\">printSWF('GlobalTopMenu', 'http://image.uforia.com/swf/nostale_menu.swf?main=" + this.GLOBAL_MENU_MAIN + "&sub=" + this.GLOBAL_MENU_SUB + "',976,244,'transparent', '#FFFFFF',null);</" + "script></td> ");
document.writeln("		<td>&nbsp;</td>                                                                                                                                                                           ");
document.writeln("	</tr>                                                                                                                                                                                       ");
document.writeln("</table>                                                                                                                                                                                      ");
document.writeln("</div>                                                                                                                                                                                        ");