﻿function LaunchQuickAdd(ctl) {
    var theElement = document.getElementById(ctl.id);
    var strRedirect = ExtractAttribute(theElement.attributes, 'redirecturl');
    // var strTarget = ExtractAttribute(theElement.attributes, 'controltoupdate');
    var strDFKA = ExtractAttribute(theElement.attributes, 'fieldvalue');
    strRedirect += "?Target=" + ctl.id + "&DFKA=" + strDFKA;
    var oWnd = window.open(strRedirect, "_blank", "width=900, height=700, resizable, scrollbars, modal=yes");
    // oWnd.setUrl(strRedirect);
}
function ExtractAttribute(attribs, attrib) {
    // extract redirecturl from the attributes
    var strResult;
    for (var x = 0; x < attribs.length; x++) {
        if (attribs[x].nodeName.toLowerCase() == attrib) {
            strResult = attribs[x].nodeValue;
        }
    }
    return strResult;
}
function GetRadWindow() {
    var oWindow = null;
    if (window.radWindow)
        oWindow = window.radWindow;
    else if (window.frameElement.radWindow)
        oWindow = window.frameElement.radWindow;
    return oWindow;
}    