﻿/* 2010.07.27 신장순 
   - Default.aspx 환율및 구글 날씨 정보 
   - 구글 맵 API
*/
/// <reference path="/js/jquery-1.4.1.js" />
/// <reference path="/js/jquery-1.3.2-vsdoc.js" />

// Default.aspx Header 부분 ========================================================================================================================================
var SCount = 2;
//날씨정보 Intervarl
function SetWeatherIntervalLoad() {
    var WeatherInfoList = document.getElementById("hdWeatherInfo").value;
    var splitArr = WeatherInfoList.split('■');
    var WeatherInfoListCnt = document.getElementById("hdWeatherInfoCnt").value;

    if (WeatherInfoListCnt >= SCount) {
        if (WeatherInfoListCnt == SCount) {
            document.getElementById("pnlWeatherInfo").innerHTML = splitArr[SCount];
            SCount = 0;
        }
        else {
            document.getElementById("pnlWeatherInfo").innerHTML = splitArr[SCount];
        }
    }

    SCount++;
}

//도시정보 Layer
function WeatherDIVVisible(DIVID) {
    jQuery("#" + DIVID).toggle();
}

//날씨 정보 가져오기
function GetGoogleWeather(code, value, DIVID, LabelID, currCD, tempcurr, timeDiff) {
    //alert("aaaa");
    try {

        WeatherDIVVisible(DIVID);
        document.getElementById(LabelID).innerText = value;
        document.getElementById("hidden_curr").value = currCD;

        GetYahooCurr(currCD, tempcurr);

        var oParms = "";
        var returnValue = jQuery.ajax({ url: "/Inc/GoogleAPI.ashx?key=" + code, type: 'get', data: oParms, async: false }).responseText;

        if (returnValue.length > 0) {
            var splitArr = returnValue.split("^");
            var TableString = "";

            var splitArr2 = splitArr[0].split(",");
            TableString += "<img src='" + splitArr2[0] + "' width='18' height='18' />";
            TableString += " <font color='#f46d1a'>" + splitArr2[2] + "C</font>&nbsp;";
            //alert(TableString);
            document.getElementById("WeatherDIV").innerHTML = TableString;
        }
        else {
            document.getElementById("WeatherDIV").innerHTML = " <font color='#f46d1a'>세계 도시의 날씨 정보를 가져오는 중 입니다...</font>&nbsp;";
        }
    }
    catch (e)
            { }
    //setInterval(SetWeatherIntervalLoad, 10000);
}

/*yahoo환률 부분 확인*/
function GetYahooCurr(CTNM, tempcurr) {

    var oParms = "";
    var returnValue = jQuery.ajax({ url: "/Inc/GoogleAPI.ashx?CTNM=" + encodeURIComponent(CTNM), type: 'get', data: oParms, async: false }).responseText;

    if (returnValue.length > 0 && returnValue.length < 30) {
        //alert(document.getElementById("currLabel").innerHTML);
        document.getElementById("currLabel").innerHTML = returnValue + "&nbsp;";
    }
    else {
        document.getElementById("currLabel").innerHTML = "   " + CTNM + "	" + tempcurr + "&nbsp;";
    }

}

//=====================================================================================================================================================================

// NewsLetter 정기구독 신청 ===========================================================================================================================================
function checkFormNewsletter() {
    if (!newsletter_email.value) {
        alert("이메일 주소를 입력해주세요.");
        newsletter_email.focus();
        return false;
    }
    if (!newsletter_name.value) {
        alert("신청자 이름을 입력해주세요.");
        newsletter_name.focus();
        return false;
    }
    var oParms = "";
    var returnValue = jQuery.ajax({ url: "/Inc/GoogleAPI.ashx?newsletter_email=" + newsletter_email.value + "&newsletter_name=" + encodeURL(newsletter_name.value), type: 'get', data: oParms, async: false }).responseText;

    newsletter_email.value = "";
    newsletter_name.value = "";
    
    if (returnValue == "ok")
        alert("뉴스레터 정기구독이 신청되었습니다.");
    else
        alert("뉴스레터 정기구독신청중 에러가 발생하였습니다.\n고객센터로 문의하시기 바랍니다.");
}
//=====================================================================================================================================================================


// Google Map 설정 부분 ===============================================================================================================================================

function GUnload() {
}
function GUnload_Ifr() {
}
function GInitialize() { }
function GInitialize_Ifr() {
}
//test

//var ntGMAP_obj_MAP = "gMap";

//var ntGMAP_object;
//var ntGMAP_lng = "0";
//var ntGMAP_lat = "0";
//var ntGMAP_lv = 1;
//var ntGMAP_type = 1;
//var geocoder = null;

//function GInitialize() {
//    if (GBrowserIsCompatible()) {
//        var map = new GMap2(document.getElementById(ntGMAP_obj_MAP));
//        map.setCenter(new GLatLng(ntGMAP_lat, ntGMAP_lng), ntGMAP_lv);
//        
//        ////View Type
//        //map.setMapType(G_HYBRID_MAP);   //G_NORMAL_MAP, G_SATELLITE_MAP, G_HYBRID_MAP, G_DEFAULT_MAP_TYPES, G_PHYSICAL_MAP
//        
//        //Default
//        map.setUIToDefault();
//        
//        //map.disableDoubleClickZoom(); //
//        
//        map.clearOverlays();  //
//        
//        ////DOCUMENT 
//        //map.openInfoWindow(map.getCenter(), document.createTextNode("Document Text : TEST TEST"));

//        //geocoder = new GClientGeocoder();
//        //alert(map.getZoom());
//        if (map.getZoom() >= 10) {

//            //var MarkerList = GoogleMapAddMarker('176', '1');
//            //var splitArr = MarkerList.split('■');

//            //alert(ntGMAP_lat);
//            //alert(ntGMAP_lng);
//            //alert(ntGMAP_type);      
//            //for (var i = 0; i < splitArr.length; i++) {

//                /*TMML_OCOD□	0 : seq
//                Latitude □		1 : 좌표값 
//                Longitude □	2 : 좌표값 
//                TMML_BNER		3 : 이미지
//                TMML_CST1		4 : 가로
//                TMML_CST2		5 : 세로
//                */
//            //    var splitArr2 = splitArr[i].split('□');


////                var bounds = map.getBounds();
////                var southWest = bounds.getSouthWest();
////                var northEast = bounds.getNorthEast();
////                var lngSpan = northEast.lng() - southWest.lng();
////                var latSpan = northEast.lat() - southWest.lat();
////                var latlng = new GLatLng(southWest.lat() + latSpan * Math.random(), southWest.lng() + lngSpan * Math.random());
//                
//                //var latlng = new GLatLng(splitArr2[1], splitArr2[2]);                
//                var latlng = new GLatLng(ntGMAP_lat, ntGMAP_lng);
//                map.addOverlay(createMarker(latlng, ntGMAP_type));
//            //}
//            
////            var bounds = map.getBounds();
////            var southWest = bounds.getSouthWest();
////            var northEast = bounds.getNorthEast();
////            var lngSpan = northEast.lng() - southWest.lng();
////            var latSpan = northEast.lat() - southWest.lat();
////            for (var i = 0; i < 5; i++) {
////                var point = new GLatLng(southWest.lat() + latSpan * Math.random(), southWest.lng() + lngSpan * Math.random());
////                map.addOverlay(createMarker(point, i + 1));
////            } 

//        }        

//    }

//}

//function createMarker(point, type) {

//    var baseIcon = new GIcon(G_DEFAULT_ICON);
//    baseIcon.iconSize = new GSize(25, 25);

//    // Create a lettered icon for this point using our icon class
//    var letteredIcon = new GIcon(baseIcon);

//    if (type == "1") {
//        letteredIcon.image = "/images/map_icon_destination.png";
//    }
//    else if (type == "2") {
//        letteredIcon.image = "/images/map_icon_hotel.png"; //
//    }
//    else if (type == "3") {
//        letteredIcon.image = "/images/map_icon_restaurant.png"; //
//    }
//    else if (type == "4") {
//        letteredIcon.image = "/images/map_icon_shopping.png"; //
//    }
//    else if (type == "5") {
//        letteredIcon.image = "/images/map_icon_activity.png";
//    }
//    else if (type == "6") {
//        letteredIcon.image = "/images/map_icon_culture.png";
//    }
//    else if (type == "7") {
//        letteredIcon.image = "/images/map_icon_nightlife.png";
//    }
//    else if (type == "8") {
//        letteredIcon.image = "/images/map_icon_museum.png";
//    }
//    else {
//        letteredIcon.image = letteredIcon;
//    }
//    

//    // Set up our GMarkerOptions object
//    markerOptions = { icon: letteredIcon };
//    var marker = new GMarker(point, markerOptions);

//    return marker;
//}

////function createMarker(point, number) {
////    var marker = new GMarker(point);
////    var message = ["This", "is", "the", "secret", "message"];
////    marker.value = number;
////    GEvent.addListener(marker, "click", function() {
////        var myHtml = "<b>#" + number + "</b><br/>" + message[number - 1];
////        map.openInfoWindowHtml(point, myHtml);
////    });
////    return marker;
////}

/////구글 지도 이미지 표시
//function GoogleMapAddMarker(lid, huid) {
//    alert(lid);
//    alert(huid);
//    var oParms = "";
//    var returnValue = jQuery.ajax({ url: "/Inc/GoogleAPI.ashx?lid=" + lid + "&huid=" + huid, type: 'get', data: oParms, async: false }).responseText;
//    return returnValue;
//}

/////////////////////////////////////

////var ntGMAP_obj_MAP = "gMap";

////var ntGMAP_object;
////var ntGMAP_lng = "0";
////var ntGMAP_lat = "0";
////var ntGMAP_lv = 1;
////var geocoder = null;

////function GInitialize() {

////    // ZoomIn Control 추가(신장순) -------------------------------------------------------------------------------
////    function TextualZoomControl() { }
////    TextualZoomControl.prototype = new GControl();
////    // Creates a one DIV for each of the buttons and places them in a container
////    // DIV which is returned as our control element. We add the control to
////    // to the map container and return the element for the map class to
////    // position properly.
////    TextualZoomControl.prototype.initialize = function(map) {
////        var container = document.createElement("div");

////        var zoomInDiv = document.createElement("div");
////        this.setButtonStyle_(zoomInDiv);
////        container.appendChild(zoomInDiv);
////        zoomInDiv.appendChild(document.createTextNode("+"));
////        GEvent.addDomListener(zoomInDiv, "click", function() {

////            map.zoomIn();
////////            //alert(map.getZoom());
////////            if (map.getZoom() == 3) {
////////                var center = map.getCenter();

////////                OverGoogleMap('0', GoogleMapAddMarker('0'), center.toString());
////////                //				var MarkerList = GoogleMapAddMarker('0');
////////                //				var splitArr = MarkerList.split('■');

////////                //				//alert(map.getZoom());
////////                //				for (var i = 0; i < splitArr.length; i++) {


////////                //					/*TMML_OCOD□	0 : seq
////////                //					Latitude □		1 : 좌표값 
////////                //					Longitude □	2 : 좌표값 
////////                //					TMML_BNER		3 : 이미지
////////                //					TMML_CST1		4 : 가로
////////                //					TMML_CST2		5 : 세로
////////                //					*/
////////                //					var splitArr2 = splitArr[i].split('□');

////////                //					var latlng = new GLatLng(splitArr2[1], splitArr2[2]);
////////                //					map.addOverlay(createMarker(latlng, splitArr2[0], splitArr2[3], splitArr2[4], splitArr2[5],splitArr2[6],splitArr2[7]));
////////                //				}

////////            }
////        });

////        var zoomOutDiv = document.createElement("div");
////        this.setButtonStyle_(zoomOutDiv);
////        container.appendChild(zoomOutDiv);
////        zoomOutDiv.appendChild(document.createTextNode("-"));
////        GEvent.addDomListener(zoomOutDiv, "click", function() {
////        map.zoomOut();
////        //alert(map.getZoom());
////            if (map.getZoom() <= 2) {
////                GInitialize();
////            }
////        });

////        map.getContainer().appendChild(container);
////        return container;
////    }

////    // By default, the control will appear in the top left corner of the
////    // map with 7 pixels of padding.
////    TextualZoomControl.prototype.getDefaultPosition = function() {
////        return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(7, 7));
////    }

////    // Sets the proper CSS for the given button element.
////    TextualZoomControl.prototype.setButtonStyle_ = function(button) {
////        //button.style.textDecoration = "underline";
////        button.style.color = "#0000cc";
////        button.style.backgroundColor = "white";
////        button.style.font = "small Arial";
////        button.style.border = "1px solid black";
////        button.style.padding = "1px";
////        button.style.marginBottom = "1px";
////        button.style.textAlign = "center";
////        button.style.width = "2em";
////        button.style.cursor = "pointer";
////    }
////    ////---------------------------------------------------------------------------------

////    if (GBrowserIsCompatible()) {
////        var map = new GMap2(document.getElementById("gMap"));
////        map.setCenter(new GLatLng(ntGMAP_lat, ntGMAP_lng), ntGMAP_lv);
////        //map.setCenter(new GLatLng(37.566535, 126.9779692), ntGMAP_lv);
////        map.disableDoubleClickZoom();
////        map.addControl(new GMapTypeControl());
////        map.addControl(new TextualZoomControl());

////        GEvent.addListener(map
////                                    , "moveend"
////                                    , function() {
////                                        //                                          var marker   = new GMarker(ntGMAP_object.getCenter());
////                                        //                                          marker.value = "CenterPosition";
////                                        //                                          ntGMAP_object.addOverlay( marker );
////                                    }
////                                  );
////        GEvent.addListener(map
////                                    , "move"
////                                    , function() {
////                                    var center = map.getCenter();

////                                    map.clearOverlays();
////                                        //ntGMAP__drawCrossLine();

////                                        //document.getElementById("jg<%=Request.QueryString["strTableName"]%>_Lng").value = center.lng();    // PosX
////                                        //document.getElementById("jg<%=Request.QueryString["strTableName"]%>_Lat").value = center.lat();    // PosY
////                                    }
////                                  );

////        map.clearOverlays();
////        //ntGMAP__drawCrossLine();

////        geocoder = new GClientGeocoder();
////    }
////}

////// Zoom 추가 ---------------------------------------------------------------------------------
////function OverGoogleMap_s(ClickIndex, MarkerArr) {

////    function TextualZoomControl() {
////    }
////    TextualZoomControl.prototype = new GControl();

////    // Creates a one DIV for each of the buttons and places them in a container
////    // DIV which is returned as our control element. We add the control to
////    // to the map container and return the element for the map class to
////    // position properly.
////    TextualZoomControl.prototype.initialize = function(map) {
////        var container = document.createElement("div");

////        var zoomInDiv = document.createElement("div");
////        this.setButtonStyle_(zoomInDiv);
////        container.appendChild(zoomInDiv);
////        zoomInDiv.appendChild(document.createTextNode("+"));
////        GEvent.addDomListener(zoomInDiv, "click", function() {
////            if (map.getZoom() < 4) {
////                map.zoomIn();
////                if (map.getZoom() = 3) {
////                    var center = map.getCenter();

////                    OverGoogleMap('0', GoogleMapAddMarker('0'), center.toString());
////                    //				var MarkerList = GoogleMapAddMarker('0');
////                    //				var splitArr = MarkerList.split('■');

////                    //				//alert(map.getZoom());
////                    //				for (var i = 0; i < splitArr.length; i++) {


////                    //					/*TMML_OCOD□	0 : seq
////                    //					Latitude □		1 : 좌표값 
////                    //					Longitude □	2 : 좌표값 
////                    //					TMML_BNER		3 : 이미지
////                    //					TMML_CST1		4 : 가로
////                    //					TMML_CST2		5 : 세로
////                    //					*/
////                    //					var splitArr2 = splitArr[i].split('□');

////                    //					var latlng = new GLatLng(splitArr2[1], splitArr2[2]);
////                    //					map.addOverlay(createMarker(latlng, splitArr2[0], splitArr2[3], splitArr2[4], splitArr2[5],'',splitArr2[7]));
////                    //				}
////                }
////            }
////        });

////        var zoomOutDiv = document.createElement("div");
////        this.setButtonStyle_(zoomOutDiv);
////        container.appendChild(zoomOutDiv);
////        zoomOutDiv.appendChild(document.createTextNode("-"));
////        GEvent.addDomListener(zoomOutDiv, "click", function() {
////            map.zoomOut();
////            if (map.getZoom() <= 2) {
////                GInitialize();
////            }
////        });

////        map.getContainer().appendChild(container);
////        return container;
////    }

////    // By default, the control will appear in the top left corner of the
////    // map with 7 pixels of padding.
////    TextualZoomControl.prototype.getDefaultPosition = function() {
////        return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(7, 7));
////    }

////    // Sets the proper CSS for the given button element.
////    TextualZoomControl.prototype.setButtonStyle_ = function(button) {
////        //button.style.textDecoration = "underline";
////        button.style.color = "#0000cc";
////        button.style.backgroundColor = "white";
////        button.style.font = "small Arial";
////        button.style.border = "1px solid black";
////        button.style.padding = "1px";
////        button.style.marginBottom = "1px";
////        button.style.textAlign = "center";
////        button.style.width = "2em";
////        button.style.cursor = "pointer";
////    }


////    if (GBrowserIsCompatible()) {
////        var map = new GMap2(document.getElementById("gMap"));

////        /*□ : 컬럼 구분 
////        ■ : 로우 구분 
////        */
////        /*TMML_OCOD□	0 : seq
////        Latitude □		1 : 좌표값 
////        Longitude □	2 : 좌표값 
////        TMML_BNER		3 : 이미지
////        TMML_CST1		4 : 가로
////        TMML_CST2		5 : 세로
////        */
////        var splitArr = MarkerArr.split('■');
////        var tempPointArr = splitArr[0].split('□');

////        map.setCenter(new GLatLng(tempPointArr[1], tempPointArr[2]), 3);
////        map.disableDoubleClickZoom();
////        map.addControl(new GMapTypeControl());
////        map.addControl(new TextualZoomControl());

////        //alert("OverGoogleMap_s");

////        function createMarker(point, index, img, wSize, hSize, Linked, Soon) {

////            var baseIcon = new GIcon(G_DEFAULT_ICON);
////            baseIcon.iconSize = new GSize(wSize, hSize);

////            // Create a lettered icon for this point using our icon class
////            var letteredIcon = new GIcon(baseIcon);
////            letteredIcon.image = img;

////            // Set up our GMarkerOptions object
////            markerOptions = { icon: letteredIcon };
////            var marker = new GMarker(point, markerOptions);

////            //alert(Soon);
////            if (Soon != "soon") {

////                GEvent.addListener(marker, "click", function() {
////                    //OverGoogleMap(index, GoogleMapAddMarker(index));
////                    //alert(index);

////                    //alert(map.getZoom());
////                    //if (confirm("이동 하시겠습니까?")) {

////                    if (map.getZoom() >= 3) {

////                        //alert(Linked);
////                        parent.window.location.href = Linked;
////                    }
////                    else if (map.getZoom() < 3) {
////                        OverGoogleMap_s(index, GoogleMapAddMarker(index));
////                    }
////                    //}

////                })
////            };
////            return marker;
////        }

////        GEvent.addListener(map, "dblclick", function() {
////            if (map.getZoom() >= 4) {

////                map.zoomOut();
////                //alert(map.getZoom());
////                if (map.getZoom() == 3) {

////                    var center = map.getCenter();

////                    OverGoogleMap('0', GoogleMapAddMarker('0'), center.toString());
////                    //				var MarkerList = GoogleMapAddMarker('0');
////                    //				var splitArr = MarkerList.split('■');

////                    //				//alert(map.getZoom());
////                    //				for (var i = 0; i < splitArr.length; i++) {


////                    //					/*TMML_OCOD□	0 : seq
////                    //					Latitude □		1 : 좌표값 
////                    //					Longitude □	2 : 좌표값 
////                    //					TMML_BNER		3 : 이미지
////                    //					TMML_CST1		4 : 가로
////                    //					TMML_CST2		5 : 세로
////                    //					*/
////                    //					var splitArr2 = splitArr[i].split('□');

////                    //					var latlng = new GLatLng(splitArr2[1], splitArr2[2]);
////                    //					map.addOverlay(createMarker(latlng, splitArr2[0], splitArr2[3], splitArr2[4], splitArr2[5], splitArr2[6], splitArr2[7]));
////                    //				}
////                }
////            }
////        });

////        for (var i = 0; i < splitArr.length; i++) {


////            /*TMML_OCOD□	0 : seq
////            Latitude □		1 : 좌표값 
////            Longitude □	2 : 좌표값 
////            TMML_BNER		3 : 이미지
////            TMML_CST1		4 : 가로
////            TMML_CST2		5 : 세로
////            */
////            var splitArr2 = splitArr[i].split('□');

////            var latlng = new GLatLng(splitArr2[1], splitArr2[2]);
////            map.addOverlay(createMarker(latlng, splitArr2[0], splitArr2[3], splitArr2[4], splitArr2[5], splitArr2[6], splitArr2[7]));
////        }
////    }

////}

////function OverGoogleMap(ClickIndex, MarkerArr, CenterPosition) {
////    
////    function TextualZoomControl() {
////    }
////    TextualZoomControl.prototype = new GControl();

////    // Creates a one DIV for each of the buttons and places them in a container
////    // DIV which is returned as our control element. We add the control to
////    // to the map container and return the element for the map class to
////    // position properly.
////    TextualZoomControl.prototype.initialize = function(map) {
////        var container = document.createElement("div");

////        var zoomInDiv = document.createElement("div");
////        this.setButtonStyle_(zoomInDiv);
////        container.appendChild(zoomInDiv);
////        zoomInDiv.appendChild(document.createTextNode("+"));
////        GEvent.addDomListener(zoomInDiv, "click", function() {
////            if (map.getZoom() < 4) {
////                map.zoomIn();
////                if (map.getZoom() == 3) {

////                    var MarkerList = GoogleMapAddMarker('0');
////                    var splitArr = MarkerList.split('■');

////                    //alert(map.getZoom());
////                    for (var i = 0; i < splitArr.length; i++) {


////                        /*TMML_OCOD□	0 : seq
////                        Latitude □		1 : 좌표값 
////                        Longitude □	2 : 좌표값 
////                        TMML_BNER		3 : 이미지
////                        TMML_CST1		4 : 가로
////                        TMML_CST2		5 : 세로
////                        */
////                        var splitArr2 = splitArr[i].split('□');

////                        var latlng = new GLatLng(splitArr2[1], splitArr2[2]);
////                        map.addOverlay(createMarker(latlng, splitArr2[0], splitArr2[3], splitArr2[4], splitArr2[5], '', splitArr2[7]));
////                    }
////                }
////            }
////        });

////        var zoomOutDiv = document.createElement("div");
////        this.setButtonStyle_(zoomOutDiv);
////        container.appendChild(zoomOutDiv);
////        zoomOutDiv.appendChild(document.createTextNode("-"));
////        GEvent.addDomListener(zoomOutDiv, "click", function() {
////            map.zoomOut();
////            if (map.getZoom() <= 2) {
////                GInitialize();
////            }
////        });

////        map.getContainer().appendChild(container);
////        return container;
////    }

////    // By default, the control will appear in the top left corner of the
////    // map with 7 pixels of padding.
////    TextualZoomControl.prototype.getDefaultPosition = function() {
////        return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(7, 7));
////    }

////    // Sets the proper CSS for the given button element.
////    TextualZoomControl.prototype.setButtonStyle_ = function(button) {
////        //button.style.textDecoration = "underline";
////        button.style.color = "#0000cc";
////        button.style.backgroundColor = "white";
////        button.style.font = "small Arial";
////        button.style.border = "1px solid black";
////        button.style.padding = "1px";
////        button.style.marginBottom = "1px";
////        button.style.textAlign = "center";
////        button.style.width = "2em";
////        button.style.cursor = "pointer";
////    }

////    
////    if (GBrowserIsCompatible()) {
////        var map = new GMap2(document.getElementById("gMap"));
////        
////        /*□ : 컬럼 구분 
////        ■ : 로우 구분 
////        */
////        /*TMML_OCOD□	0 : seq
////        Latitude □		1 : 좌표값 
////        Longitude □	2 : 좌표값 
////        TMML_BNER		3 : 이미지
////        TMML_CST1		4 : 가로
////        TMML_CST2		5 : 세로
////        */
////        //alert(MarkerArr);
////        var splitArr = MarkerArr.split('■');
////        //var tempPointArr = splitArr[0].split('□');
////        
////        var tempPointArr = CenterPosition.split(',');
////        var first = tempPointArr[0].substring(1, 7);
////        var last = tempPointArr[1].substring(0, 7);
////        map.setCenter(new GLatLng(first, last), 3);
////        map.disableDoubleClickZoom();
////        map.addControl(new GMapTypeControl());
////        map.addControl(new TextualZoomControl());

////        //alert("OverGoogleMap");
////        
////        function createMarker(point, index, img, wSize, hSize, Linked, Soon) {

////            var baseIcon = new GIcon(G_DEFAULT_ICON);
////            baseIcon.iconSize = new GSize(wSize, hSize);

////            // Create a lettered icon for this point using our icon class
////            var letteredIcon = new GIcon(baseIcon);
////            letteredIcon.image = img;

////            // Set up our GMarkerOptions object
////            markerOptions = { icon: letteredIcon };
////            var marker = new GMarker(point, markerOptions);

////            //alert(Soon);
////            if (Soon != "soon") {

////                GEvent.addListener(marker, "click", function() {
////                    //OverGoogleMap(index, GoogleMapAddMarker(index));
////                    //alert(index);

////                    //alert(map.getZoom());
////                    //if (confirm("이동 하시겠습니까?")) {

////                    if (map.getZoom() >= 3) {

////                        //alert(Linked);
////                        parent.window.location.href = Linked;
////                    }
////                    else if (map.getZoom() < 3) {
////                        OverGoogleMap_s(index, GoogleMapAddMarker(index));
////                    }
////                    //}

////                })
////            };
////            return marker;
////        }

////        GEvent.addListener(map, "dblclick", function() {
////            if (map.getZoom() >= 4) {

////                map.zoomOut();
////                //alert(map.getZoom());
////                if (map.getZoom() == 3) {

////                    var center = map.getCenter();

////                    OverGoogleMap('0', GoogleMapAddMarker('0'), center.toString());
////                    //				var MarkerList = GoogleMapAddMarker('0');
////                    //				var splitArr = MarkerList.split('■');

////                    //				//alert(map.getZoom());
////                    //				for (var i = 0; i < splitArr.length; i++) {


////                    //					/*TMML_OCOD□	0 : seq
////                    //					Latitude □		1 : 좌표값 
////                    //					Longitude □	2 : 좌표값 
////                    //					TMML_BNER		3 : 이미지
////                    //					TMML_CST1		4 : 가로
////                    //					TMML_CST2		5 : 세로
////                    //					*/
////                    //					var splitArr2 = splitArr[i].split('□');

////                    //					var latlng = new GLatLng(splitArr2[1], splitArr2[2]);
////                    //					map.addOverlay(createMarker(latlng, splitArr2[0], splitArr2[3], splitArr2[4], splitArr2[5], splitArr2[6], splitArr2[7]));
////                    //				}
////                }
////            }
////        });

////        for (var i = 0; i < splitArr.length; i++) {


////            /*TMML_OCOD□	0 : seq
////            Latitude □		1 : 좌표값 
////            Longitude □	2 : 좌표값 
////            TMML_BNER		3 : 이미지
////            TMML_CST1		4 : 가로
////            TMML_CST2		5 : 세로
////            */
////            var splitArr2 = splitArr[i].split('□');

////            var latlng = new GLatLng(splitArr2[1], splitArr2[2]);
////            map.addOverlay(createMarker(latlng, splitArr2[0], splitArr2[3], splitArr2[4], splitArr2[5], splitArr2[6], splitArr2[7]));
////        }
////    }

////}

///////구글 지도 이미지 표시
////function GoogleMapAddMarker(typeCD) {
////    //alert(typeCD);
////    var oParms = "";
////    //oParms = "KeyWord=" + encodeURIComponent(strSearchWord);
////    var returnValue = jQuery.ajax({ url: "/Inc/GoogleAPI.ashx?GoogleMap=" + typeCD, type: 'get', data: oParms, async: false }).responseText;
////    return returnValue;
////}

////---------------------------------------------------------------------------------


//        function ntGMAP__getPosition( )
//        {
//            bounds    = ntGMAP_object.getBounds();
//            southWest = bounds.getSouthWest();
//            northEast = bounds.getNorthEast();

//            return ( new Array(   southWest.lng()                , northEast.lat()
//                                , northEast.lng()                , southWest.lat()
//                                , northEast.lng()-southWest.lng(), northEast.lat()-southWest.lat()
//                              )
//                   );
//        }

//        function ntGMAP__drawCrossLine( )
//        {
//            var center = ntGMAP_object.getCenter();
//            var tmp    = ntGMAP__getPosition();

//            var polylineH = new GPolyline([ new GLatLng( center.lat(), tmp[0] ), new GLatLng( center.lat(), tmp[2] )], "#ff0000", 1);
//            var polylineV = new GPolyline([ new GLatLng( tmp[1], center.lng() ), new GLatLng( tmp[3], center.lng() )], "#ff0000", 1);
//            ntGMAP_object.addOverlay(polylineH);
//            ntGMAP_object.addOverlay(polylineV);
//        }

//        function ntGMAP__ZoomIn( )
//        {
//            ntGMAP_object.zoomIn();
//            ntGMAP__DisplayZoomLevel();
//        }
//        function ntGMAP__ZoomOut( )
//        {
//            ntGMAP_object.zoomOut();
//            ntGMAP__DisplayZoomLevel();
//        }

//=====================================================================================================================================================================

/*  Function Equivalent to java.net.URLEncoder.encode(String, "UTF-8")

Copyright (C) 2002, Cresc Corp.

Version: 1.0

*/

function encodeURL(str) {

    var s0, i, s, u;

    s0 = "";                // encoded str

    for (i = 0; i < str.length; i++) {   // scan the source

        s = str.charAt(i);

        u = str.charCodeAt(i);          // get unicode of the char

        if (s == " ") { s0 += "+"; }       // SP should be converted to "+"

        else {

            if (u == 0x2a || u == 0x2d || u == 0x2e || u == 0x5f || ((u >= 0x30) && (u <= 0x39)) || ((u >= 0x41) && (u <= 0x5a)) || ((u >= 0x61) && (u <= 0x7a))) {       // check for escape

                s0 = s0 + s;            // don't escape

            }

            else {                  // escape

                if ((u >= 0x0) && (u <= 0x7f)) {     // single byte format

                    s = "0" + u.toString(16);

                    s0 += "%" + s.substr(s.length - 2);

                }

                else if (u > 0x1fffff) {     // quaternary byte format (extended)

                    s0 += "%" + (oxf0 + ((u & 0x1c0000) >> 18)).toString(16);

                    s0 += "%" + (0x80 + ((u & 0x3f000) >> 12)).toString(16);

                    s0 += "%" + (0x80 + ((u & 0xfc0) >> 6)).toString(16);

                    s0 += "%" + (0x80 + (u & 0x3f)).toString(16);

                }

                else if (u > 0x7ff) {        // triple byte format

                    s0 += "%" + (0xe0 + ((u & 0xf000) >> 12)).toString(16);

                    s0 += "%" + (0x80 + ((u & 0xfc0) >> 6)).toString(16);

                    s0 += "%" + (0x80 + (u & 0x3f)).toString(16);

                }

                else {                      // double byte format

                    s0 += "%" + (0xc0 + ((u & 0x7c0) >> 6)).toString(16);

                    s0 += "%" + (0x80 + (u & 0x3f)).toString(16);

                }

            }

        }

    }

    return s0;

}



/*  Function Equivalent to java.net.URLDecoder.decode(String, "UTF-8")

Copyright (C) 2002, Cresc Corp.

Version: 1.0

*/

function decodeURL(str) {

    var s0, i, j, s, ss, u, n, f;

    s0 = "";                // decoded str

    for (i = 0; i < str.length; i++) {   // scan the source str

        s = str.charAt(i);

        if (s == "+") { s0 += " "; }       // "+" should be changed to SP

        else {

            if (s != "%") { s0 += s; }     // add an unescaped char

            else {               // escape sequence decoding

                u = 0;          // unicode of the character

                f = 1;          // escape flag, zero means end of this sequence

                while (true) {

                    ss = "";        // local str to parse as int

                    for (j = 0; j < 2; j++) {  // get two maximum hex characters for parse

                        sss = str.charAt(++i);

                        if (((sss >= "0") && (sss <= "9")) || ((sss >= "a") && (sss <= "f")) || ((sss >= "A") && (sss <= "F"))) {

                            ss += sss;      // if hex, add the hex character

                        } else { --i; break; }    // not a hex char., exit the loop

                    }

                    n = parseInt(ss, 16);           // parse the hex str as byte

                    if (n <= 0x7f) { u = n; f = 1; }   // single byte format

                    if ((n >= 0xc0) && (n <= 0xdf)) { u = n & 0x1f; f = 2; }   // double byte format

                    if ((n >= 0xe0) && (n <= 0xef)) { u = n & 0x0f; f = 3; }   // triple byte format

                    if ((n >= 0xf0) && (n <= 0xf7)) { u = n & 0x07; f = 4; }   // quaternary byte format (extended)

                    if ((n >= 0x80) && (n <= 0xbf)) { u = (u << 6) + (n & 0x3f); --f; }         // not a first, shift and add 6 lower bits

                    if (f <= 1) { break; }         // end of the utf byte sequence

                    if (str.charAt(i + 1) == "%") { i++; }                   // test for the next shift byte

                    else { break; }                   // abnormal, format error

                }

                s0 += String.fromCharCode(u);           // add the escaped character

            }

        }

    }

    return s0;

}

