HD.Widget = function(config) {
	this.config = config;
	this.loadTemplates(arguments.callee);
};

HD.Widget.prototype = {
    getParent : function() {
    	return HD.get(this.config.parent);
    },
    
    render : function(data) {
    	var parentEl = this.getParent();
    	parentEl.innerHTML = this.getHtml(data);
    	this.setListeners(data);
    },
    
    setListeners : function(data) {
    	
    },
    
    destroy : function () {
    	var parentEl = this.getParent();
    	parentEl.innerHTML = "";
    },
    
    loading : function(isShow) {
		var parentEl = this.getParent();
		if(isShow) {
			HD.addClass(parentEl, HD.CSS_CLASSES.LOADING);
		} else {
			HD.removeClass(parentEl, HD.CSS_CLASSES.LOADING);
		}
    },
    
    update : function(eventName, eventData) {
    
    },
    
    getHtml : function(data) {
    	return "";
    },
    
    analyticsString : function() {
    	return "";
    }
};

HD.extend(HD.Widget, [HD.util.Observable, HD.util.Template]);

HD.register('hd_widget', HD.Widget, {version: "1.0", build: "1"});