﻿function IncludeJavaScript(jsFile) {
    document.write('<script type="text/javascript" src="' + jsFile + '"></scr' + 'ipt>');
}

function isArray(testObject) {
    return testObject &&
           testObject.propertyIsEnumerable &&
           !(testObject.propertyIsEnumerable('length')) &&
           typeof testObject === 'object' &&
           typeof testObject.length === 'number';
}

function appendToWindowOnLoad(o) {
    var oldOnLoad = window.onload;
    window.onload = function() {
        if (oldOnLoad) { oldOnLoad(); }
        o();
    }
}

/* getStyle(ctrl, 'height') */
function getStyle(element, cssRule) {
    var strValue = "";
    if (document.defaultView && document.defaultView.getComputedStyle) {
        strValue = document.defaultView.getComputedStyle(element, "").getPropertyValue(cssRule);
    }
    else if (element.currentStyle) {
        cssRule = cssRule.replace(/\-(\w)/g, function(strMatch, p1) {
            return p1.toUpperCase();
        });
        strValue = element.currentStyle[cssRule];
    }
    return strValue;
}
