﻿// JScript File

    var to;
    var e;
    var tp;
    var lf;
    var wd;
    var ht;
    var oright = 0
    var origwd = 0
    var step = 0;
    var steps = 30;
    function Expand(img,pic,w,h,t,l){
        e = document.getElementById('imgExpand');
        e.src = pic;
        oright = 0;
        origwd = 0;
        tp = t;
        lf = l;
        wd = w;
        ht = h;
        e.style.zIndex = "700";
        e.style.display = "block";
        doExpand();
    }
    
    function doExpand(){
        step++;
        if (step > steps) {
            step = 0;
            clearTimeout(to);
            return;
        }
        e.style.width = origwd + ((wd-origwd) * step / steps) + "px";
        e.style.height = oright + ((ht-oright) * step / steps) + "px";
        e.style.top = (tp - ((tp - 55) * step / steps) ) + "px";
        e.style.left = (lf - ((lf - 300) * step / steps) ) + "px";

        to = setTimeout("doExpand()", 5);
    }
    
    function Collapse(img,t,l,w,h){
        clearTimeout(to);
        step = 0;
        img.style.top = t + "px";
        img.style.left = l + "px";
        img.style.width = w + "px";
        img.style.height = h + "px";
        img.style.zIndex = "-1";
        img.style.display = "none";
    }

