


//-----------------------------------------------------------------------------------------
// 주소 뒤 vst= 는 제휴사이트 아이프레임제어용 값
//-----------------------------------------------------------------------------------------

//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

//---------------------------------------------------------------------------------------------------------
//	위성사진으로 이동
//---------------------------------------------------------------------------------------------------------
	function Mainmenu_satellite() {		
		if (gCurPage.toUpperCase() == "NKMAP.ASP" || gCurPage.toUpperCase() == "NK3DMAP.ASP"
								|| gCurPage.toUpperCase() == "3DMAP.ASP"|| gCurPage.toUpperCase() == "SUBWAY.ASP" || gCurPage.toUpperCase().indexOf("AGENCY")>-1 || gCurPage.toUpperCase().indexOf("MULGUN")>-1){
			if (visit_frm != ""){
				location.href = "/Google/SatelliteMap.asp?vst="+visit_frm;
			}else{
				location.href = "/Google/SatelliteMap.asp";	
			}
		}else{
			centermapsatellite();
		}
	}
//---------------------------------------------------------------------------------------------

//---------------------------------------------------------------------------------------------------------
//	항공사진으로 이동
//---------------------------------------------------------------------------------------------------------
	function Mainmenu_op(optype) {	
		var sMenuURL = "";
		if (optype == 'op1') {
			if (gCurPage.toUpperCase() == "MAIN.ASP" || gCurPage.toUpperCase() == "ADMAIN.ASP") {	 
				map_sizeset();
				Type_Change("OP");			
				document.getElementById("geopis_logo").style.display = "block";	    // 지오피스 로고
				document.getElementById("hanil_logo").style.display = "none";
			}else if (gCurPage.toUpperCase() == "NKMAP.ASP" || gCurPage.toUpperCase() == "NK3DMAP.ASP"
							 || gCurPage.toUpperCase() == "3DMAP.ASP"|| gCurPage.toUpperCase() == "SUBWAY.ASP" 
               || gCurPage.toUpperCase().indexOf("AGENCY")>-1 || gCurPage.toUpperCase().indexOf("MULGUN")>-1 ){
				if (visit_frm != ""){
					location.href = "/Map/Main.asp?mapType=OP&vst="+visit_frm;//=>해당 페이지의 경우 좌표값을 가져올 수 없기에 이동시 default값으로 적용되어 이동
				}else{
					location.href = "/Map/Main.asp?mapType=OP";
				}
			}else{
				opcentermap();//구글 지도에서 좌표값 x,y,x1,y1의 값을 가져와서 항공사진(2D)에 뿌려주는 함수(좌표값이 없을 경우 default값으로 이동)
				//Map/include/js/MapEngine.js의 줄:7779에 위치
			}
		}else if (optype == 'op2')	{
			if (visit_frm != ""){
				location.href = "/Map/3dmap.asp?vst="+visit_frm;
			}else{
				if (gCurPage.toUpperCase() == "NK3DMAP.ASP"){	 
					if(mem_lev == 0){
						alert("유료회원에게만 제공되는 서비스입니다.");
					}else if(mem_lev == 1 || mem_lev==99){
						alert("유료회원에게만 제공되는 서비스입니다.");
					}else{
						location.href = "/Map/3dmap.asp";
					}
				}else{
					if(mem_lev == 0){
						popAlert("popAlertNoLogin");
					}else if(mem_lev == 1 || mem_lev==99){
						popAlert("popAlertNormalUser");
					}else{
						location.href = "/Map/3dmap.asp";
					}
				}
			}
		}else if(optype=='op3'){
			var mapping_type="subway";
			Map_style = mapping_type;
			if(mapping_type == 'subway') {
				if (visit_frm != ""){
					location.href = "/Map/Subway.asp?vst="+visit_frm;
				}else{
					location.href = "/Map/Subway.asp";
				}
			}
		}
	}
//---------------------------------------------------------------------------------------------------------

//---------------------------------------------------------------------------------------------------------
//	지도로 이동
//---------------------------------------------------------------------------------------------------------
	function Mainmenu_cm(cmtype) {		
		if (cmtype == 'cm1') {
			if (gCurPage.toUpperCase() == "MAIN.ASP" || gCurPage.toUpperCase() == "ADMAIN.ASP") {	 
						map_sizeset();
						Type_Change("CM");
						
						document.getElementById("hanil_logo").style.display = "block";		    // 한일 로고 
						document.getElementById("geopis_logo").style.display = "none";		
					}
			else if (gCurPage.toUpperCase() == "NKMAP.ASP" || gCurPage.toUpperCase() == "NK3DMAP.ASP"
								|| gCurPage.toUpperCase() == "3DMAP.ASP"|| gCurPage.toUpperCase() == "SUBWAY.ASP"
                || gCurPage.toUpperCase().indexOf("AGENCY")>-1 || gCurPage.toUpperCase().indexOf("MULGUN")>-1 ){
				if (visit_frm != ""){
					location.href = "/Map/Main.asp?mapType=CM&vst="+visit_frm;
				}else{
					location.href = "/Map/Main.asp?mapType=CM";//=>해당 페이지의 경우 좌표값을 가져올 수 없기에 이동시 default값으로 적용되어 이동
				}				
			}else{
				//location.href = "/Map/Main.asp?mapType=CM";
				cm1centermap();//구글 지도에서 좌표값 x,y,x1,y1의 값을 가져와서 지번도에 뿌려주는 함수(좌표값이 없을 경우 default값으로 이동)
											//Map/include/js/MapEngine.js의 줄:7802에 위치
			}
			
		}else if (cmtype == 'cm2'){

			if (visit_frm != ""){						
				location.href = "/Google/CM2Map.asp?vst="+visit_frm;					
			}else{				
				location.href = "/Google/CM2Map.asp";
			}
			
			if (gCurPage.toUpperCase() == "MAIN.ASP" || gCurPage.toUpperCase() == "ADMAIN.ASP") {	
					streetcentermap();
			}else if (gCurPage.toUpperCase() == "NKMAP.ASP" || gCurPage.toUpperCase() == "NK3DMAP.ASP"
								|| gCurPage.toUpperCase() == "3DMAP.ASP"|| gCurPage.toUpperCase() == "SUBWAY.ASP"
                || gCurPage.toUpperCase().indexOf("AGENCY")>-1 || gCurPage.toUpperCase().indexOf("MULGUN")>-1 ){
				if (visit_frm != ""){
					location.href = "/Google/PlanMap.asp?vst="+visit_frm;
				}else{
					location.href = "/Google/PlanMap.asp";		//=>해당 페이지의 경우 좌표값을 가져올 수 없기에 이동시 default값으로 적용되어 이동
				}
			}else {
				cm2centermap();
			}
			
		}else if (cmtype == 'cm3'){
			if (gCurPage.toUpperCase() == "MAIN.ASP" || gCurPage.toUpperCase() == "ADMAIN.ASP") {	 
				map_sizeset();
				Type_Change("GM");
						
				document.getElementById("hanil_logo").style.display = "none";		    // 한일 로고 
				document.getElementById("geopis_logo").style.display = "block";		

			}else if (gCurPage.toUpperCase() == "NKMAP.ASP" || gCurPage.toUpperCase() == "NK3DMAP.ASP"
											|| gCurPage.toUpperCase() == "3DMAP.ASP"|| gCurPage.toUpperCase() == "SUBWAY.ASP"
                      || gCurPage.toUpperCase().indexOf("AGENCY")>-1 || gCurPage.toUpperCase().indexOf("MULGUN")>-1 ){
				if (visit_frm != ""){
					location.href = "/Map/Main.asp?mapType=GM&vst="+visit_frm;
				}else{
					location.href = "/Map/Main.asp?mapType=GM";//=>해당 페이지의 경우 좌표값을 가져올 수 없기에 이동시 default값으로 적용되어 이동
				}
			}else {
				gmcentermap();//구글 지도에서 좌표값 x,y,x1,y1의 값을 가져와서  뿌려주는 함수(좌표값이 없을 경우 default값으로 이동)
			}
		}
		//지적지번도 관련 함수========================================
			else if (cmtype=='cm4'){
			if (visit_frm != ""){						
				location.href = "/Google/CM4Map.asp?vst="+visit_frm;					
			}else{				
				location.href = "/Google/CM4Map.asp";
			}
			if (gCurPage.toUpperCase() == "MAIN.ASP" || gCurPage.toUpperCase() == "ADMAIN.ASP") {	
					cm_strictcentermap();//=>Main에서 지도 이동 받는 함수
			}else if (gCurPage.toUpperCase() == "NKMAP.ASP" || gCurPage.toUpperCase() == "NK3DMAP.ASP"
								|| gCurPage.toUpperCase() == "3DMAP.ASP"|| gCurPage.toUpperCase() == "SUBWAY.ASP"
                || gCurPage.toUpperCase().indexOf("AGENCY")>-1 || gCurPage.toUpperCase().indexOf("MULGUN")>-1 ){
//				if (visit_frm != ""){
//					location.href = "/Google/PlanMap.asp?vst="+visit_frm;
//				}else{
//					location.href = "/Google/PlanMap.asp";		//=>해당 페이지의 경우 좌표값을 가져올 수 없기에 이동시 default값으로 적용되어 이동
//				}
			}else {
				cm4centermap();//==>메인으로 지도 이동시 실행 함수
			}
//--------------------------------------------------------------------------==============================================
		}
	}
//---------------------------------------------------------------------------------------------------------
//동시보기
//-----------------------------------------------------------------------------------------------------
function Mainmenu_db(){
	var Map_state = "narrow";

	var mapping_type="DB";
	Map_style = mapping_type;

	if (gCurPage.toUpperCase() == "MAIN.ASP") {	 //현재 페이지가 /Map/Main.asp일 경우
				
		if(mapping_type == 'DB') {		// 동시보기(DB)
			if(Map_state == 'wide') {
				Mode_change('land');
			}else {
				DBmap_sizeset();
				Mode_change('land');
			}
		}else{		// 항공사진(OP), 지적지도(CM), 지리도(GM), 개발계획도(DM)
			map_sizeset();
			Type_Change(mapping_type);
		}
	}else {		// Google Map 또는 SubWay(역세권정보) 일 경우
		if (Map_style == "DB") {
			if (visit_frm){
				msgchnotice1();
				return;
			}else{				
				alert("항공사진 또는 지적지도를 선택하신 후 동시보기를 선택하십시오.");
			return;
			}
		}
		if (visit_frm != ""){
			location.href = "/Map/Main.asp?mapType="+Map_style+"&vst="+visit_frm;
		}else{
			location.href = "/Map/Main.asp?mapType="+Map_style;
		}
			}

}
//--------------------------------------------------------------------------------------
//계발계획도
//--------------------------------------------------------------------------------
function Mainmenu_dm(dmtype){
	if (dmtype == 'dm1') {
		if (gCurPage.toUpperCase() == "MAIN.ASP" || gCurPage.toUpperCase() == "ADMAIN.ASP") {	 
			map_sizeset();
			Type_Change("DM");
			
			document.getElementById("hanil_logo").style.display = "none";		    // 한일 로고 
			document.getElementById("geopis_logo").style.display = "block";		
		}else if (gCurPage.toUpperCase() == "NK3DMAP.ASP"){
			if(mem_lev == 0){
				alert("유료회원에게만 제공되는 서비스입니다.");
			}else if(mem_lev == 1 || mem_lev==99){
				alert("유료회원에게만 제공되는 서비스입니다.");
			}else{
				if (visit_frm != ""){
					location.href = "/Map/Main.asp?mapType=DM&vst="+visit_frm;
				}else{
					location.href = "/Map/Main.asp?mapType=DM";
				}
			}
		}else{
			if(mem_lev == 0){
				popAlert("popAlertNoLogin");
			}else if(mem_lev == 1 || mem_lev==99){
				popAlert("popAlertNormalUser");
			}else{
				if (visit_frm != ""){
					location.href = "/Map/Main.asp?mapType=DM&vst="+visit_frm;
				}else{
					location.href = "/Map/Main.asp?mapType=DM";
				}
			}
		}

		/*
		}else if (gCurPage.toUpperCase() == "NKMAP.ASP" || gCurPage.toUpperCase() == "NK3DMAP.ASP"
							|| gCurPage.toUpperCase() == "3DMAP.ASP"|| gCurPage.toUpperCase() == "SUBWAY.ASP"){
			if (visit_frm != ""){
				location.href = "/Map/Main.asp?mapType=DM&vst="+visit_frm;
			}else{
				location.href = "/Map/Main.asp?mapType=DM";
			}
		}else {
			//location.href = "/Map/Main.asp?mapType=DM";
			dm1centermap();
		}
		*/

	}else if (dmtype == 'dm2') {
		if (visit_frm != ""){
			location.href = "/Google/PlanMap.asp?vst="+visit_frm;
		}else{
			location.href = "/Google/PlanMap.asp";
		}

		if (gCurPage.toUpperCase() == "MAIN.ASP" || gCurPage.toUpperCase() == "ADMAIN.ASP") {	
			dirstrictcentermap();
		}else if (gCurPage.toUpperCase() == "NKMAP.ASP" || gCurPage.toUpperCase() == "NK3DMAP.ASP"
							|| gCurPage.toUpperCase() == "3DMAP.ASP"|| gCurPage.toUpperCase() == "SUBWAY.ASP"
              || gCurPage.toUpperCase().indexOf("AGENCY")>-1 || gCurPage.toUpperCase().indexOf("MULGUN")>-1 ){
			if (visit_frm != ""){
				location.href = "/Google/planMap.asp?vst="+visit_frm;
			}else{
				location.href = "/Google/PlanMap.asp";		
			}
		}else{
			dm2centermap();//구글 지도에서 좌표값 x,y,x1,y1의 값을 가져와서  뿌려주는 함수(좌표값이 없을 경우 default값으로 이동)	
		}

	}

}
//-------------------------------------------------------------------------------------------------------
//역세권정보
//--------------------------------------------------------------------------------------------------------
//function Mainmenu_subway(){
//
//	var mapping_type="subway";
//	Map_style = mapping_type;
//
//	if(mapping_type == 'subway') {
//		if (visit_frm != ""){
//			location.href = "/Map/Subway.asp?vst="+visit_frm;
//		}else{
//			location.href = "/Map/Subway.asp"
//		}
//	}
//}
//------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------
//북한지리정보
//------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------
function Mainmenu_nk(nktype){
	if (nktype == 'nk1') {
		if (visit_frm != ""){
			location.href = "/Google/NKMap.asp?vst="+visit_frm;
		}else{
			location.href = "/Google/NKMap.asp";
		}
	}else if (nktype == 'nk2') {
		if (visit_frm != ""){
			location.href = "/Google/NK3DMap.asp?vst="+visit_frm;
		}else{
			location.href = "/Google/NK3DMap.asp";
		}
	}			
}
//------------------------------------------------------------------------------------------------------

//------------------------------------------------------------------------------------------------------
//	부동산
//------------------------------------------------------------------------------------------------------
	function Mainmenu_land(){

		var mapping_type="LAND";
		Map_style = mapping_type;

	if(mapping_type == 'LAND') {
			
			location.href = "http://land.geopis.co.kr"
		}
	}
//------------------------------------------------------------------------------------------------------

//------------------------------------------------------------------------------------------------------
//	경매(auction.geopis.co.kr)
//------------------------------------------------------------------------------------------------------
	function Mainmenu_auction() {
		AuctionOpen_Alert();
		location.href = "http://auction.geopis.co.kr";
	}
//------------------------------------------------------------------------------------------------------

//------------------------------------------------------------------------------------------------------
//	지오옥션 메뉴 오픈 알림 팝업
//------------------------------------------------------------------------------------------------------
	function AuctionOpen_Alert() 	{
		var eventCookie=getCookie1("setauctionpop");
		if (!visit_frm)	
		{			
			if(eventCookie != "no")
			{
				var ad_popup = window.open('/popup/auction_open/auction_pop.asp',"ad_popup",'top=0, left=0, width=352,height=432,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');				
			}
		}
	}		
//------------------------------------------------------------------------------------------------------

  function Mainmenu_realestate(gubun){
    if(visit_frm!=""){
      alert("지오피스 사이트에서만 이용가능합니다.");
      //window.open("http://www.geopis.co.kr","_blank","");
    }else{
      if(gubun=="A"){
        location.href = "/realestate/agency_search.asp";
      }else if(gubun=="M"){
        location.href = "/realestate/mulgun_agency_search.asp";
      }else if(gubun=="U"){
        alert("준비중입니다.");
        window.open("/event/20100722/notice.asp","_blank","");
      }
    }
  }

	function Mainmenu_geoland(){
		var mapping_type="LAND";
		Map_style = mapping_type;
  	if(mapping_type == 'LAND'){
			location.href = "http://land.geopis.co.kr"
		}
	}

  function Mainmenu_geoLand(){
    location.href("/stat/main_menu_count.asp?typ=geoLand");
  }

  function Mainmenu_geoAuction(){
    location.href("/stat/main_menu_count.asp?typ=geoAuction");
  }

  function Mainmenu_realestate(){
    //alert("준비중입니다.");
    location.href("/realestate/purpose.asp");
  }