/*
* @title autonameko
* @description http://s6.ql.bz/~iqp/nameko/nameko.html で自動収穫するブックマークレット
*/
(function() {
var x = Math.floor(Math.random() * arObj.length);
var y = Math.floor(Math.random() * arObj[x].length);
var obj = arObj[x][y];
obj.isAnimation = true;
var id = "#" + obj.id;
$(id).animate({height:"+=20", top:"-=20"}, "fast");
$(id).animate({height:"-=25", top:"+=5"}, "fast");
$(id).animate({height:"+=5"}, "fast");
$(id).animate({ width:"hide", height:"hide", top:0, left:0 }, "normal");
$(id).animate({top:obj.y+SIZE_Y/2, left:obj.x+SIZE_X/2}, "fast", function() {
var n = Math.floor( Math.random() * GOLDEN_PROBABILITY );
$(id).attr("src", n == 1 ? goldenSrc : namekoSrc);
});
$(id).animate({ width:"show", height:"show",top:obj.y, left:obj.x}, "normal", function() {
obj.isAnimation = false;
$("#namekoNum").html(++namekoNum + "本");
});
setTimeout(arguments.callee, 10);
})();