if(!dojo._hasResource["yug.atl"]){
dojo._hasResource["yug.atl"] = true;
dojo.provide("yug.atl");
if(typeof atl == "undefined"){

function _loadCss(css /*String(ref)*/){
    var node=dojo.doc.createElement("link");
    node = dojo.place(node,dojo.doc.getElementsByTagName("head")[0],"first");
    node.setAttribute("rel","stylesheet");
    node.setAttribute("media","screen");
    node.setAttribute("type","text/css");
    node.setAttribute("href",css);
}

(function(){
       if(typeof this["atl"] == "undefined"){this.atl = {_scopeName:"atr"};}
        //init main-container #container-content
        atl._init = function(e) {
            dojo.require("dojo.parser");
            dojo.requireLocalization("dojo.cldr","gregorian",null,"ROOT,ru");
            var nd = dojo.byId("search");
            if ( nd ){
                dojo.registerModulePath("realty", "/resources/js/realty");
                dojo.require("realty.SimpleSearch");
                atl.ss = new realty.SimpleSearch(nd);
            }
            nd = dojo.byId("rltObjs");
            if (nd) {
                 _loadCss("/js/dojox/image/resources/image.css");
                dojo.require("dijit.layout.ContentPane");
                dojo.require("dojox.image.Lightbox");
                var ref = "/watl/exinf.htm";
                if (dojo.attr(nd,"excl"))
                    ref += "?excl=1";
                else if (dojo.attr(nd,"hot"))
                    ref += "?hot=1";
                var cp = new dijit.layout.ContentPane({
                    region:"center",style:"height:auto;",
                    parseOnLoad:true,async:false,
                    /*href:ref,*/
                    preventCache:false,
                    loadingMessage:"<span class='dijitContentPaneLoading'>Загрузка списка объектов...</span>"
                },nd);
                cp.startup();
            }
            nd = dojo.byId("rltObj");
            if (nd) {
                 _loadCss("/js/dojox/image/resources/image.css");
                dojo.require("dijit.layout.ContentPane");
                dojo.require("dojox.image.Lightbox");
                var cp = new dijit.layout.ContentPane({region:"center",style:"height:auto;",parseOnLoad:true,/*href:"/watl/objInf.jsp?id="+dojo.attr(nd,"obj"),*/async:false},nd);
                cp.startup();
            }
            dojo.query("form[action='/search/']").forEach(function(frm){
                console.debug('realty.ContentSearch');
                dojo.require("realty.ContentSearch");
                var ff = new realty.ContentSearch(frm);
            });
        };
        dojo.addOnLoad(atl._init);
        atl.bookmark = function(e){
            var url = window.document.location;
            var title = window.document.title;
            if (dojo.isIE) {window.external.AddFavorite(url,title);}
            else if (dojo.isOpera) {
            e.href = url;
            e.rel = "sidebar";
            e.title = url+','+title;
            return true;
            } else if (dojo.isFF) {
                window.sidebar.addPanel(title,url,"");
            }
            else window.alert("Нажмите CTRL+D для добавления страницы в Избранное");
            return false;
        };
})();           //(function() (1)
}   //if(typeof regis == "undefined")

}   //if(!dojo._hasResource["yug.atl"])
