// ==UserScript==
// @namespace     http://www.yogurtearl.com/
// @name          BGGoriginal
// @description   Allows you to view the original size image without logging in.
// @description   Copyright 2007 YogurtEarl
// @version   	  0.1 
// @include       http://boardgamegeek.com/* 
// @include       http://*.boardgamegeek.com/* 
// ==/UserScript=

window.addEventListener("load", function(e) {
if (unsafeWindow.$ES){

$ES = unsafeWindow.$ES;


var orig = $ES("div#imagesizes a[href$='original']");

var picnum = String(orig).match(/\/(\d+)\?/)[1];
//debugger;
//$ES("img[src^='http://images.boardgamegeek.com/images/pic"+picnum+"']").setProperty("src", "");

var picprefix = "http://images.boardgamegeek.com/images/pic"+picnum;

orig.addEvent("click", function(e){ e.preventDefault(); $ES("img[src^='"+picprefix+"']").setProperty("src", picprefix+".jpg") } );
//orig.setProperty("href", "");
}


}, false);//.user.js

