﻿function toggleEnabled (chk, txt) {
    txt.disabled = chk.checked;
}

function toggleDivEnabled(targetDivID, chk) {
	var targetDiv = document.getElementById(targetDivID);
	if (targetDiv != null) {
	    targetDiv.disabled = !chk.checked;
    }    
}

function toggleDiv(targetDivID, chk) {
	
	var targetDiv = document.getElementById(targetDivID);
	if (!chk.checked) {
        targetDiv.style.display = 'none';
    } else {
        targetDiv.style.display = '';
    }
}

function modalPopup(url, w, h) {
    if (w == null) w = 400;
    if (h == null) h = 100;
    var args = null;
    var features = 'status:no;dialogWidth:' + w + 'px;dialogHeight:' + h + 'px;dialogHide:true;help:no;scroll:no';
    return window.showModalDialog(url, args, features);
}

