﻿function swap(id, path) {
    var d = document;
    d.getElementById(id).src = path;
}

function setFrames() {
    setSalesFrame();
    setSalvageFrame();
}

function setSalesFrame() {
    document.getElementById('salesinventory').height = getWindowHeight() + 100;
    document.getElementById('salesinventory').width = getWindowWidth() - 210;
}

function setSalvageFrame() {
    document.getElementById('salvageinventory').height = getWindowHeight() + 100;
    document.getElementById('salvageinventory').width = getWindowWidth() - 250;
}

function getWindowHeight() {
    var windowHeight = 0;
    if (typeof (window.innerHeight) == 'number') {
        windowHeight = window.innerHeight;
    } else {
        if (document.documentElement && document.documentElement.clientHeight) {
            windowHeight = document.documentElement.clientHeight;
        } else {
            if (document.body && document.body.clientHeight) {
                windowHeight = document.body.clientHeight;
            }
        }
    }
    return windowHeight;
}

function getWindowWidth() {
    var WindowWidth = 0;
    if (typeof (window.innerWidth) == 'number') {
        WindowWidth = window.innerWidth;
    } else {
        if (document.documentElement && document.documentElement.clientWidth) {
            WindowWidth = document.documentElement.clientWidth;
        } else {
            if (document.body && document.body.clientWidth) {
                WindowWidth = document.body.clientWidth;
            }
        }
    }
    return WindowWidth;
}
