﻿/*
 * jQuery run uljin 1.0.1
 *
 * Copyright (c) 2009 ixcore.corp.
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * Depends:
 *	run.uljin.js
 */
// 우편번호 찾기
var searchZipcode = function(url, zipcode1, zipcode2, addr1, addr2){
    var _w = 496;
    var _h = 395; //395max, 200min
    var _win = window.open(url + '?ctrlZip1=' + zipcode1 + '&ctrlZip2=' + zipcode2 + '&ctrlAddr1=' + addr1 + '&ctrlAddr2=' + addr2, 'SearchZipcode', 'width=' + _w + ',height=' + _h);
    _win.focus();
}
// 우편번호 찾기 결과
var searchZipcodeResponse = function(zipcodeId1, zipcodeId2, addrId1, addrId2, zipcode1, zipcode2, address){
    opener.document.getElementById(zipcodeId1).value = zipcode1;
    opener.document.getElementById(zipcodeId2).value = zipcode2;
    opener.document.getElementById(addrId1).value = address;
    opener.focus();
    opener.document.getElementById(addrId2).focus();
    window.close();
}
// 아이디 찾기
var idDualCheck = function(url, ctrlId, checkId){
    var _w = 418;
    var _h = 300;
    var _win = window.open(url + '?ctrlID=' + ctrlId + '&mem_id=' + checkId, 'IdDualCheck', 'width=' + _w + ',height=' + _h);
    _win.focus();
}
// 아이디 찾기 결과
var idDualCheckResponse = function(ctrlId, id){
    opener.document.getElementById(ctrlId).value = id;
    opener.focus();
    window.close();
}

// 읍면 선택 변경
var changeLandCode = function(url, val, ctrlId){
    var eupmyeonValue = val;
    var riSet = $('#'+ ctrlId);
    riSet.attr('disabled', true);
    riSet.emptySelect();
    $.getJSON(
        url,
        {'cate_cd': eupmyeonValue},
        function(data){
            riSet.attr('disabled', false);
            riSet.loadSelect(data);
        }
    );
}

// 서울신용평가정보 실명확인서비스
var CBA_window; 
function openCBAWindow(){ // 가상식별 실명확인서비스 팝업창 호출
    CBA_window=window.open('','CbaWindow', 'width=410, height=450, resizable=0, scrollbars=no, status=0, titlebar=0, toolbar=0, left=300, top=200' );
    // 가상식별 실명확인서비스 요청 URL
    document.reqCBAForm.action = 'https://name.siren24.com/vname/jsp/vname_j10.jsp'; 
    document.reqCBAForm.target = 'CbaWindow'; 
}


// 숙박 관리자 아이디 찾기
var searchLodgingManagerId = function(url, ctrl01){
    var _w = 618;
    var _h = 300;
    var _win = window.open(url + '?ctrl01=' + ctrl01, 'searchLodgingManagerId', 'width=' + _w + ',height=' + _h);
    _win.focus();
}

// 관리자 아이디 찾기
var selectManagerId = function(ctrl01, val01){
    if(opener && opener.document && opener.document.getElementById(ctrl01)){
        opener.document.getElementById(ctrl01).value = val01;
        opener.focus();
        opener.document.getElementById(ctrl01).focus();
        window.close();
    }
}

// 지역상가 관리자 아이디 찾기
var searchLocalShopManagerId = function(url, ctrl01){
    var _w = 618;
    var _h = 300;
    var _win = window.open(url + '?ctrl01=' + ctrl01, 'searchLocalShopManagerId', 'width=' + _w + ',height=' + _h);
    _win.focus();
}

// 콘텐츠 관리자 찾기
var searchStationStaff = function(url, ctrl01, ctrl02, ctrl03, ctrl04){
    var _w = 600;
    var _h = 600;
    var _win = window.open(url + '&ctrl01=' + ctrl01 + '&ctrl02=' + ctrl02 + '&ctrl03=' + ctrl03 + '&ctrl04=' + ctrl04, 'searchStationStaff', 'width=' + _w + ',height=' + _h);
    _win.focus();
}

// 관리자 아이디 찾기
var selectManager = function(ctrl01, val01, ctrl02, val02, ctrl03, val03, ctrl04, val04){
    if(opener && opener.document && opener.document.getElementById(ctrl01)){
        opener.document.getElementById(ctrl01).value = val01;
        opener.document.getElementById(ctrl02).value = val02;
        opener.document.getElementById('span_'+ctrl02).innerHTML = val02;
        opener.document.getElementById(ctrl03).value = val03;
        opener.document.getElementById(ctrl04).value = val04;
        opener.document.getElementById('span_'+ctrl04).innerHTML = val04;
        opener.focus();
        window.close();
    }
}


