    Function.prototype.andThen = function(g) {
        var f = this;
        if (typeof(g) != 'function') {
            return this;
        }
        return function() {f();g();}
    }

var oImageClick = null;
    function prepareImage(oImage) {
    if (oImage.src1) {
        o = oImage.img1 = new Image();
        o.src = oImage.src1;
    }
    if (oImage.src2) {
        o = oImage.img2 = new Image();
        o.src = oImage.src2;
    }
    if (oImage.src3) {
        o = oImage.img3 = new Image();
        o.src = oImage.src3;
    }
    oImage.bPrepared = true;
    }
    function overImage(oImage) {
    if (oImage != oImageClick) {
        oImage.src = oImage.src2;
    }
    }
    function outImage(oImage) {
    if (oImage != oImageClick)
        oImage.src = oImage.src1;
    }
    function clickImage(oImage) {
    if (oImageClick != null) {
        oImageClick.src = oImageClick.src1;
    }
        oImage.src = (oImage.src3 == "" ? oImage.src2 : oImage.src3);
        oImageClick = oImage;
    }

    function wStatus(txt) {
        txt = (arguments.length > 0 ? arguments[0] : "")
        window.status = txt;
    }
    function openPrintWindow(ThisUrl) {
        window.open(ThisUrl,'PrintThisPage','left=10,top=10,width=700,height=500,location=0,toolbar=1,menubar=1,status=1,scrollbars=1')
    }

    function showImage(sFilename,nHeight,nWidth) {
        var sFeatures = 'width=' + Math.min(nWidth, screen.width) + ',height=' + Math.min(nHeight, screen.height) +',resizable=1';
        window.open(sFilename, '_blank', sFeatures);
    }  




