﻿/**
 * 상단 글러벌 메뉴 링크 입니다.
*/
/**
 * 상단 피카플레이 로고 링크 입니다.. .
*/
var url_0_0 = "http://www.picaplay.com/html/main.html";									//상단 로고 - 메인으로 이동
var url_0_1 = "http://www.picaplay.com/playzone/chipStore.aspx";						        //상단 비행기


/**
 * 상단 글러벌 메뉴 링크 입니다.
*/
var url_1_0 = "http://www.picaplay.com/shop/Main2.aspx";					//피카샵 - 피카샵
var url_1_1 = "http://www.picaplay.com/AllyZone/ProdList.aspx?datacp=0023";					//제휴몰넷마블
var url_1_2 = "http://www.picaplay.com/AllyZone/ProdList.aspx?datacp=0019";					//제휴몰피망
//var url_1_1 = "http://www.picaplay.com/AllyZone/PmangMain.aspx";					//제휴몰피망이벤트용
//var url_1_2 = "http://www.picaplay.com/AllyZone/ProdList.aspx?datacp=0020";					//제휴몰한게임

//var url_1_2 = "http://www.picaplay.com/shop/Main2.aspx";					//피카샵 - 피카샵
var url_1_3 = "http://www.picaplay.com/shop/conductShop.aspx";				//피카샵 - 이용안내
var url_1_4 = "http://www.picaplay.com/shop/conductContents.aspx";			//피카샵 - 이용가능컨텐츠
var url_1_5 = "http://www.picaplay.com/AllyZone/ProdList.aspx?datacp=0025";					//제휴몰엠게임



var url_2_1 = "http://www.picaplay.com/event/EventListNew.aspx";				//피카혜택존 - 메인
var url_2_2 = "http://www.picaplay.com/event/postScript.aspx";				//피카혜택존 - 참여후기

var url_2_3 = "http://www.picaplay.com/event/Guide.aspx";					//혜택존 이용안내 - 피카가이드
var url_2_4 = "http://www.picaplay.com/event/FreeCharge.aspx";				//혜택존 - 무료충전소

//var url_3_0 = "http://www.picaplay.com/playzone/main.aspx";					//플레이존 - 메인
var url_3_0 = "http://www.picaplay.com/Event/Auction_List.aspx";					//타임옥션 - 메인
var url_3_1 = "http://www.picaplay.com/playzone/PlayGame.aspx";				//플레이존 - 기타게임
var url_3_2 = "http://www.picaplay.com/playzone/couponEvent.aspx";				//플레이존 - 기타게임
var url_3_3 = "http://www.picaplay.com/playzone/chipStore.aspx";			//플레이존 - 이벤트
var url_3_4 = "http://www.picaplay.com/playzone/PrizeList.aspx";			//플레이존 - 이벤트
var url_3_5 = "http://www.picaplay.com/playzone/Guide.aspx";				//플레이존 - 이벤트


var url_4_1 = "http://www.picaplay.com/support/picaGuide.aspx";                //고객지원 - 이용안내
var url_4_2 = "http://www.picaplay.com/support/notice.aspx";                //고객지원 - 공지사항
var url_4_3 = "http://www.picaplay.com/support/faq.aspx";	                //고객지원 - FAQ
var url_4_4 = "http://www.picaplay.com/support/inquiryWrite.aspx";               //고객지원 - 1:1문의
var url_4_5 = "http://www.picaplay.com/support/picapcbFind.aspx";           //고객지원 - 피카 PC방 찾기


var url_5_1 = "http://www.picaplay.com/MyPage/myInfo.aspx"; 			    //마이페이지 - 개인정보
var url_5_2 = "http://www.picaplay.com/MyPage/myBuyInfo.aspx";              //마이페이지 - 피카샵 구매내역
var url_5_3 = "http://www.picaplay.com/MyPage/myPica.aspx"; 			    //마이페이지 - 나의피카
var url_5_4 = "http://www.picaplay.com/MyPage/myChip.aspx"; 			    //마이페이지 - 칩사용내역
var url_5_5 = "http://www.picaplay.com/MyPage/myCounsel.aspx"; 		    //마이페이지 - 나의상담내역
var url_5_6 = "http://www.picaplay.com/MyPage/myAuction.aspx"; 			//마이페이지 - 당첨내역
var url_5_7 = "http://www.picaplay.com/MyPage/Auction_MyBidList.aspx"; 			//마이페이지 - 타임옥션내역

var pageNum = 6;
var subNum = 1;

/**
 * 기타 플래시 링크들 
*/
var url_8_1 = "/shop/Main2.aspx";                                                            //혜택존 메인 상단 [같은돈으로 더 많이 받으세요] 한게임 충전 이벤트로 이동




if(location.href.toLowerCase().indexOf("/shop/")>0 || location.href.toLowerCase().indexOf("/allyzone/")>0) // 간편샾
{
	pageNum = 1;
	
	if (location.href.toLowerCase().indexOf("conductshop.aspx")>0) // 이용안내
	{
		subNum = 3;
	}
	else if (location.href.toLowerCase().indexOf("conductcontents.aspx")>0) // 이용가능 컨텐츠
	{
		subNum = 4;
	}
	else
	{
		subNum = 0;	
		
		if ((location.href.toLowerCase().indexOf("/allyzone/")>0 && location.href.toLowerCase().indexOf("=0019")>0) || location.href.toLowerCase().indexOf("pmangevent")>0)
		{
			subNum = 2;
		}
		else if (location.href.toLowerCase().indexOf("/allyzone/")>0 && location.href.toLowerCase().indexOf("=0023")>0)
		{
			subNum = 1;
		}
		else if (location.href.toLowerCase().indexOf("/allyzone/")>0 && location.href.toLowerCase().indexOf("=0025")>0)
		{
			subNum = 5;
		}
	}

}
else if (location.href.toLowerCase().indexOf("/event/")>0) // 혜택존
{
	pageNum = 2;

	if (location.href.toLowerCase().indexOf("/postscript.aspx")>0)
	{
		subNum = 2
	}
	else if (location.href.toLowerCase().indexOf("guide.aspx")>0)
	{
		subNum = 3;
	}
	else if (location.href.toLowerCase().indexOf("freecharge.aspx")>0)
	{
		subNum = 4;
	}
	else
	{
		subNum = 1;	
	}
}
else if (location.href.toLowerCase().indexOf("/Event/")>0) // 플레이존
{
	pageNum = 3;
	
	if (location.href.toLowerCase().indexOf("main.aspx")>0) // 메인
	{
		subNum = 0;	
	}
	else if (location.href.toLowerCase().indexOf("playgame.aspx")>0) // 플레시게임
	{
		subNum = 1;	
	}
	else if (location.href.toLowerCase().indexOf("couponevent.aspx")>0) //기타게임
	{
		subNum = 2;
	}
	else if (location.href.toLowerCase().indexOf("prizelist.aspx")>0 || location.href.toLowerCase().indexOf("prizedetail.aspx")>0) // 당첨자발표
	{
		subNum = 4;
	}
	else if (location.href.toLowerCase().indexOf("guide.aspx")>0) //이용안내
	{
		subNum = 5;
	}
	else
	{
		subNum = 3;
	}
	
}
else if (location.href.toLowerCase().indexOf("/support/")>0) // 고객센터
{
	pageNum = 4;
	
	if (location.href.toLowerCase().indexOf("picaguide.aspx")>0) // 사이트이용안내
	{
		subNum = 1;	
	}
	else if (location.href.toLowerCase().indexOf("/notice")>0) // 공지사항
	{
		subNum = 2;
	}
	else if (location.href.toLowerCase().indexOf("faq.aspx")>0) // FAQ
	{
		subNum = 3;
	}
	else if (location.href.toLowerCase().indexOf("picapcbfind.aspx")>0)
	{
		subNum = 5;
	}
	else
	{
		subNum = 4;
	}
}
else if (location.href.toLowerCase().indexOf("/mypage/") > 0) // 마이페이지
{
	pageNum = 5;
	
	if (location.href.toLowerCase().indexOf("/myinfo")>0) // 내정보
	{
		subNum = 1;	
	}
	else if (location.href.toLowerCase().indexOf("mybuyinfo.aspx")>0) // 구매내역
	{
		subNum = 2;
	}
	else if (location.href.toLowerCase().indexOf("mypica.aspx")>0) // 피카사용내역
	{
		subNum = 3;
	}
	else if (location.href.toLowerCase().indexOf("mychip.aspx")>0) // 칩사용내역
	{
		subNum = 4;
	}
	else if (location.href.toLowerCase().indexOf("myauction.aspx")>0) // 당첨확인
	{
		subNum = 6;
	}
	else if (location.href.toLowerCase().indexOf("/auction_")>0) // 타임옥션관련
	{
		subNum = 7;
	}
	else
	{
		subNum = 5;
	}
}


function menu_url(depth1, depth2)
{
	if (depth1 == "6" || depth1 == "7")
	{
		menu_url_adlink(depth1,depth2);
	}
	else
	{
		var url = "";

		try
		{
			url = eval("url_"+depth1+"_"+depth2);
		}
		catch(e){}

		if(url != "" && url !="undefined")
		{
			if (url.indexOf("(") < 0)
			{
				if(url.indexOf("?") > -1)
				{
					url = url + "&menu_name="+depth1+"_"+depth2;
				}
				else
				{
					url = url + "?menu_name="+depth1+"_"+depth2;
				}
			}

			
			if(depth1 == "0" && depth2 == "0" )
			{
				top.location.href = "http://www.picaplay.com";
			}
			else
			{
				self.location.href = url;
			}
		}
	}
}


function menu_url_adlink(depth1,depth2)
{
	var url = "";

	try
	{
		url = eval("url_"+depth1+"_"+depth2+"_link");
	}
	catch(e){}

	if(url != "" && url !="undefined")
	{
		if (url.indexOf("(") < 0)
		{
			if(url.indexOf("?") > -1)
			{
				url = url + "&menu_name="+depth1+"_"+depth2;
			}
			else
			{
				url = url + "?menu_name="+depth1+"_"+depth2;
			}
		}

		if (eval("url_"+depth1+"_"+depth2+"_open") == "Y")
		{
			window.open(url, 'download', 'toolbar=1,directories=1,status=1,menubar=1,scrollbars=yes,resizable=1,location=yes');
		}
		else
		{
			self.location.href = url;
		}
	}
}
