function show(url, w, h, s, n) {
        if (!n) n = 'vw'
        attr = 'width=' + w + ',height=' + h + ',location=0,menubar=0,resizable=0,scrollbars=' + s + ',status=0,titlebar=0,toolbar=0,hotkeys=0'
        if (parseInt(navigator.appVersion) >= 4) {
                x = (screen.width - w) / 2
                y = (screen.height - h) / 2
                if(x < 0) x = 0
                if(y < 0) y = 0
                attr += ',xposition=' + x + ',left=' + x + ',yposition=' + y + ',top=' + y
        }
        window.open(url, n, attr)
}

function zoom(u) { show('/item.html?' + u, 500, 500, 0); return false; }
function newzoom(u,a) { show('/newitem.html?pic=' + u + '&al=' + a, 500, 500, 0); return false; }
function freecall() { show('/freecall.html', 300, 320, 0); return false; }

//-------------------------------------------------------------------------------------

if (!Array.prototype.push) {
        Array.prototype.push = function() {
                var startLength = this.length
                for (var i = 0; i < arguments.length; i++) this[startLength + i] = arguments[i]
                return this.length
        }
}

function $(elementId) {
        return document.getElementById(elementId)
}

function getElementsByClassName(className, children) {
        var children = children || document.getElementsByTagName('*')
        var elements = new Array()
        for (var i = 0; i < children.length; i++) {
                var child = children[i]
                var classNames = child.className.split(' ');
                for (var j = 0; j < classNames.length; j++) {
                        if (classNames[j] == className) {
                                elements.push(child);
                                break;
                        }
                }
        }
        return elements
}
