// JScript File

String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); };

var util = {
    cacheVersion: null,
    cacheQuery: null,

    getMSIEVersion: function() {
        if (util.cacheVersion != null) return util.cacheVersion;
        msv = 0;
        if (navigator.appVersion.indexOf('MSIE') > -1) {
            msv = navigator.appVersion.substr(navigator.appVersion.indexOf('MSIE') + 5, 10);
            msv = msv.substr(0, msv.indexOf(';'));
        }
        util.cacheVersion = msv * 1;
        return util.cacheVersion;
    },

    addEvent: function(object, eventName, fn) {
        if (document.addEventListener) object.addEventListener(eventName, fn, false);
        else object.attachEvent('on' + eventName, fn);
    },

    byId: function(id) {
        return document.getElementById(id);
    },

    QueryString: function(name) {
        var result = '';
        if (util.cacheQuery == null) {
            util.cacheQuery = new Array();
            var url = document.location.href;
            if (url.indexOf('?') > -1) {
                url = url.substring(url.indexOf('?') + 1);
                queryVals = url.split(/&/);
                for (var i = 0; i < queryVals.length; i++) {
                    util.cacheQuery[i] = new Object();
                    util.cacheQuery[i].name = queryVals[i].substring(0, queryVals[i].indexOf('='))
                    util.cacheQuery[i].value = queryVals[i].substring(queryVals[i].indexOf('=') + 1)
                }
            }
        }
        for (var i = 0; i < util.cacheQuery.length; i++) {
            if (util.cacheQuery[i].name.toLowerCase().trim() == name) {
                result = util.cacheQuery[i].value;
            }
        }
        return result;
    }
}

$(window).load(function() {
    if (window == window.top) {
        $('.bordered').each(function() {
            var el = $(this), max = 0;
            el.find('div.border').each(function() {
                max = Math.max(max, $(this).height());
            });
            el.find('div.border').height(max);
        });
        $('.tombstone2 img').each(function() {
            var el = $(this);
            var h = el.height();
            var mt = Math.round((146 - h) / 2);
            el.css({ marginTop: mt });
        });
        if ($('#subMenu ul').length > 444444) {
            $('#topMenu').addClass('has-submenu');
        }
    }
});

function homeimages() {this.init();}

homeimages.prototype = {
    j: null,

    init: function () {
        this.j = $('#homeimages');
    }
}
