// Your Google Maps API Key
var api_key = 'ABQIAAAANb5JuD4i3v_Isz_A_z4ipxTrwmVSgF6tOzG2piSiw3F-ORmacRQGqjoiQ55HzLvszowcXYUDT1mXwA';

//function BKFeed(data) {
    data = tagchan;
    var m, eDate;
    var html = '';
    m = data.last_active_at.match(/(\d*)\/(\d*)\/(\d*) (\d*):(\d*):(\d*)/);
    eDate = new Date(Number(m[1]), Number(m[2]) - 1, Number(m[3]),
                         Number(m[4]) + 9, Number(m[5]), Number(m[6]));

    var req_url = 'http://maps.google.com/maps/geo?oe=utf-8&ll=' +data.place.latitude+ '%2C' +data.place.longitude+ '&key=' + api_key + '&output=json&callback=gmap';
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = req_url;
    document.getElementsByTagName("head")[0].appendChild(script);

    html += '<div style="width:170px;margin-left:10px;">' + eDate.getFullYear() + '/' + (eDate.getMonth() + 1) + '/' + eDate.getDate() + '  ' + eDate.getHours() + ':' + eDate.getMinutes() + '<br>';
    html += '<img src="http://maps.google.com/staticmap?zoom=14&size=165x100&maptype=mobile&markers='+ data.place.latitude +','+ data.place.longitude + '&key=' + api_key + '"><br>';
    html += 'Lat: ' +data.place.latitude+ '<Br>Lon:' +data.place.longitude+ '<br><a href="http://brightkite.com/places/' +data.place.id+ '"><span id="jusho"></span></a></div>';
    document.getElementById('ima_koko').innerHTML = html;

//}

function gmap(obj){
    var ad = obj.Placemark[0].address;
    document.getElementById('jusho').innerHTML = 'L:'+ ad +'';
    return;
}
