var Blue = {
    doOnload : function(callback) {

        var before = function(){};
        if ( typeof window.onload == "function" ) before = window.onload;

        window.onload = function() {
            before();
            callback();
        }
    }
};

Blue.Site = function() {

    this.type           = function() { throw("type needs overload"); };
    this.processFilters = function() { throw("processFilters needs overload"); };
    
    this.getSite = function() {
        return ( window.location.toString().match(/wp-admin/) )
            ? new Blue.Site.Admin()
            : new Blue.Site.Main();
    }

    this.addFooterContent = function() {
        var footer = $('div#footer');
        footer     = ( footer && footer.html() ) ? footer : $('div.footer');
        footer     = ( footer && footer.html() ) ? footer : $('div#footer-bottom');
        footer     = ( footer && footer.html() ) ? footer : $('div.Footer-text');
        footer     = ( footer && footer.html() ) ? footer : $('div#footer-content');
        footer     = ( footer && footer.html() ) ? footer : $('div#footer');

        footer
            .html('')
            .append(
                $('<span></span>')
                    .text("Powered by ")
                    .append(
                        $('<a></a>')
                            .attr( 'href', 'http://bluecorral.com' )
                            .text( 'Blue Corral' )
                    )
                    .append(
                        $('<span></span>')
                            .html( ' &copy; ' + ( new Date() ).getFullYear() )
                    )
            )
        ;
    };
};

