//
// ==UserScript==
// @name           DaCyclops' KoL - Fake Hand Summary
// @namespace      http://cyclops.yqmonline.com
// @include        *kingdomofloathing.com/showplayer.php*
// @include        *kingdomofloathing.com/inventory.php*
// @include        *kingdomofloathing.com/charsheet.php*
// @description    Colapse all the fake hands into One. Version 1.2 (jick changed some code!)
//
// ==/UserScript==

var docBody = document.getElementsByTagName("body")[0];

if (window.location.pathname.indexOf("inventory.php") != -1)
{
//var handsplit = docBody.innerHTML.split('<tr><td align="right" valign="center">Off-Hand:</td><td><img src="http://images.kingdomofloathing.com/itemimages/glove.gif" class="hand" onclick="descitem(826737671);"></td><td><b>fake hand');
  var handsplit = docBody.innerHTML.split('<tr><td align="right" valign="center"><a class="nounder" href="#Off-Hand">Off-Hand</a>:</td><td><img src="http://images.kingdomofloathing.com/itemimages/glove.gif" class="hand" onclick="descitem(826737671);"></td><td><b>fake hand');
//var handline = '<tr><td align="right" valign="center">Off-Hand:</td><td><img src="http://images.kingdomofloathing.com/itemimages/glove.gif" class="hand" onclick="descitem(826737671);"></td><td><b>fake hand (x';
  var handline = '<tr><td align="right" valign="center"><a class="nounder" href="#Off-Hand">Off-Hand</a>:</td><td><img src="http://images.kingdomofloathing.com/itemimages/glove.gif" class="hand" onclick="descitem(826737671);"></td><td><b>fake hand (x';
if (handsplit.length > 1)
{
docBody.innerHTML = handsplit[0] + handline + (handsplit.length - 1) + ")" + handsplit[handsplit.length - 1];
}
}

if ((window.location.pathname.indexOf("charsheet.php") != -1)||(window.location.pathname.indexOf("showplayer.php") != -1))
{
//var handsplit = docBody.innerHTML.split('</td></tr><tr><td height="30" width="30"><img src="http://images.kingdomofloathing.com/itemimages/glove.gif" class="hand" onclick="descitem(826737671)"></td><td valign="center"><b>fake hand');
  var handsplit = docBody.innerHTML.split('</td></tr><tr><td width="30" height="30"><img src="http://images.kingdomofloathing.com/itemimages/glove.gif" class="hand" onclick="descitem(826737671, 55661)"></td><td valign="center"><b>fake hand');
//var handline = '</td></tr><tr><td height="30" width="30"><img src="http://images.kingdomofloathing.com/itemimages/glove.gif" class="hand" onclick="descitem(826737671)"></td><td valign="center"><b>fake hand (x';
  var handline = '</td></tr><tr><td width="30" height="30"><img src="http://images.kingdomofloathing.com/itemimages/glove.gif" class="hand" onclick="descitem(826737671, 55661)"></td><td valign="center"><b>fake hand (x';
if (handsplit.length > 1)
{
docBody.innerHTML = handsplit[0] + handline + (handsplit.length - 1) + ")" + handsplit[handsplit.length - 1];
}
}
