﻿function TagChanges() {
    alert("If you have already entered scores, they will be recalculated now");
}
function ClearAll(tagName, control) {
    if (control.checked) {
        var inputAll = document.getElementsByTagName("INPUT");
        for (x = 0; x < inputAll.length; x++) {
            if (inputAll[x].id.substring(inputAll[x].id.length - tagName.length) == tagName) {
                inputAll[x].checked = false;
            }
        }
        control.checked = false;
    }
}
function CheckAll(tagName, control) {
    if (control.checked) {
        var inputAll = document.getElementsByTagName("INPUT");
        for (x = 0; x < inputAll.length; x++) {
            if (inputAll[x].id.substring(inputAll[x].id.length - tagName.length) == tagName) {
                inputAll[x].checked = true;
            }
        }
        control.checked = false;
    }
}
function CheckImageSize(maxWidth, maxHeight, attr) {
    var timer = window.setTimeout("CheckImageSize('" + maxWidth + "', '" + maxHeight + "', '" + attr + "')", 500);
    try {
        var allimages = document.getElementsByTagName("IMG");
        var counter = 0;

        for (x = 0; x < allimages.length; x++) {
            if (allimages[x].getAttribute(attr) == "true") {
                counter++;
                thisImage = allimages[x];
                if (thisImage.complete) {
                    if (thisImage.height != 0) {
                        thisImage.setAttribute(attr, "false");
                        if (maxWidth != -1) {
                            if (thisImage.width > maxWidth) {
                                Ratio = thisImage.width / maxWidth;
                                HeightF = thisImage.height / Ratio;
                                thisImage.height = Math.round(HeightF);
                                thisImage.width = maxWidth;
                            }
                        }
                        if (maxHeight != -1) {
                            if (thisImage.height > maxHeight) {
                                Ratio = thisImage.height / maxHeight;
                                WidthF = thisImage.width / Ratio;
                                thisImage.width = Math.round(WidthF);
                                thisImage.height = maxHeight;
                            }
                        }
                        counter--;
                    }
                }
            }
        }
        if (counter == 0) {
            window.clearTimeout(timer);
            timer = null;
        }
    }
    catch (e) {
    }
}
