// ==UserScript==
// @name        ldr_keyhack_rate
// @namespace	http://yoshiori.org/blog/
// @include     http://reader.livedoor.com/reader/*
// @version     1.0
// ==/UserScript==

(function(){
	var w = unsafeWindow;
	var _onload = w.onload;

	var onload = function(){with(w){
		function _set_rate(rate){
			var el = document.getElementById("rate_img");
			if(-1 < el.src.indexOf(rate+".gif")){
				return;
			}
			var sid = el.getAttribute("sid");
			set_rate(sid,rate)
			el.src = Rate.image_path_p + rate + ".gif";
			el.setAttribute("orig_src",el.src);
		}
		Keybind.add("0",function(){_set_rate("0")});
		Keybind.add("1",function(){_set_rate("1")});
		Keybind.add("2",function(){_set_rate("2")});
		Keybind.add("3",function(){_set_rate("3")});
		Keybind.add("4",function(){_set_rate("4")});
		Keybind.add("5",function(){_set_rate("5")});
	}}

	w.onload = function(){
		_onload();
		onload();
	}
})();

