﻿
//This will open the content editor popup
function openPopUpHTMLEditor(editorUrl, contentName, width, height) {
    window.open(editorUrl, 'ContentEditor' + contentName.replace(/-/g,''), 'border=0, toolbar=0, scrollbars=0, location=0, statusbar=0, menubar=0, resizable=0, width=' + width + 'px, height=' + height + 'px, left=' + ((screen.width - width) / 2) + ', top='+ ((screen.height - height) / 2) + '\'');
    return false;    
} 

//checks all DataGrid CheckBoxes with the given name with the given value
function CheckAllDataGridCheckBoxes(aspCheckBoxID, checkVal) {

    re = new RegExp(aspCheckBoxID)  //generated control name starts with a colon
    for(i = 0; i < document.forms[0].elements.length; i++) {
        elm = document.forms[0].elements[i]
        if (elm.type == 'checkbox') {
            if (re.test(elm.name)) {
                elm.checked = checkVal
            }
        }
    }
}
