﻿//top navigation link
function MenuRedirect(ch1,ch2) {
	var url="";
	if (ch1=='1')  {
		if (ch2=='1') url= "/board/Notice/list";
		else if (ch2=='2') url= "/event/eventList";
		else if (ch2=='3') url= "/board/Poll/PollList";
		else url= "/board/Notice/list";
	} else if (ch1=='2') {
		if (ch2=='1') url= "/gameinfo/intro1";
		else if (ch2=='2') url= "/gameinfo/map";
		else if (ch2=='3') url= "/giweb/weapon/";
		else if (ch2=='4') url= "/gameinfo/system1";
		else if (ch2=='5') url= "/gameinfo/run1";
		else url= "/gameinfo/intro1";
	} else if (ch1=='3') {
		if (ch2=='1') url= "/gis/ranking/personal/list?rankingDateTypeId=Daily&pageSize=100";
		else if (ch2=='2') url= "/gis/ranking/clan/clanlist?pageSize=100";
		else url= "/gis/ranking/personal/list?rankingDateTypeId=Daily&pageSize=100";
	} else if (ch1=='4') {
		if (ch2=='1') url= "/clan/main";
		else if (ch2=='2') url= "/clan/search";
		else if (ch2=='3') url= "/board/ClanPublicity/list";
		else if (ch2=='4') url= "/board/ClanApply/list";
		else if (ch2=='5') url= "/clan/guide1";
		else url= "/clan/main";
	} else if (ch1=='5') {
		if (ch2=='1') url= "/board/Free/list";
		else if (ch2=='2') url= "/board/Tip/list";
		else if (ch2=='3') url= "/board/Multimedia/list";
		else url= "/board/Free/list";
	}
	else if (ch1=='6') {
		url="/download";
	}
	else if (ch1=='7') {
		url="/giweb/item/";
	}
	if(url) window.location.href = url;
}

function goHome(){
	window.location.href="/";
}

function goApplyTester(){
	if (isLogged() == "true") {
		new Ajax.Request(
				"/common/inc/loginCheck",
				{	method:'post',
					encoding: 'UTF-8',
					onComplete: popupApplayTester,
					onFailure: function()
					{
						alert("인증정보를 가져오지 못했습니다.");
					}
				}
			);
	} else {
		alert("로그인 후 테스터 신청이 가능합니다.");
	}
}
function popupApplayTester(result) {
	if ( result.responseText == 'true' ) {
		openDenyPopup("/proposal/proposalQuestion","630","700", "yes", "pop_apply");
	} else {
		alert("세션이 종료되었습니다. 다시 로그인하신 후 테스터 신청이 가능합니다.");
		location.reload();
	}
}
function goDownload() {
	window.open('/download/download','','width=640,height=380,toolbar=0,status=no,scrollbars=no,resizable=0');
}
function popupDownload(result) {
	if ( result.responseText == 'OK' ) {
		window.open('/download/download','','width=640,height=380,toolbar=0,status=no,scrollbars=no,resizable=0');
	} else if ( result.responseText == 'NOTESTER' ) {
		alert("죄송합니다. 테스터로 선정된 분들만 다운로드가 가능합니다.");
		/*
		if (confirm("게임 실행은 클로즈 배타 테스터만 가능합니다.\n계속 하시겠습니까?")) {
			window.open('/download/download','','width=640,height=380,toolbar=0,status=no,scrollbars=no,resizable=0');
		}
		*/
	} else {
		alert("세션이 종료되었습니다. 다시 로그인하신 후 게임 실행이 가능합니다.");
		location.reload();
	}
}
function pbOnly(val){
	if (val==0) location.href="gameinfo/intro#pbonly1";
	else if (val==1)  location.href="gameinfo/intro#pbonly2";
	else location.href="gameinfo/intro#pbonly3";
}

function gotoPage() {
	location.href="http://pb.plaync.co.kr/board/Free/view?articleID=7773&page=1&searchCondition=6&searchKeyword=%EB%A6%AC%EB%8B%88%EC%A7%80";
}


function itemLink() {
	location.href="/giweb/item/";
}
