/**
 * @author natu_n
 */
var map;
var aid = "fukushima03-22";

var amrUrl = "http://natu-n.com/Aomori_map.htm?isbn=";
var iwtUrl = "http://natu-n.com/Iwate_map.htm?isbn=";
var mygUrl = "http://natu-n.com/Miyagi_map.htm?isbn=";
var aktUrl = "http://natu-n.com/Akita_map.htm?isbn=";
var ymaUrl = "http://natu-n.com/Yamagata_map.htm?isbn=";
var fksUrl = "http://natu-n.com/Fukushima_map.htm?isbn=";
var BrF = 0;

var icon1 = new GIcon();
    icon1.image = "img/070.png";
    icon1.shadow = "img/shadow50.png";
    icon1.iconSize = new GSize(20,34);
    icon1.shadowSize = new GSize(37,34);
    icon1.iconAnchor = new GPoint(9,33);
var icon1P = new GIcon();
    icon1P.image = "img/070P.png";
    icon1P.shadow = "img/shadow50.png";
    icon1P.iconSize = new GSize(20,34);
    icon1P.shadowSize = new GSize(37,34);
    icon1P.iconAnchor = new GPoint(9,33);
var icon2 = new GIcon();
    icon2.image = "img/010.png";
    icon2.shadow = "img/shadow50.png";
    icon2.iconSize = new GSize(20,34);
    icon2.shadowSize = new GSize(37,34);
    icon2.iconAnchor = new GPoint(9,33);
var icon2P = new GIcon();
    icon2P.image = "img/010P.png";
    icon2P.shadow = "img/shadow50.png";
    icon2P.iconSize = new GSize(20,34);
    icon2P.shadowSize = new GSize(37,34);
    icon2P.iconAnchor = new GPoint(9,33);
var icon3 = new GIcon();
    icon3.image = "img/ajax-loader.gif";
    icon3.iconSize = new GSize(16,16);
    icon3.iconAnchor = new GPoint(7,15);
var iconX = new GIcon();
    iconX.image = "img/036.png";
    iconX.shadow = "img/shadow50.png";
    iconX.iconSize = new GSize(20,34);
    iconX.shadowSize = new GSize(37,34);
    iconX.iconAnchor = new GPoint(9,33);

//  福島県立図書館
var _07000 = {
    "00" : new GLatLng(37.767577,140.457764)
};
var marker_07000 = new GMarker(new GLatLng(37.767577,140.457764),{icon: icon3});

//  福島市立図書館
var _07201 = {
    "00" : new GLatLng(37.757681,140.470835),
    "01" : new GLatLng(37.757681,140.470835),
    "02" : new GLatLng(37.756758,140.458124),
    "03" : new GLatLng(37.75194,140.46064),
    "04" : new GLatLng(37.69837,140.472884),
    "05" : new GLatLng(37.780923,140.456855),
    "06" : new GLatLng(37.760164,140.419559),
    "07" : new GLatLng(37.827713,140.445394),
    "08" : new GLatLng(37.772773,140.500122),
    "09" : new GLatLng(37.749635,140.485624),
    "10" : new GLatLng(37.758679,140.396224),
    "11" : new GLatLng(37.725978,140.436379),
    "12" : new GLatLng(37.725214,140.383711),
    "13" : new GLatLng(37.793792,140.431009),
    "14" : new GLatLng(37.796551,140.479268),
    "15" : new GLatLng(37.659807,140.470792),
    "16" : new GLatLng(37.758417,140.444463),
    "17" : new GLatLng(37.728596,140.464658),
    "18" : new GLatLng(37.753775,140.436572)
};
var marker_07201 = new GMarker(new GLatLng(37.757681,140.470835),{icon: icon3});

//  会津若松市立会津図書館
var _07202 = {
    "00" : new GLatLng(37.489204,139.936337)
};
var marker_07202 = new GMarker(new GLatLng(37.489204,139.936337),{icon: icon3});

//  郡山市立図書館
var _07203 = {
    "00" : new GLatLng(37.393806,140.374353),
    "01" : new GLatLng(37.393806,140.374353),
    "02" : new GLatLng(37.407875,140.338975),
    "03" : new GLatLng(37.364165,140.365684),
    "04" : new GLatLng(37.41984,140.390572),
    "05" : new GLatLng(37.382869,140.435741),
    "08" : new GLatLng(37.359053,140.28937),
    "11" : new GLatLng(37.453245,140.342995),
    "12" : new GLatLng(37.446118,140.388716),
    "14" : new GLatLng(37.45548054884649,140.44010996818542),
    "15" : new GLatLng(37.325313,140.41251),
    "17" : new GLatLng(37.357294,140.489573)
};
var marker_07203 = new GMarker(new GLatLng(37.393806,140.374353),{icon: icon3});

//  いわき市立図書館
var _07204 = {
    "11" : new GLatLng(37.056898090845785,140.89184761047363),
    "12" : new GLatLng(36.953994,140.89468),
    "13" : new GLatLng(36.914633,140.7983),
    "14" : new GLatLng(37.001353,140.84868),
    "15" : new GLatLng(37.036321,140.857687),
    "16" : new GLatLng(37.100269,140.985138),
    "21" : new GLatLng(37.052544,140.889664),
    "23" : new GLatLng(37.052544,140.889664)
};
var marker_07204 = new GMarker(new GLatLng(37.052544,140.889664),{icon: icon3});

//  須賀川市図書館
var _07207 = {
    "01" : new GLatLng(37.28635,140.372411),
    "02" : new GLatLng(37.289717,140.211661),
    "03" : new GLatLng(37.317637,140.276742)
};
var marker_07207 = new GMarker(new GLatLng(37.28635,140.372411),{icon: icon3});

//  喜多方市立図書館
var _07208 = {
    "00" : new GLatLng(37.646458,139.875395)
};
var marker_07208 = new GMarker(new GLatLng(37.646458,139.875395),{icon: icon3});

//  南相馬市図書館
var _07212 = {
    "00" : new GLatLng(37.640386,140.95625)
};
var marker_07212 = new GMarker(new GLatLng(37.640386,140.95625),{icon: icon3});

//  本宮市立しらさわ夢図書館
var _07214 = {
    "01" : new GLatLng(37.507841,140.452378),
    "02" : new GLatLng(37.517217,140.400534)
};
var marker_07214 = new GMarker(new GLatLng(37.507841,140.452378),{icon: icon3});

//  南会津図書館
var _07368 = {
    "00" : new GLatLng(37.206233,139.780303)
};
var marker_07368 = new GMarker(new GLatLng(37.206233,139.780303),{icon: icon3});

//  西会津中学校図書館
var _07405 = {
    "00" : new GLatLng(37.589964,139.653343)
};
var marker_07405 = new GMarker(new GLatLng(37.589964,139.653343),{icon: icon3});

//  三春町民図書館
var _07521 = {
    "00" : new GLatLng(37.441814,140.491244)
};
var marker_07521 = new GMarker(new GLatLng(37.441814,140.491244),{icon: icon3});

//  広野町公民館図書室
var _07541 = {
    "00" : new GLatLng(37.214369,140.994598)
};
var marker_07541 = new GMarker(new GLatLng(37.214369,140.994598),{icon: icon3});

//  富岡町図書館
var _07543 = {
    "00" : new GLatLng(37.34732,141.009511)
};
var marker_07543 = new GMarker(new GLatLng(37.34732,141.009511),{icon: icon3});

//  大熊町図書館
var _07545 = {
    "00" : new GLatLng(37.406846423171515, 140.98539233207703)
};
var marker_07545 = new GMarker(new GLatLng(37.406846423171515, 140.98539233207703), {icon: icon3});

//  浪江町図書館
var _07547 = {
    "00" : new GLatLng(37.49149380653242,140.98714113235474)
};
var marker_07547 = new GMarker(new GLatLng(37.49149380653242,140.98714113235474),{icon: icon3});

//  新地町図書館
var _07561 = {
    "00" : new GLatLng(37.876272,140.920349)
};
var marker_07561 = new GMarker(new GLatLng(37.876272,140.920349),{icon: icon3});

//  相馬市図書館
var _07209 = {
    "00" : new GLatLng(37.802013,140.925568),
    "url1" : "http://www.city.soma.fukushima.jp/tosyo/list.asp?bookname=",
    "url2" : "&kanabookname=&copyname=&kanacopy=&sakuname=&ippann=1&child=2&kyoudo=5"
};

//  国見町観月台文化センター図書室
var _07303 = {
    "00" : new GLatLng(37.877119,140.542428),
    "url1" : "http://www.town.kunimi.fukushima.jp/cb2/book/result.jsp?BNAME=",
    "url2" : "&AUTHOR=&COMPANY=&YEAR1=&YEAR2=&CONTENTS=&TURN=1&PAGESIZE=10"
};

//          GreyBox configuration
//                                              Use animation?
var GB_ANIMATION = true;
var GB_IMG_DIR = "greybox/";
    GreyBox.preloadGreyBoxImages();
//                                              Clicking on the transparent overlay closes the GreyBox window?
var GB_overlay_click_close = true;

function load() {
    if (!GBrowserIsCompatible()) {
        alert("このブラウザはGoogle Mapsに対応していません");
        return;
    }
    if(navigator.userAgent.indexOf("MSIE 7") != -1) {
        BrF = 1;
}
//  window.external.AddSearchProvider("http://natu-n.com/Fukushima_map.xml");
//  関連情報の非表示
    $("series").hide();
/*
 *  入力フォームでのキーイベント(Enter)の取得
 *      Enterキー押下でのsubmitを抑制し(リロードを防ぐ)、検索ボタン押下のイベントを発生させる
*/
    Event.observe($('ISBN'), 'keypress',
        function(event){
            if (event.keyCode == Event.KEY_RETURN) {
                Event.stop(event);
                document.iform.BTN.focus();
                AddDashSub();
            }
        }
        , false);

//  マップの読み込み、マウスでの拡大縮小イベントの追加
    map = new GMap2(document.getElementById("map"));
    map.setCenter(new GLatLng(37.393806,140.374353), 9);
    map.addControl(new GLargeMapControl());
    map.addControl(new GScaleControl());
    map.addControl(new GOverviewMapControl());
    map.enableDoubleClickZoom();
    Event.observe($('map'),'mousewheel',
        function (element, wheel_count){
                wheel_count == 1 ? map.zoomIn() : map.zoomOut();
        }
    , false);

//  クエリ文字列をサニタイズしてからパラメータへセット
    document.iform.ISBN.value = "";
    document.iform.ISBN.focus();
    para = document.location.search.substr(1).toQueryParams();
    if (para['isbn']){
        para['isbn'] = para['isbn'].replace(/[^0-9X]/g,'');
        if ((para['isbn'].length == 10) || (para['isbn'].length == 13)){
            document.iform.ISBN.value = para['isbn'];
            document.iform.ISBN.blur();
            $("BTN").onclick();
        }
    } else if (para['ISBN']){
        para['ISBN'] = para['ISBN'].replace(/[^0-9X]/g, '');
        if ((para['ISBN'].length == 10) || (para['ISBN'].length == 13)){
            document.iform.ISBN.value = para['ISBN'];
            document.iform.ISBN.blur();
            $("BTN").onclick();
        }
    }

}

/*
 *  マーカ定義１(Greybox表示あり)
 *  引数    point   :表示位置
 *          name    :onMouseでの表示名、Greyboxのタイトル
 *          url     :Greyboxで表示するurl
 *          icon    :追加するアイコン
*/
function createMarker1(point,name,url,icon) {
    var marker = new GMarker(point, {icon:icon,title:name});
    if (BrF == 0) {
        GEvent.addListener(marker, "click", function() {
            GB_showFullScreen(name, url);
            });
    } else {
        GEvent.addListener(marker, "click", function() {
            window.open(url);
            });
    }
    return marker;
}
/*
 *  マーカ定義２(Greybox表示なし)
 *  引数    point   :表示位置
 *          name    :onMouseでの表示名
 *          icon    :追加するアイコン
*/
function createMarker2(point,name,icon) {
    var marker = new GMarker(point, {icon:icon,title:name});
    return marker;
}

function AddDashSub (){
    str = document.iform.ISBN.value;
    switch(str.length){
        case 9:
            if (str.match(/(\d{9})/)){
                ISBN13   = "978" + str;
                ISBN10   = cvISBN10(ISBN13);
                ISBN10e  = edISBN10(ISBN10);
                ISBN10m  = ISBN10.substr(0,9);
                ISBN10em = ISBN10e.substr(0,11);
                ISBN13   = cvISBN13(ISBN10);
                ISBN13e  = edISBN13(ISBN13);
                document.iform.ISBN.value = ISBN10;
                break;
            } else {
                document.iform.ISBN.value = "";
                document.iform.ISBN.focus();
                return;
            }
        case 10:
            if (str.match(/(\d{9}[\d|X])/)){
                if (ckISBN10(str)) {
                    ISBN10   = str;
                    ISBN10e  = edISBN10(ISBN10);
                    ISBN10m  = ISBN10.substr(0,9);
                    ISBN10em = ISBN10e.substr(0,11);
                    ISBN13   = cvISBN13(ISBN10);
                    ISBN13e  = edISBN13(ISBN13);
                    break;
                }
                str = "978" + str;
                if (ckISBN13(str)) {
                    ISBN13   = str;
                    ISBN13e  = edISBN13(ISBN13);
                    ISBN10   = cvISBN10(ISBN13);
                    ISBN10e  = edISBN10(ISBN10);
                    ISBN10m  = ISBN10.substr(0,9);
                    ISBN10em = ISBN10e.substr(0,11);
                    document.iform.ISBN.value = ISBN13;
                    break;
                } else {
                    document.iform.ISBN.value = "";
                    document.iform.ISBN.focus();
                    return;
                }
            } else {
                document.iform.ISBN.value = "";
                document.iform.ISBN.focus();
                return;
            }
        case 12:
            if (str.match(/(\d{12})/)){
                ISBN10   = str.substr(3,9) + "X";
                ISBN13   = cvISBN13(ISBN10);
                ISBN13e  = edISBN13(ISBN13);
                ISBN10   = cvISBN10(ISBN13);
                ISBN10e  = edISBN10(ISBN10);
                ISBN10m  = ISBN10.substr(0,9);
                ISBN10em = ISBN10e.substr(0,11);
                document.iform.ISBN.value = ISBN13;
                break;
            } else {
                document.iform.ISBN.value = "";
                document.iform.ISBN.focus();
                return;
            }
        case 13:
            if (str.match(/(\d{13})/)){
                if (ckISBN13(str)) {
                    ISBN13   = str;
                    ISBN13e  = edISBN13(ISBN13);
                    ISBN10   = cvISBN10(ISBN13);
                    ISBN10e  = edISBN10(ISBN10);
                    ISBN10m  = ISBN10.substr(0,9);
                    ISBN10em = ISBN10e.substr(0,11);
                    document.iform.ISBN.value = ISBN13;
                    break;
                } else {
                    document.iform.ISBN.value = "";
                    document.iform.ISBN.focus();
                    return;
                }
            } else {
                document.iform.ISBN.value = "";
                document.iform.ISBN.focus();
                return;
            }
        default:
            document.iform.ISBN.value = "";
            document.iform.ISBN.focus();
            return;
    }

    mgr = new GMarkerManager(map);
    map.clearOverlays();
    mgr.refresh();
    var elementTarget = $("ttl");
    while ( elementTarget.hasChildNodes() ) {
        elementTarget.removeChild(elementTarget.firstChild);
    }
    elementTarget = $("img");
    while ( elementTarget.hasChildNodes() ) {
        elementTarget.removeChild(elementTarget.firstChild);
    }
//  elementTarget = $("links");
//  elementTarget.getElementsByTagName("a")[0].setAttribute('href' ,lnksUrl);
    $("amr").setAttribute('href' ,amrUrl + ISBN10);
    $("iwt").setAttribute('href' ,iwtUrl + ISBN10);
    $("myg").setAttribute('href' ,mygUrl + ISBN10);
    $("akt").setAttribute('href' ,aktUrl + ISBN10);
    $("yma").setAttribute('href' ,ymaUrl + ISBN10);
    $("thisLink").setAttribute('href' ,fksUrl + ISBN10);

//  Amazonより書籍情報を取得、表示
    Amazon_get(ISBN10);

//Webcat Plusで情報取得
    var elementTarget = $("btn2");
    while ( elementTarget.hasChildNodes() ) {
        elementTarget.removeChild(elementTarget.firstChild);
    }
    var elementTarget = $("series");
    while ( elementTarget.hasChildNodes() ) {
        elementTarget.removeChild(elementTarget.firstChild);
    }
    elementTarget.hide();
//  var wc_url = "http://natu-n.com/cgi/webcat_get3.cgi?isbn=" + ISBN10;
    var wc_url = "http://natu-n.com/cgi/webcat_get6.cgi?isbn=" + ISBN10;
    var wc_http = new JKL.ParseXML.JSON( wc_url );
    var wc_func = function (data) {
        var elementTarget = $("series");
        var hash1 = $H( data.series );
        if (data.flg == true) {
            var ul1 = document.createElement('ul');
            elementTarget.appendChild(ul1);
            var j = 0;
            hash1.each( function( pair ) {
                var li1 = document.createElement('li');
                elementTarget.getElementsByTagName("ul")[0].appendChild(li1);
                var lk1 = document.createElement('a');
                    lk1.setAttribute('href' ,'#');
                    lk1.setAttribute('title' ,hash1[pair.key]);
                var li1 = document.createTextNode(hash1[pair.key]);
                elementTarget.getElementsByTagName("li")[j].appendChild(lk1);
                elementTarget.getElementsByTagName("a")[j].appendChild(li1);
                Event.observe(elementTarget.getElementsByTagName("a")[j], 'click',
                    function(event){
                        $("series").hide();
                        $("map").show();
                        $("btn2").show();
                        document.iform.ISBN.value = pair.key;
                        document.iform.ISBN.blur();
                        $("BTN").onclick();
                    }
                , false);
                j++;
            } );
            var li1 = document.createElement('li');
            elementTarget.getElementsByTagName("ul")[0].appendChild(li1);
            var lk1 = document.createElement('a');
                lk1.setAttribute('href' ,'#');
                lk1.setAttribute('title' ,'マップ表示');
            var li1 = document.createTextNode('マップ表示≫');
            elementTarget.getElementsByTagName("li")[j].appendChild(lk1);
            elementTarget.getElementsByTagName("a")[j].appendChild(li1);
            Event.observe(elementTarget.getElementsByTagName("a")[j], 'click',
                function(event){
                    $("series").hide();
                    $("map").show();
                    $("btn2").show();
                }
            , false);
            
//      他巻情報表示ボタン作成
            var elementTarget = $("btn2");
            var lk1 = document.createElement('a');
                lk1.setAttribute('href' ,'#');
                lk1.setAttribute('title' ,'関連情報表示');
            var li1 = document.createTextNode('≪関連情報表示');
            elementTarget.appendChild(lk1);
            Event.observe(elementTarget.getElementsByTagName("a")[0], 'click',
                function(event){
                    $("btn2").hide();
                    $("map").hide();
                    $("series").show();
                }
            , false);
            elementTarget.getElementsByTagName("a")[0].appendChild(li1);
        }
    };
    wc_http.async(wc_func);
    wc_http.parse();

//  福島県立図書館
    var url_07000 = "http://natu-n.com/cgi/07000.cgi?isbn=" + ISBN10;
    var http_07000 = new JKL.ParseXML.JSON( url_07000 );
    var func_07000 = function (data) {
        var hash1 = $H( data.lib_07000 );
        var hash2 = $H( _07000 );
        var hash3 = $H( data.name_07000 );
        if (data.stock_07000 == true) {
            var marker = createMarker1(hash2["00"],hash3["00"],data.uri_07000[0],icon1P);
        } else {
            var marker = createMarker2(hash2["00"],hash3["00"],icon2P);
        }
        map.removeOverlay(marker_07000);
        mgr.addMarker(marker,0);
        mgr.refresh();
        };
    map.addOverlay(marker_07000);
    http_07000.async(func_07000);
    http_07000.parse();

//  福島市立図書館
    var url_07201 = "http://natu-n.com/cgi/07201.cgi?isbn=" + ISBN10;
    var http_07201 = new JKL.ParseXML.JSON( url_07201 );
    var func_07201 = function (data) {
        var hash1 = $H( data.lib_07201 );
        var hash2 = $H( _07201 );
        var hash3 = $H( data.name_07201 );
        if (data.stock_07201 == true) {
            var marker = createMarker1(hash2["00"],hash3["00"],data.uri_07201[0],icon1);
            mgr.addMarker(marker,0,11);
            hash1.each( function( pair ) {
                if (pair.value == true) {
                    var marker = createMarker1(hash2[pair.key],hash3[pair.key],data.uri_07201[0],icon1);
                } else {
                    var marker = createMarker2(hash2[pair.key],hash3[pair.key],icon2);
                }
                mgr.addMarker(marker,12);
            } );
        } else {
            var marker = createMarker2(hash2["00"],hash3["00"],icon2);
            mgr.addMarker(marker,0,11);
            hash2.each( function( pair ) {
                var marker = createMarker2(hash2[pair.key],hash3[pair.key],icon2);
                mgr.addMarker(marker,12);
            } );
        }
        map.removeOverlay(marker_07201);
        mgr.refresh();
        };
    map.addOverlay(marker_07201);
    http_07201.async(func_07201);
    http_07201.parse();

//  会津若松市立会津図書館
    var url_07202 = "http://natu-n.com/cgi/07202.cgi?isbn=" + ISBN10m;
    var http_07202 = new JKL.ParseXML.JSON( url_07202 );
    var func_07202 = function (data) {
        var hash1 = $H( data.lib_07202 );
        var hash2 = $H( _07202 );
        var hash3 = $H( data.name_07202 );
        if (data.stock_07202 == true) {
            hash1.each( function( pair ) {
                if (pair.value == true) {
                    var marker = createMarker1(hash2[pair.key],hash3[pair.key],data.uri_07202[0],icon1);
                } else {
                    var marker = createMarker2(hash2[pair.key],hash3[pair.key],icon2);
                }
                mgr.addMarker(marker,0);
            } );
        } else {
            hash2.each( function( pair ) {
                var marker = createMarker2(hash2[pair.key],hash3[pair.key],icon2);
                mgr.addMarker(marker,0);
            } );
        }
        map.removeOverlay(marker_07202);
        mgr.refresh();
    };
    map.addOverlay(marker_07202);
    http_07202.async(func_07202);
    http_07202.parse();

//  郡山市立図書館
    var url_07203 = "http://natu-n.com/cgi/07203.cgi?isbn=" + ISBN10;
    var http_07203 = new JKL.ParseXML.JSON( url_07203 );
    var func_07203 = function (data) {
        var hash1 = $H( data.lib_07203 );
        var hash2 = $H( _07203 );
        var hash3 = $H( data.name_07203 );
        if (data.stock_07203 == true) {
            var marker = createMarker1(hash2["00"],hash3["00"],data.uri_07203[0],icon1);
            mgr.addMarker(marker,0,11);
            hash1.each( function( pair ) {
                if (pair.value == true) {
                    var marker = createMarker1(hash2[pair.key],hash3[pair.key],data.uri_07203[0],icon1);
                } else {
                    var marker = createMarker2(hash2[pair.key],hash3[pair.key],icon2);
                }
                mgr.addMarker(marker,12);
            } );
        } else {
            var marker = createMarker2(hash2["00"],hash3["00"],icon2);
            mgr.addMarker(marker,0,11);
            hash2.each( function( pair ) {
                var marker = createMarker2(hash2[pair.key],hash3[pair.key],icon2);
                mgr.addMarker(marker,12);
            } );
        }
        map.removeOverlay(marker_07203);
        mgr.refresh();
        };
    map.addOverlay(marker_07203);
    http_07203.async(func_07203);
    http_07203.parse();

//  いわき市立図書館
    var url_07204 = "http://natu-n.com/cgi/07204.cgi?isbn=" + ISBN10m;
    var http_07204 = new JKL.ParseXML.JSON( url_07204 );
    var func_07204 = function (data) {
        var hash1 = $H( data.lib_07204 );
        var hash2 = $H( _07204 );
        var hash3 = $H( data.name_07204 );
        if (data.stock_07204 == true) {
            hash1.each( function( pair ) {
                if ((pair.key == "21") || (pair.key == "23")) throw $continue;
                if (pair.value == true) {
                    var marker = createMarker1(hash2[pair.key],hash3[pair.key],data.uri_07204[0],icon1);
                } else {
                    var marker = createMarker2(hash2[pair.key],hash3[pair.key],icon2);
                }
                mgr.addMarker(marker,0);
            } );
        } else {
            hash2.each( function( pair ) {
                var marker = createMarker2(hash2[pair.key],hash3[pair.key],icon2);
                mgr.addMarker(marker,0);
            } );
        }
        map.removeOverlay(marker_07204);
        mgr.refresh();
        };

    map.addOverlay(marker_07204);
    http_07204.async(func_07204);
    http_07204.parse();

//  須賀川市図書館
    var url_07207 = "http://natu-n.com/cgi/07207.cgi?isbn=" + ISBN10m;
    var http_07207 = new JKL.ParseXML.JSON( url_07207 );
    var func_07207 = function (data) {
        var hash1 = $H( data.lib_07207 );
        var hash2 = $H( _07207 );
        var hash3 = $H( data.name_07207 );
        if (data.stock_07207 == true) {
            hash1.each( function( pair ) {
                if (pair.key == "99") throw $continue;
                if (pair.value == true) {
                    var marker = createMarker1(hash2[pair.key],hash3[pair.key],data.uri_07207[0],icon1);
                } else {
                    var marker = createMarker2(hash2[pair.key],hash3[pair.key],icon2);
                }
                mgr.addMarker(marker,0);
            } );
        } else {
            hash2.each( function( pair ) {
                var marker = createMarker2(hash2[pair.key],hash3[pair.key],icon2);
                mgr.addMarker(marker,0);
            } );
        }
        map.removeOverlay(marker_07207);
        mgr.refresh();
    };
    map.addOverlay(marker_07207);
    http_07207.async(func_07207);
    http_07207.parse();

//  喜多方市立図書館
    var url_07208 = "http://natu-n.com/cgi/07208.cgi?isbn=" + ISBN10;
    var http_07208 = new JKL.ParseXML.JSON( url_07208 );
    var func_07208 = function (data) {
        var hash1 = $H( data.lib_07208 );
        var hash2 = $H( _07208 );
        var hash3 = $H( data.name_07208 );
        if (data.stock_07208 == true) {
            hash1.each( function( pair ) {
                if (pair.value == true) {
                    var marker = createMarker1(hash2[pair.key],hash3[pair.key],data.uri_07208[0],icon1);
                } else {
                    var marker = createMarker2(hash2[pair.key],hash3[pair.key],icon2);
                }
                mgr.addMarker(marker,0);
            } );
        } else {
            hash2.each( function( pair ) {
                var marker = createMarker2(hash2[pair.key],hash3[pair.key],icon2);
                mgr.addMarker(marker,0);
            } );
        }
        map.removeOverlay(marker_07208);
        mgr.refresh();
    };
    map.addOverlay(marker_07208);
    http_07208.async(func_07208);
    http_07208.parse();

//  南相馬市図書館
    var url_07212 = "http://natu-n.com/cgi/07212.cgi?isbn=" + ISBN10m;
    var http_07212 = new JKL.ParseXML.JSON( url_07212 );
    var func_07212 = function (data) {
        var hash1 = $H( data.lib_07212 );
        var hash2 = $H( _07212 );
        var hash3 = $H( data.name_07212 );
        if (data.stock_07212 == true) {
            var marker = createMarker1(hash2["00"],hash3["00"],data.uri_07212[0],icon1);
        } else {
            var marker = createMarker2(hash2["00"],hash3["00"],icon2);
        }
        map.removeOverlay(marker_07212);
        mgr.addMarker(marker,0);
        mgr.refresh();
        };
    map.addOverlay(marker_07212);
    http_07212.async(func_07212);
    http_07212.parse();

//  本宮市立しらさわ夢図書館
    var url_07214 = "http://natu-n.com/cgi/07214.cgi?isbn=" + ISBN10m;
    var http_07214 = new JKL.ParseXML.JSON( url_07214 );
    var func_07214 = function (data) {
        var hash1 = $H( data.lib_07214 );
        var hash2 = $H( _07214 );
        var hash3 = $H( data.name_07214 );
        if (data.stock_07214 == true) {
            hash1.each( function( pair ) {
                if (pair.value == true) {
                    var marker = createMarker1(hash2[pair.key],hash3[pair.key],data.uri_07214[0],icon1);
                } else {
                    var marker = createMarker2(hash2[pair.key],hash3[pair.key],icon2);
                }
                mgr.addMarker(marker,0);
            } );
        } else {
            hash2.each( function( pair ) {
                var marker = createMarker2(hash2[pair.key],hash3[pair.key],icon2);
                mgr.addMarker(marker,0);
            } );
        }
        map.removeOverlay(marker_07214);
        mgr.refresh();
    };
    map.addOverlay(marker_07214);
    http_07214.async(func_07214);
    http_07214.parse();

//  南会津図書館
    var url_07368 = "http://natu-n.com/cgi/07368.cgi?isbn=" + ISBN10m;
    var http_07368 = new JKL.ParseXML.JSON( url_07368 );
    var func_07368 = function (data) {
        var hash1 = $H( data.lib_07368 );
        var hash2 = $H( _07368 );
        var hash3 = $H( data.name_07368 );
        if (data.stock_07368 == true) {
            var marker = createMarker1(hash2["00"], hash3["00"], data.uri_07368[0], icon1);
        } else {
            var marker = createMarker2(hash2["00"], hash3["00"], icon2);
        }
        map.removeOverlay(marker_07368);
        mgr.addMarker(marker,0);
        mgr.refresh();
    };
    map.addOverlay(marker_07368);
    http_07368.async(func_07368);
    http_07368.parse();

//  西会津中学校図書館
    var url_07405 = "http://natu-n.com/cgi/07405.cgi?isbn=" + ISBN10m;
    var http_07405 = new JKL.ParseXML.JSON( url_07405 );
    var func_07405 = function (data) {
        var hash1 = $H( data.lib_07405 );
        var hash2 = $H( _07405 );
        var hash3 = $H( data.name_07405 );
        if (data.stock_07405 == true) {
            var marker = createMarker1(hash2["00"],hash3["00"],data.uri_07405[0],icon1);
        } else {
            var marker = createMarker2(hash2["00"],hash3["00"],icon2);
        }
        map.removeOverlay(marker_07405);
        mgr.addMarker(marker,0);
        mgr.refresh();
    };
    map.addOverlay(marker_07405);
    http_07405.async(func_07405);
    http_07405.parse();
//  三春町民図書館
    var url_07521 = "http://natu-n.com/cgi/07521.cgi?isbn=" + ISBN10m;
    var http_07521 = new JKL.ParseXML.JSON( url_07521 );
    var func_07521 = function (data) {
        var hash1 = $H( data.lib_07521 );
        var hash2 = $H( _07521 );
        var hash3 = $H( data.name_07521 );
        if (data.stock_07521 == true) {
            var marker = createMarker1(hash2["00"],hash3["00"],data.uri_07521[0],icon1);
        } else {
            var marker = createMarker2(hash2["00"],hash3["00"],icon2);
        }
        map.removeOverlay(marker_07521);
        mgr.addMarker(marker,0);
        mgr.refresh();
        };
    map.addOverlay(marker_07521);
    http_07521.async(func_07521);
    http_07521.parse();

//  広野町公民館図書室
    var url_07541 = "http://natu-n.com/cgi/07541.cgi?isbn=" + ISBN10m;
    var http_07541 = new JKL.ParseXML.JSON( url_07541 );
    var func_07541 = function (data) {
        var hash1 = $H( data.lib_07541 );
        var hash2 = $H( _07541 );
        var hash3 = $H( data.name_07541 );
        if (data.stock_07541 == true) {
            var marker = createMarker1(hash2["00"],hash3["00"],data.uri_07541[0],icon1);
        } else {
            var marker = createMarker2(hash2["00"],hash3["00"],icon2);
        }
        map.removeOverlay(marker_07541);
        mgr.addMarker(marker,0);
        mgr.refresh();
        };
    map.addOverlay(marker_07541);
    http_07541.async(func_07541);
    http_07541.parse();

//  富岡町図書館
    var url_07543 = "http://natu-n.com/cgi/07543.cgi?isbn=" + ISBN10m;
    var http_07543 = new JKL.ParseXML.JSON( url_07543 );
    var func_07543 = function (data) {
        var hash1 = $H( data.lib_07543 );
        var hash2 = $H( _07543 );
        var hash3 = $H( data.name_07543 );
        if (data.stock_07543 == true) {
            var marker = createMarker1(hash2["00"],hash3["00"],data.uri_07543[0],icon1);
        } else {
            var marker = createMarker2(hash2["00"],hash3["00"],icon2);
        }
        map.removeOverlay(marker_07543);
        mgr.addMarker(marker,0);
        mgr.refresh();
        };
    map.addOverlay(marker_07543);
    http_07543.async(func_07543);
    http_07543.parse();

//  大熊町図書館
    var url_07545 = "http://natu-n.com/cgi/07545.cgi?isbn=" + ISBN10;
    var http_07545 = new JKL.ParseXML.JSON( url_07545 );
    var func_07545 = function (data) {
        var hash1 = $H( data.lib_07545 );
        var hash2 = $H( _07545 );
        var hash3 = $H( data.name_07545 );
        if (data.stock_07545 == true) {
            var marker = createMarker1(hash2["00"],hash3["00"],data.uri_07545[0],icon1);
        } else {
            var marker = createMarker2(hash2["00"],hash3["00"],icon2);
        }
        map.removeOverlay(marker_07545);
        mgr.addMarker(marker,0);
        mgr.refresh();
        };
    map.addOverlay(marker_07545);
    http_07545.async(func_07545);
    http_07545.parse();

//  浪江町図書館
    var url_07547 = "http://natu-n.com/cgi/07547.cgi?isbn=" + ISBN10m;
    var http_07547 = new JKL.ParseXML.JSON( url_07547 );
    var func_07547 = function (data) {
        var hash1 = $H( data.lib_07547 );
        var hash2 = $H( _07547 );
        var hash3 = $H( data.name_07547 );
        if (data.stock_07547 == true) {
            var marker = createMarker1(hash2["00"],hash3["00"],data.uri_07547[0],icon1);
        } else {
            var marker = createMarker2(hash2["00"],hash3["00"],icon2);
        }
        map.removeOverlay(marker_07547);
        mgr.addMarker(marker,0);
        mgr.refresh();
        };
    map.addOverlay(marker_07547);
    http_07547.async(func_07547);
    http_07547.parse();

//  新地町図書館
    var url_07561 = "http://natu-n.com/cgi/07561.cgi?isbn=" + ISBN10m;
    var http_07561 = new JKL.ParseXML.JSON( url_07561 );
    var func_07561 = function (data) {
        var hash1 = $H( data.lib_07561 );
        var hash2 = $H( _07561 );
        var hash3 = $H( data.name_07561 );
        if (data.stock_07561 == true) {
            var marker = createMarker1(hash2["00"],hash3["00"],data.uri_07561[0],icon1);
        } else {
            var marker = createMarker2(hash2["00"],hash3["00"],icon2);
        }
        map.removeOverlay(marker_07561);
        mgr.addMarker(marker,0);
        mgr.refresh();
        };
    map.addOverlay(marker_07561);
    http_07561.async(func_07561);
    http_07561.parse();

//  書名検索館
    var url_bk1 = "http://natu-n.com/cgi/bk1.cgi?isbn=" + ISBN10;
    var http_bk1 = new JKL.ParseXML.JSON( url_bk1 );
    var func_bk1 = function (data) {
        if (data.bk1 == true) {
//          var marker = createMarker1(_07209["00"], "相馬市図書館", _07209["url1"] + data.sname + _07209["url2"], iconX);
//              mgr.addMarker(marker,0);
            var marker = createMarker1(_07303["00"], "国見町観月台文化センター図書室", _07303["url1"] + data.sname + _07303["url2"], iconX);
                mgr.addMarker(marker,0);
                mgr.refresh();
        } else {
//          var marker = createMarker2(_07209["00"], "相馬市図書館", icon2);
//              mgr.addMarker(marker,0);
            var marker = createMarker2(_07303["00"], "国見町観月台文化センター図書室", icon2);
                mgr.addMarker(marker,0);
                mgr.refresh();
        }
    };
    http_bk1.async(func_bk1);
    http_bk1.parse();

    var rss = "http://myrmecoleon.sytes.net/map/libgeo.php?area=2&isbn=" + ISBN10;
    var geoXml = new GGeoXml(rss);
    map.addOverlay(geoXml);

}

function clkTab(obj){
    $("current").removeAttribute('id');
    if (obj == "01") {
        document.getElementsByTagName("li")[0].setAttribute('id' ,'current');
        map.setCenter(new GLatLng(37.393806,140.374353), 9);
    } else if (obj == "02") {
        document.getElementsByTagName("li")[1].setAttribute('id' ,'current');
        map.setCenter(new GLatLng(37.754228,140.460299), 12);
    } else {
        document.getElementsByTagName("li")[2].setAttribute('id' ,'current');
        map.setCenter(new GLatLng(37.397985,140.388424), 12);
    }
}
