User:Duckinator/imagepreview.js

onload=function{ if (document.getElementsByClassName == undefined) { document.getElementsByClassName = function(className) {   var hasClassName = new RegExp("(?:^|\\s)" + className + "(?:$|\\s)"); var allElements = document.getElementsByTagName("*"); var results = [];

var element; for (var i = 0; (element = allElements[i]) != null; i++) { var elementClass = element.className; if (elementClass &&         elementClass.indexOf(className) != -1 &&          hasClassName.test(elementClass)) results.push(element); }   return results; } } }

function $(id) { return document.getElementById(id); }

function $t(tag) { return document.getElementsByTagName(tag); }

function $c(class) { return document.getElementsByClassName(class); }