// ==UserScript==
// @name           Urban Dead Bug Exploit
// @namespace      http://gdorn.nudio.net/greasemonkey/
// @description    Adds a "Scout area" button to the map.  When used in a building-less block, lets you see inside surrounding buildings.
// @include        *urbandead.com*
// ==/UserScript==

//find the "search the area" form
var sa_form;
var allforms = document.getElementsByTagName('form');
	for (var i = 0; i < allforms.length; i++)
  {
  	var currform = allforms[i];
    if (currform.action == "map.cgi?search")
    {
    	sa_form = currform;
    }
	}


var newform = document.createElement('form');
newform.action="map.cgi?in";
newform.method="post";
newform.innerHTML="<input class='m' value='Scout adjacent buildings' type='submit'>";

sa_form.parentNode.insertBefore(newform, sa_form.nextSibling);

