﻿function toggleDisplay(thisObject) {
    // v3.1 05/11/2007 - Jay Hayman
    var isHidden = document.getElementById(thisObject).style.display;

    switch (isHidden) {
        case "none":
            document.getElementById(thisObject).style.display = "block";
            break;
        case "block":
            document.getElementById(thisObject).style.display = "none";
            break;
    }
}

function toggleProgress(thisHide, thisShow) {
    document.getElementById(thisHide).style.display = "none";
    document.getElementById(thisShow).style.display = "block";
}

function toggleProgressNoHide(thisShow) {
    document.getElementById(thisShow).style.display = "block";
}

function clearTextBox(thisObject) {
    // v1.0 06/11/2007 - Jay Hayman
    document.getElementById(thisObject).value = "";
}

function CheckAll(checkAllBox, thisObject) {
    // v1.0 08/02/2008 - Jay Hayman
    // Toggle all checkboxes (.net object).

    var frm = document.forms[0]
    var actVar = checkAllBox.checked;
    for (i = 0; i < frm.length; i++) {
        e = frm.elements[i];
        if (e.type == 'checkbox' && e.name.indexOf(thisObject) != -1)
            e.checked = actVar;
    }
}

// preload the images 
function preload() {
    var tmp = null;
    
    try {
        for (var j = 0; j < imgs.length; j++) {
            tmp = imgs[j];
            imgs[j] = new Image();
            imgs[j].src = tmp;
        }
    } catch (e) {
        // nothing 
    }
}
void (preload());

// swap images 
function imgSwap(img, swap) {
    img.src = imgs[swap].src;
}

function popupImage(strImage, strTitle) {
    myWindow = window.open("/wiscmsToolkit/functions/popupresize.aspx?image=" + strImage + '&title=' + strTitle, "popupImage", 'alwaysRaised=yes,innerHeight=496,innerWidth=656,location=no,menubar=no,resizable=yes,status=no,titlebar=no')
}