// ==UserScript==
// @name          PlaceEngine for FON maps
// @namespace     http://www.placeengine.com
// @description	  Get current location by PlaceEngine (WiFi position sensing)
// @include http://maps.fon.com/*
// ==/UserScript==

// Author: Jun Rekimoto <rekimoto@acm.org>
// 2006-12-18 Initial Version

var d = document.getElementById("nodePanelMenu");
if (d){
    var newe = document.createElement('div');
    newe.innerHTML = '<div style="color:black;"><table><tr valign="middle"><td><a href="http://www.placeengine.com"><img alt="PlaceEngine" style="border:0;" src="http://www.placeengine.com/images/small_bt3.png"></a></td> <td><input src="http://www.placeengine.com/images/small_bt2.png" type="image" onclick=\'pe.registerLocation()\' /></td> <td><input src="http://www.placeengine.com/images/wide_bt1.png" type="image" onclick=\'pe.getLocation()\' /></td> <td><span id="pestatus"></span></td></tr></table></div>';
    d.parentNode.insertBefore(newe, d.nextSibling);
}

var pe_js = document.createElement("script");
pe_js.type = "text/javascript";
pe_js.src = "http://www.placeengine.com/javascripts/pengine.js";
document.body.appendChild(pe_js);

var pe_js2 = document.createElement("script");
pe_js2.type = "text/javascript";
pe_js2.innerHTML = 'var pe = new PEngine({onGetLocation:function(x,y,r,info){if(map!=null && r>0)map.setCenter(new GLatLng(y,x),17);},idstatus:"pestatus",appkey:"fNMU-J2rgBCgfPd14L3xUjoYL2FFBvfnkChgyqHSB0P.qT3xr5xp3YK-Ni8S9UBUVfN-IgdqwYzo1LyYrX6l8.k420GEDrzYc2T4Ya-BLtVi73AzhYJ5sbuFm1DCXAhYFJUj3LH1tvcJcgHIsYPmHqvIwtr1TCKKLk.G.h9ogY6vwX7DZCUgLxA4og1HZMlWzDAWk5zpcKBAoLrOqVdYXi5BdwH.vpGMtO6YreSqC5B63Q0fCuGhU4c8fhfnVPswWP7WoWZE2OpxK8bxLVTbbFrF9Qa21Q.3mZPT3SMPDv4I..ln2cZ4DqMyp6TJ6upddPN5wE8CTD296Rg4kpOCkQ__,aHR0cDovL21hcHMuZm9uLmNvbQ__,Rk9OIE1hcHM_"});';
document.body.appendChild(pe_js2);









