// fittoscreen.class.js
// copyright by Werner Rudolph <artistoex@yahoo.com>
point = function (x,y){
    this.x = x;
    this.y = y;
}

area = function (p1,p2){
    this.p1 = p1;
    this.p2 = p2;
}


fittingarea = function(maxx, maxy){
    this.x =0;
    this.y =0;
    switch (getbrowser()){
        case IE4:
            this.x = document.body.offsetWidth-5;
            this.y = document.body.offsetHeight-5;
        break;
        case Netscape4:
        case Netscape6:
            this.x = window.innerWidth;
            this.y = window.innerHeight;
        break;
        default:
            this.x = 760;
            this.y = 780;
    }
    this.x = ((this.x < maxx)?this.x:maxx);
    this.y = ((this.y < maxy)?this.y:maxy);
    return this;
}

fit_css = function(css, area, border){
    width = area.x - css.x;
    height = area.y - css.y;
    var r = 0;
    if (getbrowser() != Netscape4){
        if (getbrowser()==Netscape6)
            r = 2*border;
        css.resize(width-r,height-r);
    }
}