// DeviantART - FullViewer v0.3.1
// Made By Luke Stevenson {http://lucanos.deviantart.com/}
// Distributed and Maintained via GMVC
// Last updated: 05 November 2005
//
//   This script modifies all links to "*/deviation/*" pages to point to
// the corresponding "*/view/*" page.  This means the links jump straight
// to Full View as opposed to going through the Standard View page first.
//
// ==UserScript==
// @name              DeviantART - FullViewer
// @namespace         http://gmvc.lucanos.com/
// @description       (v0.3.1) Makes all links which refer to "*/deviation/*" refer to "*/view/*".
// @include           http://deviouslyartistic.com*
// @include           http://deviantart.com*
// @include           http://*.deviantart.com*
// ==/UserScript==

(function () {

	var viewRegExp = /http\:\/\/www\.deviantart\.com\/deviation\/([0-9]{1,})\/$/ig;
	var outRegExp  = /\<img\ssrc=\"http:\/\/i\.deviantart\.com\/icons\/deviation\/view\.gif\"\salt=\"\"\/\>\sZoom\sOut$/ig;

	for ( a = 0 ; a < document.links.length ; a++ ) {
		var devLink = viewRegExp.exec(document.links[a].href);
		var zoomOut = outRegExp.test(document.links[a].innerHTML)
		if ( devLink && !zoomOut ) {
			document.links[a].href = "http://www.deviantart.com/view/"+devLink[1];
		}
	}

})();