/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 */

/**
 * DDJS.js
 *
 * File Path: /scripts/
 *
 * $Id: DDJS.js 174 2007-08-26 20:38:27Z topdog $
 *
 * LICENSE: copyright 2005 - 2007 Edward Vermillion - Doggydoo Codeworks.
 * Unless otherwise stated ALL RIGHTS ARE RESERVED. Use or reuse without prior
 * written permission from the author or Doggydoo Codeworks is prohibited.
 * Visit http://www.doggydoo.net/license/DDJS-V1.X.txt for the full license.
 * Installation and use of this software implies agreement to the full
 * license.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL DOGGYDOO
 * CODEWORKS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 * @package     DDJS
 * @author      Edward Vermillion <evermillion@doggydoo.net>
 * @copyright   2005 - 2007 Edward Vermillion, Doggydoo Codeworks
 * @license     http://www.doggydoo.net/license/DDJS-1.x.txt
 * @version     1.0
 */

/**
 * @namespace DDJS
 *
 * This is the namespace container for DDJS
 */
var DDJS = {

    /**
     * @property baseURL
     *
     * The root directory for the library
     * @type {String}
     */
    baseURL: '',

    /**
     * @property siteURL
     *
     * The root directory for the website
     * @type {String}
     */
    siteURL: '',

    /**
     * @property isIE
     *
     * Are we dealing with Internet Explorer
     * @type {Boolean}
     */
    isIE: false,
    
    /**
     * @property initCache
     *
     * Array of subordinate objects that require initialization after the page
     * has loaded.
     * 
     * @type {Array}
     */
    initCache: new Array(),

    /**
     * @method addInit
     *
     * Adds an object to the initCache array
     *
     * @param {Object} obj
     * @return void
     */
    addInit: function (obj) {
        this.initCache.push(obj);
    },

    /**
     * @method initSubs
     *
     * Initializes objects in the initCache array
     *
     * @return void
     */
    initSubs: function () {
        var n = this.initCache.length;
        var i;

        if (n > 0) {
            for (i=0; i < n; i++) {
                this.initCache[i].init();
            }
        }
    },
    
    /**
     * @method loadPage
     *
     * This method is used to do any necessary page initializations and should
     * be called after the body has loaded.
     *
     * @return void
     */
    loadPage: function () {

        // Load the configuration init first...
        if (typeof DDJS.Config != 'undefined') {
            DDJS.Config.init();
        }
        
        this.initSubs();

    },

    /**
     * @method toString
     *
     * @return {String}
     */
    toString: function () {
        return '[Object] DDJS';
    }

}; // End Class DDJS

if (!window.getComputedStyle) {	
	window.getComputedStyle = function (elem, psudoElem) {
		if (document.defaultView && document.defaultView.getComputedStyle) {
			return document.defaultView.getComputedStyle(elem, psudoElem);
		} else if (elem.currentStyle) {
			return elem.currentStyle;
		} else if (elem.style){
			return elem.style;
		} else {
			return null;
		}
	};
}




