function tDeleteOpen() {
    var sure = confirm('One or more of the selected tests are still available to students.  Are you sure you want to delete these test(s) permanently?')
    if (sure) { } else {
        return false;
    }
}
function tDeleteClosed() {
    var sure = confirm('Deleting tests is not reversible.  Are you sure you want to delete these test(s) permanently?')
    if (sure) { } else {
        return false;
    }
}
function qDelete() {
	var sure = confirm('Are you sure you want to delete this question?')
	if (sure) { } else {
		return false;
	}
}
function qEdit() {
    var sure = confirm('If you wish to edit this question for this particular test, click OK.  Otherwise, click Cancel to exit.')
	if (sure) { } else {
		return false;
	}
}
function qSave() {
	var sure = confirm('If you wish to edit this question for this particular test, click OK.  Otherwise, click Cancel to exit.')
	if (sure) { } else {
		return "return false";
	}
}
function confirmQuestionRemove() {
    var sure = confirm('Do you wish to remove these question(s) from the test?')
    if (sure) { } else {
        return "return false";
    }
}
function affirmGrade() {
    return confirm("Are you sure you're ready to grade this test?");
}
function highlight(control) {
	control.style.backgroundColor='#DEE9FC';
}
function CheckPageLoad(controlID) {
	var controlObject = document.getElementById(controlID);
	if (controlObject == null) {
		return false;
	}
}
function popupWin(URL) {
	window.open(URL, "help", 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=300,height=300,left=590,top=462');
}
function textboxMultilineMaxLength(txt,maxLen){
    try{
        if(txt.value.length > (maxLen-1)) {
            alert('Your answer must be less than ' + maxLen + ' characters.');
            return false;
        }
    }catch(e){
    }
}
function textboxMultilineMaxLengthPasteWorkaround(txt,maxLen){
    try{
        if(txt.value.length > (maxLen)) {
            txt.value = txt.value.substr(0, maxLen);
            alert('An answer to one of your essay questions was shortened to be less than ' + maxLen + ' characters.');
            return false;
        }
    }catch(e){
    }
}