// ==UserScript==
// @name           Move Tab Half Step Ahead
// @namespace      http://www.xuldev.org/
// @description    Change the position whereto move a tab by drag-and-drop half step ahead.
// @include        main
// @compatibility  Firefox 3.0, 3.5, 3.6b4
// @author         Gomita
// @version        1.0.20080201
// @homepage       http://www.xuldev.org/misc/ucjs.php
// ==/UserScript==

(function() {
	var func = gBrowser.getNewIndex.toString();
	func = func.replace(
		"this.mTabs[i].boxObject.width / 2", 
		"this.mTabs[i].boxObject.width"
	);
	func = func.replace(
		"return i;", 
		"{ if (i > this.mTabContainer.selectedIndex) i++; return i; }"
	);
	eval("gBrowser.getNewIndex = " + func);
})();
