﻿function openBrWindow(theURL, winName, features) { 
    var popup = window.open(theURL, winName, features);
    popup.focus();
}

function openRecording(id,lid) {
    openBrWindow('/Utilities/Recording.aspx?id=' + id + "&lid=" + lid, '', 'scrollbars=yes,resizable=yes,width=1000,height=800,left=50,top=50');
}

function trim(text) {
    return text.replace(/^\s+|\s+$/g, '');
}

function toUrlParameter(text) {
    var param = trim(text);
    return escape(param);
}

function toggleElement(obj, img) {
    var el = document.getElementById(obj);
    var im = document.getElementById(img);
    if (null != el && el != "undefined") {
        if (el.style.display != 'none') {
            el.style.display = 'none';
            if (null != im && im != "undefined") {
                im.src = "/_images/collapsed.png";
             }
        }
        else {
            el.style.display = '';
            if (null != im && im != "undefined") {
                im.src = "/_images/expanded.png";
            }
        }
    }
    
}