﻿function AdjustContentHeight(contentID, otherContentHeight) {
    var object = document.getElementById(contentID);
    var minHeight = document.documentElement.clientHeight - otherContentHeight;
    var realHeight = object.scrollHeight;
    if (minHeight > realHeight)
        object.style.height = minHeight + "px";
    else
        object.style.height = realHeight + "px";
//    alert(minHeight);
//    alert(realHeight);
//    alert(object.style.height);
}

function OnUploadDesignFile(obj) {
    var validFiles = ["zip", "rar", "pdf", "doc", "docx", "xls", "xlsx", "txt"];
    var file = document.getElementById(obj);
    var source = file.value;
    var ext = source.substring(source.lastIndexOf(".") + 1, source.length).toLowerCase();
    for (var i = 0; i < validFiles.length; i++) {
        if (validFiles[i] == ext)
            break;
    }
    if (i >= validFiles.length) {
        alert("This not a valid file upload file with an extention of one of the following:\n\n" + validFiles.join(", "));
        return false;
    }
    return true;
}

