Ну начнём с того, что верстльщик п*здоглазое м*дило.
function getElementsById( id, tag ){
var els = document.getElementsByTagName( tag || '*' ), i = els.length, result = [];
while( i-- ) if( els[i].id === id) result.unshift( els[i] );
return result
}