﻿// ----------------------------------------------------------------------------------------------------
String.prototype.trim = function() {
    return this.replace(/^\s+|\s+$/g, "");
}
// ----------------------------------------------------------------------------------------------------
function openWindow(theURL) {
    window.open(theURL, 'IMSOnlineQuote', 'status=yes,scrollbars=yes,width=780,height= 770', 'rentguard', 'status=yes,scrollbars=yes,width=780,height= 750)');
}
// ----------------------------------------------------------------------------------------------------
function getElementById(tagName) {
    if (document.getElementById) {
        // Level 1 DOM code - Supported by: Mozilla, Explorer 5+, Opera 5+, Konqueror, Safari, iCab, Ice, OmniWeb 4.5
        if (document.getElementById(tagName) != null)
            return document.getElementById(tagName);
        else if (document.getElementById('ctl00$ContentPlaceHolder2$' + tagName) != null)
            return document.getElementById('ctl00$ContentPlaceHolder2$' + tagName);
        else if (document.getElementById('ctl00_ContentPlaceHolder2_' + tagName) != null)
            return document.getElementById('ctl00_ContentPlaceHolder2_' + tagName);
        else if (document.getElementById('ctl00_' + tagName) != null)
            return document.getElementById('ctl00_' + tagName);
    }
    else if (document.all) {
        // Microsoft DOM code - Supported by: Explorer 4+, Opera 6+, iCab, Ice, Omniweb 4.2-
        if (document.all[tagName] != null)
            return document.all[tagName];
        else if (document.all['ctl00$ContentPlaceHolder2$' + tagName] != null)
            return document.all['ctl00$ContentPlaceHolder2$' + tagName];
        else if (document.all['ctl00_ContentPlaceHolder2_' + tagName] != null)
            return document.all['ctl00_ContentPlaceHolder2_' + tagName];
        else if (document.all['ctl00_' + tagName] != null)
            return document.all['ctl00_' + tagName];
    }
    else if (document.layers) {
        // Netscape DOM code - Supported by: Netscape 4, Ice, Escape, Omniweb 4.2-
        if (document.layers[tagName] != null)
            return document.layers[tagName];
        else if (document.layers['ctl01$PageContent$' + tagName] != null)
            return document.layers['ctl01$PageContent$' + tagName];
        else if (document.layers['ctl01_PageContent_' + tagName] != null)
            return document.layers['ctl01_PageContent_' + tagName];
        else if (document.layers['ctl01_' + tagName] != null)
            return document.layers['ctl01_' + tagName];
    }
}