﻿// JScript 파일

//Item Page
function Item(_Idx, _PCode, _Theme, _startLocation)
{
    var Obj = document.getElementById("Item");
    Obj.Idx.value = _Idx;
    Obj.PCode.value = _PCode;
    if(_Theme == "")    Obj.Theme.value = "THE88";   else    Obj.Theme.value = _Theme;
    if(_startLocation == "" || _startLocation == "undefined" || _startLocation == null)  Obj.startLocation.value = "ICN";    else    Obj.startLocation.value = _startLocation;

    Obj.action = "/Package/Item_CA.aspx";
    Obj.submit();
}

//List Page
function ListMain(theme, total_local, local, Level){
    //alert(total_local + " // " + local + " // " + Level);
    var Obj = document.getElementById("ListMain");
    Obj.location.value = total_local;
    Obj.location2.value = local;
    if(theme != "") Obj.Theme.value = theme;
    if(Obj.startLocation.value == "")   Obj.startLocation.value = "ICN";
    if(Obj.MLoc.value == "")    Obj.MLoc.value = "01";
    if(Level == "1" || Level == "2")    Obj.action = "/Package/SubMain_CA.aspx";    else    Obj.action = "/Package/List_CA.aspx";
    //Obj.method="post";
    Obj.submit();
}


//Itinerary Page
function Itinerary(_Pnum, _Inum, _Idx, _Theme, _startLocation)
{
    var Obj = document.getElementById("Itinerary");

    Obj.Pnum.value = _Pnum;
    Obj.Inum.value = _Inum;
    Obj.Idx.value = _Idx;
    if(_Theme == "")    Obj.Theme.value = "THE88";   else    Obj.Theme.value = _Theme;
    if(_startLocation == "")  Obj.startLocation.value = "ICN";    else    Obj.startLocation.value = _startLocation;
    Obj.action = "/Package/Itinerary_CA.aspx";
    Obj.submit();
}

//left 메뉴
function LeftLink(theid,submain, loc1, loc2)
{   
    /* ########### 예외처리 ############# */
    //국내는 submain 2 값이 넘어옴  1이 넘어와야 submain 페이지로 이동이 되기에 
    //패키지 여행일경우에는 국내는 강제로 1로 setting
    
    
    if(theid == "THE88")
    {
        var num = Number(submain);
        if(loc1 == "LOC11" && num > 0) submain = "1";
    }
    //################################### */
    
   
    var Obj = document.getElementById("LeftMenu");
    Obj.Theme.value = theid;
    Obj.location.value = loc1;
    Obj.location2.value = loc2;  
    if(theid == "THE88" && submain == "1")
    {
        Obj.action = "/package/SubMain_CA.aspx";
    }
    else 
    {     
        Obj.location.value = loc1+"^"+loc2; 
        Obj.action = "/package/List_CA.aspx";
    }
    
    Obj.submit();
}


//Top, Left 통합 메뉴
function menuLink(theid,submain, loc1, loc2, gubun)
{
    var Obj; 
    if(gubun == "top")
        Obj = document.getElementById("TopMenu");
    else 
        Obj = document.getElementById("LeftMenu");
    
    Obj.Theme.value = theid;
    
    
    if(loc1 != "") Obj.location.value = loc1; else Obj.location.value = "LOC3";
    if(loc2 != "") Obj.location2.value = loc2; else Obj.location2.value = "LOC3";
    
    //해외여행 - 대륙 , 다른테마는 각 submain 페이지로
    if(theid == "THE88" && submain == "2")
    { 
        Obj.action = "/package/SubMain_CA.aspx";  
        
        if(loc1 == "LOC782") Obj.action = "/Package/List_CA.aspx"; 
    }
    else if(theid == "THE3" && submain == "2" && loc2 == "")
        Obj.action = "/SubMain/CA/honeymoon.aspx"; 
    
    else if(theid == "THE4" && submain == "2" && loc2 == "")
        Obj.action = "/SubMain/CA/free.aspx";
    
    else if(theid == "THE5" && submain == "2" && loc2 == "")
        Obj.action = "/SubMain/CA/golf.aspx"; 
    
    else if(theid == "THE210" && submain == "2" && loc2 == "")
        Obj.action = "/SubMain/CA/JMTour.aspx";
    
    else if(theid == "THE211" && submain == "2" && loc2 == "")
        Obj.action = "/SubMain/CA/cruise.aspx"; 
    
    else 
    {
        Obj.location.value = loc1 + "^" + loc2;
        Obj.location2.value = loc2;
        Obj.action = "/Package/List_CA.aspx";
    } 
    
    Obj.submit();   
        
}       



 //Left메뉴 링크경로 지정(롯데카드, 제이골프)
  function LeftLink2(start, theme, total_local, local, Level, MLoc, Fnm)
  {
    var Obj = document.getElementById("LeftForm");
    //alert(theme);
    if(start == null)   Obj.startLocation.value = "ICN";    else    Obj.startLocation.value = start;
    Obj.location.value = total_local;
    Obj.location2.value = local;
    Obj.Theme.value = theme;
    if(MLoc == null)        Obj.MLoc.value = "01";  else    Obj.MLoc.value = MLoc;
     if(Fnm == null)         Obj.Fnm.value = "00";   else    Obj.Fnm.value = Fnm; 
    if((Level == "1" || Level == "2") && theme == "THE88")    Obj.action = "/Package/SubMain_CA.aspx";    else    Obj.action = "/Package/List_CA.aspx";
    Obj.method = "get";
    Obj.submit();
  }







