var View = function() {
    this.init();
};

View.prototype = {
	
    init: function() {
    },
    renderHit: function(rset) {

        if(!this.hitTemplate) {
				
            this.hitTemplate = Ext.XTemplate.from('hitTemplateCnt', {
				
                getImgTag: function(path, imgName, imgExt, imgTitle, defaultImgName) {
                    if(!imgName || imgName == '')
                        imgName = defaultImgName;
                    if(imgExt != '')
                        imgExt = '.' + imgExt;
                    return '<img src="' + path + imgName + imgExt + '" title="' + imgTitle + '" alt="' + imgTitle + '"/>';
                },
                getLinkTag: function(url, text, alt, cls, id) {
                    return this.openLinkTag(url, alt, cls, id) + text + this.closeLinkTag();
                },
                openLinkTag: function(url, alt, cls, id) {
                    var altAttr = '';
                    var clsAttr = '';
                    var idAttr = '';

                    if( (typeof alt != 'undefined') && (alt != '') )
                        altAttr = ' alt="' + alt + '"';
                    if( (typeof cls != 'undefined') && (cls != '') )
                        clsAttr = ' class="' + cls + '"';
                    if( (typeof id != 'undefined') && (id != '') )
                        idAttr = ' id="' + id + '"';

                    return '<a href="' + url + '"' + altAttr + clsAttr + idAttr + '>';
                },
                closeLinkTag: function() {
                    return '</a>';
                },
                openTag: function(tag, opts, autoClose) {
                    var attrs = '';
                    for(attrName in opts)
                        attrs += ' ' + attrName + '="' + opts[attrName] + '"';

                    return '<' + tag + attrs + (autoClose ? '/' : '') + '>';
                },
                closeTag: function(tag) {
                    return '</' + tag + '>';
                }
				
            });
			
            this.hitTemplate.compile();
        }

        rset.setItemPos(0);
        this.hitTemplate.append('contentBox', rset.getRecord());
    },
    renderFilter: function(filterData) {
		
    }
	
};
