﻿function setWindowSize() {

    var bW, bH, sW, sH;
    
    // Get Browser Window Dimensions
    if (self.innerWidth) {
        bW = self.innerWidth;
        bH = self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientWidth) {
        bW = document.documentElement.clientWidth;
        bH = document.documentElement.clientHeight;
    }
    else if (document.body) {
        bW = document.body.clientWidth;
        bH = document.body.clientHeight;
    }

    // Get Screen Dimensions
    sW = screen.availWidth;
    sH = screen.availHeight;

    // Resize Window
    if (bW < sW && bW < 1600) {
        window.moveTo(0, 0);
        window.resizeTo(sW, sH);
    } else if (bH < (sH * 0.75) && bH < 800) {
        window.moveTo(0, 0);
        window.resizeTo(sW, sH);
    }
}