DRHorton.community = DRHorton.community || {};

DRHorton.community.Godzilla = {
    
    // find this elements 
    getContentObject : function(jqElement){
        var classDef = DRHorton.community.Godzilla.getContentClassDef(jqElement);        
        return new classDef(jqElement);
    },
    
    getContentClassDef : function(jqElement) {
        var classDef = DRHorton.community.content.Content;
        if(typeof jqElement.attr("data-community-content-class") != "undefined"){
            if(this.contentClassExists(jqElement.attr("data-community-content-class"))){
                if(this.isContentClass(jqElement.attr("data-community-content-class"))){
                    classDef = DRHorton.community.content[jqElement.attr("data-community-content-class")];
                }
            }
        }
        return classDef;        
    },
    
    contentClassExists : function(className){
        return typeof DRHorton.community.content[className] != "undefined";
    },
    
    isContentClass : function(className){
        return(DRHorton.community.content[className].IS_CONTENT_CLASS);
    }
    
};


$(function(){
    
    var Godzilla = DRHorton.community.Godzilla;

    DRHorton.communityContents = [];
    
    $("[data-community-element-type=community-wrapper]").each(function(){
        DRHorton.communityContents.push(
            Godzilla.getContentObject($(this))
        );
    });
    
   $("#tw_prerender_style").remove();
});



document.write("<style type=\"text/css\" id=\"tw_prerender_style\">[data-community-element-type=community-wrapper]{display:none!important;}</style>");
