// summary: like it sounds
// description: search agx.currentPage initializer for ag, 
//      bulk of logic is in the SearchPage controller and its parent 
//      class, ResultsPage.

if(!dojo.exists("products")){products=[];}
//waits for required layers, then requires the agx.currentPage resource, which 
//in turn calls the generated javascript on the pd
agx.currentPage.waiter = agx.wait_for_events(
    ["/ag.layers.core/loaded/", "/ag.layers.ext/loaded/"], 
    function(){
        dojo.require("ag.pages.ecards.search");
        if(agx.currentPage.pdCallback){
            try{
                agx.currentPage.pdCallback();
            }catch(e){
                console.warn(this + ".pdCallback() failed");
            }
        }
    }
);
