/**
 * this files creates the base namespace for all core starwood
 * code -"sw". In addtion, shortcuts are created into the YAHOO.util for ease of coding.
 * @author Danlan
 */

if(YAHOO.util){
    /**
     * create shortcuts into YAHOO lib, allows for easer coding/readability.
     * some of the shortcuts: yuiDom, yuiEvent, yuiAnim, yuiEasing...
     * Same as var yuiDom = YAHOO.util.Dom;
     */
    for(var prop in YAHOO.util){
        window["yui"+ prop] = YAHOO.util[prop];
    }
    if(YAHOO.lang.JSON){
        yuiJSON = YAHOO.lang.JSON;
    }
    // workaround for yui bug introduced in 2.4.0 causing onDOMReady to fire prematurely in iframe for IE
    // bug tracker request id: 2008289
    if(yuiEvent){
        try {
            document.createElement("p").doScroll("left");
            // only get here if (IS IE and IS IFRAME)  - it may be possible that another condition gets here, but that's ok
            yuiEvent.onDOMReady = function( p_fn , p_obj , p_scope ){
                yuiEvent.addListener( window , "load" , p_fn , p_obj , p_scope);
            }
        } catch (err) {
            // all other conditions throw an error, which is good.
        }
    }
    // end workaround
}
/**
 * create the base "sw" namespace for all core starwood code.
 */
var SW = YAHOO.namespace("SW");

YAHOO.namespace("SW.tools"); // general utility objects and methods
YAHOO.namespace("SW.customEvent"); // custom event models
YAHOO.namespace("SW.widget"); // larger components
YAHOO.namespace("SW.domWidget"); // built in dom scrubbing to gain hooks widgets
YAHOO.namespace("SW.widget.virtualEarth"); // virtualEarth components
YAHOO.namespace("SW.flash"); // adaptors for Flash. When Flash needs to call JS, it uses this namespace. Local flash code should prefix component name with brand (ie SW.flash.SPGTour)
YAHOO.namespace("SW.local"); // namespace for any non-common code. All brand/page specific code resides here
YAHOO.namespace("SW.maps");//namespace for map related JS


