function resize(app, width, height, pop, url) {
    var border_w = 100;
    var border_h = 180;
    if (app != null && app == "flash" && pop == null) 
    {
        window.resizeTo(width + border_w, height + border_h);
    }
    else 
        if (app != null && app == "pic") 
        {
            var v = document.images[0].width;
            var h = document.images[0].height;
            if(pop == null) 
            {
                url = decodeURIComponent(url) + "&pop=1";
                if(v > 900) 
                {
                    h = h + border_h;
                    window.resizeTo(0,0);
                    window.open(url ,'','scrollbars=yes,height=' + h + ',width=800');
                    window.close();
                }
                else 
                {
                    h = h + border_h;
                    v = v + border_w;
                    window.resizeTo(0,0);
                    window.open(url , '','scrollbars=no,height=' + h + ',width=' + v);
                    window.close();
                }
            }
        }
        else 
            if (app != null && app == "spin" && pop == null)
            {
                window.resizeTo( 355 + border_w, 190 + border_h );
            }
}