// Flash Link
var __isMapleTespiaPlatform = false;

function MapleFlashURL( sServiceURL, strPageURL )
{
	if ( __isMapleTespiaPlatform )
		return 'Gnx.aspx?URL=' + strPageURL;
	else
		return sServiceURL + "?URL=" + strPageURL
}

function Main_StyleSearch( codeStyleType )
{
	if ( document.domain == "maplestoryt.nexon.com" )
	{
		location.href = MapleFlashURL( "http://maplestoryt.nexon.com/MapleStory/Page/Gnx.aspx", "Plaza/StyleSearch&codeStyle=" + codeStyleType );
	}
	else
	{
		location.href = MapleFlashURL( "http://community.maplestory.nexon.com/MapleStory/Page/Gnx.aspx", "Plaza/StyleSearch&codeStyle=" + codeStyleType );
	}
	
}

function Main_MyInfo( )
{
	location.href = MapleFlashURL( "http://community.maplestory.nexon.com/MapleStory/Page/Gnx.aspx", "Plaza/MyInfo" );
}

/*
function Main_MakeDiary()
{
	window.open( 'http://diary.maplestory.nexon.com/MapleStory/Page/GnxPopup.aspx?URL=Diary/Pop_Makediary', 'PhotoUp', 'scrollbars=no, resizable=no, width=414, height=460' );
}
*/

/*
function Main_MyDiary( AccountID )
{
	window.open( "http://diary.maplestory.nexon.com/MapleStory/Diary/Diary.aspx?AccountID=" + AccountID, "DI_" + AccountID, "width=1000, height=695" );
}
*/


function Main_FriendGift( nAccountID_Friend )
{
}

function Main_MyPrizeSet( )
{
	if ( document.domain == "maplestoryt.nexon.com" )
	{
		window.open( "http://maplestoryt.nexon.com/Maplestory/page/GnxPopup.aspx?URL=Shop/Pop_stylesetup", "ShopSyleSetup" ,"width=550, height=330" );
	}
	else
	{
		window.open( "http://shop.maplestory.nexon.com/Maplestory/page/GnxPopup.aspx?URL=Shop/Pop_stylesetup", "ShopSyleSetup" ,"width=550, height=330" );
	}
}

function Main_PrizeBuy( nItem )
{
	//location.href = MapleFlashURL( "http://shop.maplestory.nexon.com/MapleStory/Page/Gnx.aspx", "Shop/Main" );
	if ( document.domain == "maplestoryt.nexon.com" )
	{
		window.open( "http://maplestoryt.nexon.com/MapleStory/Page/GnxPopup.aspx?URL=Shop/pop_detail&n4ProductNo="+nItem, "BuyCart","left=0, top=0, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizeable=no, copyhistory=no, width=550, height=700" );
	}
	else
	{
		window.open( "http://shop.maplestory.nexon.com/MapleStory/Page/GnxPopup.aspx?URL=Shop/pop_detail&n4ProductNo="+nItem, "BuyCart","left=0, top=0, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizeable=no, copyhistory=no, width=550, height=700" );
	}
}


function maple_home()
{
    location.href = "http://maplestory.nexon.com/MapleStory/Page/Gnx.aspx?URL=Home/index"
}
function gTop_01()
{
    location.href = "http://maplestory.nexon.com/MapleStory/Page/Gnx.aspx?URL=Resource/Download"
}
function gTop_02()
{
    var win1= window.open( 'http://itcg.maplestory.nexon.com/ITCG2/Page/Gnx.aspx?URL=Home/Main', 'ITCG', 'scrollbars=no, resizable=no, width=1000, height=695' ); 
	win1.focus(); 
}
function gTop_03()
{
    func_security();
}

function go_navi(main,sub)
{
    switch(main)
    {
        case 1 :
            switch(sub)
            {
                case 0 : location.href="http://maplestory.nexon.com/MapleStory/Page/Gnx.aspx?URL=News/NoticeBoard";break;
                case 1 : location.href="http://maplestory.nexon.com/MapleStory/Page/Gnx.aspx?URL=News/NoticeBoard";break;
                case 2 : location.href="http://maplestory.nexon.com/MapleStory/Page/Gnx.aspx?URL=News/UpdateBoard";break;
                case 3 : location.href="http://maplestory.nexon.com/MapleStory/Page/Gnx.aspx?URL=Event/EventBoard&codeSearchType=3&oidArticleCategory_search=2";break;
                case 4 : location.href="http://maplestory.nexon.com/MapleStory/Page/Gnx.aspx?URL=News/DiaryBoard";break;
                case 5 : location.href="http://maplestory.nexon.com/MapleStory/Page/Gnx.aspx?URL=News/PollBoard";break;
            }
            break;
        case 2 :
            switch(sub)
            {
                case 0 : location.href="http://maplestory.nexon.com/MapleStory/Page/Gnx.aspx?URL=Guide/introduce";break;
                case 1 : location.href="http://maplestory.nexon.com/MapleStory/Page/Gnx.aspx?URL=Guide/Install";break;
                case 2 : location.href="http://maplestory.nexon.com/MapleStory/Page/Gnx.aspx?URL=Guide/Character";break;
                //case 3 : location.href="http://maplestory.nexon.com/MapleStory/Page/Gnx.aspx?URL=Guide/Skill";break;
                case 4 : location.href="http://maplestory.nexon.com/MapleStory/Page/Gnx.aspx?URL=Guide/Item";break;
                case 5 : location.href="http://maplestory.nexon.com/MapleStory/Page/Gnx.aspx?URL=Guide/Quest";break;
            }
            break;
        case 3 :
            switch(sub)
            {
                case 0 : location.href="http://rank.maplestory.nexon.com/maplestory/page/gnx.aspx?url=ranking/main";break;
                case 1 : location.href="http://rank.maplestory.nexon.com/maplestory/page/gnx.aspx?url=ranking/seasonranking";break;
                case 2 : location.href="http://rank.maplestory.nexon.com/maplestory/page/gnx.aspx?url=ranking/totalranking";break;
                case 3 : location.href="http://rank.maplestory.nexon.com/maplestory/page/gnx.aspx?url=ranking/guildranking2";break;
                case 4 : location.href="http://rank.maplestory.nexon.com/maplestory/page/gnx.aspx?url=ranking/schoolgroupranking";break;
                case 5 : location.href="http://rank.maplestory.nexon.com/maplestory/page/gnx.aspx?url=ranking/halloffame";break;
            }
            break;
        case 4 :
            switch(sub)
            {
                case 0 : location.href="http://community.maplestory.nexon.com/MapleStory/Page/Gnx.aspx?URL=KnowLab/Main";break;
                case 1 : location.href="http://community.maplestory.nexon.com/MapleStory/Page/Gnx.aspx?URL=KnowLab/KnowLabBoard&oidArticleCategory_search=1&oidArticleSubCategory_search=1&codeSearchType=100&n4Menu=101";break;
                case 2 : location.href="http://community.maplestory.nexon.com/MapleStory/Page/Gnx.aspx?URL=KnowLab/Map";break;
                case 3 : location.href="http://community.maplestory.nexon.com/MapleStory/Page/Gnx.aspx?URL=KnowLab/ScreenShot";break;
                case 4 : location.href="http://community.maplestory.nexon.com/MapleStory/Page/Gnx.aspx?URL=KnowLab/MapleKnowledgeKing";break;
            }
            break;
        case 5 :
            switch(sub)
            {
                case 0 : location.href="http://community.maplestory.nexon.com/MapleStory/Page/Gnx.aspx?URL=Plaza/Main";break;
                case 1 : location.href="http://community.maplestory.nexon.com/Maplestory/Page/Gnx.aspx?URL=Plaza/FamilyMain";break;
                case 2 : location.href="http://community.maplestory.nexon.com/Maplestory/Page/Gnx.aspx?URL=Plaza/UserNews";break;
                case 3 : location.href="http://community.maplestory.nexon.com/Maplestory/Page/Gnx.aspx?URL=Plaza/StoryUCC";break;
                case 4 : location.href="http://maplestory.nexon.com/maplestory/page/Gnx.aspx?URL=Plaza/FriendSearch";break;
                case 5 : location.href="http://community.maplestory.nexon.com/Maplestory/Page/Gnx.aspx?URL=News/PhotoBoard";break;
            }
            break;
         case 6 :
            switch(sub)
            {
                case 0 : location.href="http://shop.maplestory.nexon.com/Maplestory/Page/Gnx.aspx?URL=shop/main";break;
                case 1 : location.href="http://shop.maplestory.nexon.com/maplestory/page/Gnx.aspx?URL=Shop/shop&n4Category=514";break;
                case 2 : location.href="http://shop.maplestory.nexon.com/maplestory/page/Gnx.aspx?URL=Shop/shop&n4Category=526";break;
                case 3 : location.href="http://shop.maplestory.nexon.com/maplestory/page/Gnx.aspx?URL=Shop/shop&n4Category=529";break;
                case 4 : location.href="http://shop.maplestory.nexon.com/maplestory/page/Gnx.aspx?URL=Shop/shop&n4Category=535";break;
                case 5 : location.href="http://shop.maplestory.nexon.com/maplestory/page/Gnx.aspx?URL=Shop/shop&n4Category=538";break;
                case 6 : window.open( "http://freecash.nexon.com/main.asp?mech_code=AF000123");break;
                case 7 : location.href="http://shop.maplestory.nexon.com/maplestory/page/Gnx.aspx?URL=shop/item_freecharge";break;
            }
            break;
         case 7 :
            switch(sub)
            {
                case 0 : location.href="http://community.maplestory.nexon.com/MapleStory/Page/Gnx.aspx?URL=HelpDesk/Main";break;
                case 1 : location.href="http://community.maplestory.nexon.com/Maplestory/Page/Gnx.aspx?URL=HelpDesk/FAQBoard";break;
                case 2 : location.href="http://community.maplestory.nexon.com/Maplestory/Page/Gnx.aspx?URL=HelpDesk/BugStep01";break;
                case 3 : location.href="http://community.maplestory.nexon.com/MapleStory/Page/Gnx.aspx?URL=HelpDesk/OtpInfo";break;
            }
            break;
    }
}

function game_Start()
{
    startgame( 1 );
}