<script type="text/javascript"> (function () { var t = document.getElementsByTagName; // Test the abilities of // getElementsByTagName if (t('*').length) { // Correct support document.getElementsByRegexId = function (r) { var e = t('*'), a = [], l = 0, i; for (i in e) { if (e[i].id && e[i].id.match(r)) { a[l++] = e[i]; } } return a; } } else if (t = document.all) { // Old IEs document.getElementsByRegexId = function (r) { var a = [], l = 0, i; for (i in t) { if (t[i].id && t[i].id.match(r)) { a[l++] = t[i]; } } return a; } } else { // Unsupported document.getElementsByRegexId = function () { // Avoid errors return []; } } })();</script>