if (self != top) {
    top.location.href = self.location.href
}

$(document).ready(function () {

    function imageOut () {
        var img = $(this);
        var src = img.data("src");
        if (src) {
            this.src = src;
            img.removeData("src");
        }
    }

    $("DIV#header LI IMG").hover(
        function () { // in
            var img = $(this);
            switch (img.attr("id")) {
                case "mi1":
                    if (mi1.complete) {
                        img.data("src", this.src);
                        this.src = mi1.src;
                    }
                    break;
                case "mi2":
                    if (mi2.complete) {
                        img.data("src", this.src);
                        this.src = mi2.src;
                    }
                    break;
                case "mi3":
                    if (mi3.complete) {
                        img.data("src", this.src);
                        this.src = mi3.src;
                    }
                    break;
                case "mi4":
                    if (mi4.complete) {
                        img.data("src", this.src);
                        this.src = mi4.src;
                    }
                    break;
                case "mi5":
                    if (mi5.complete) {
                        img.data("src", this.src);
                        this.src = mi5.src;
                    }
                    break;
                case "mi6":
                    if (mi6.complete) {
                        img.data("src", this.src);
                        this.src = mi6.src;
                    }
                    break;
            }
        },
        imageOut
    );

    var images = {};
    var menuImages = $("#doc A IMG, #customer A IMG");

    $.each(menuImages, function () {
        if (this.src.match('_on.jpg')) {
            images[this.src]        = false;
        } else {
            images[this.src]        = new Image();
            images[this.src].src    = this.src.replace('.jpg', '_on.jpg');
        }
    });

    var content = $("#content");
    content.prepend($("H1").detach());
    content.find("H1").css("font-size", "20px");
    content.find("> H2").css("font-size", "14px");
    
    menuImages.hover(
        function () { // in
            if (images[this.src] && images[this.src].complete) {
                $(this).data("src", this.src);
                this.src = images[this.src].src;
            }
        },
        imageOut
    );

});
