// ==UserScript==
// @name minitokyo.net - Direct linker
// @author Apocalypse 
// @namespace http://userjs.org/ 
// @version 1.0
// @description  A script that bypasses the preview page of the
//			minitokyo gallery containing anime and CG art
//			and wallpapers. It opens images directly
//			without lowering download quota. 
// @ujs:category site: enhancements
// @ujs:published 2006-01-07 21:51
// @ujs:modified 2006-01-31 11:44
// @ujs:documentation http://userjs.org/scripts/site/enhancements/minitokyo-net-directlinker 
// @ujs:download http://userjs.org/scripts/download/site/enhancements/minitokyo-net-directlinker.js 
// @include http://www.minitokyo.net/*
// @include http://download.minitokyo.net/*
// @include http://browse.minitokyo.net/*
// ==/UserScript==


/* 
 * /* This script is granted to the public domain */
 */

/*  Based on GreyWyvern's Google Image frame bypasser
 *	Copyright 2005 (c) GreyWyvern (AKA Orca)
 *  Licenced under the BSD Licence
 *  http://www.greywyvern.com/code/bsd.txt
*/
  document.addEventListener("load",
    function(ev) {
      var alnk = document.getElementsByTagName("a");
      for (var x = alnk.length - 1; x >= 0; x--) {
      	alnk[x].href = unescape(alnk[x].href.replace("gallery.minitokyo.net/view/","download.minitokyo.net/MiniTokyo_")),
				alnk[x].href = unescape(alnk[x].href.concat(".jpg")),
      	alnk[x].href = unescape(alnk[x].href.replace("/.jpg",".jpg"))
      	}}, false);
