function BlogArchive(param){
	BaseArchive.apply(this,arguments);
}

BlogArchive.prototype = new BaseArchive();

$extend(BlogArchive.prototype,{
	getNodeValue : function(parentNode, tagName){
		var nodes = parentNode.getElementsByTagName(tagName);
		if(nodes.length){
			if(nodes.item(0).firstChild)return nodes.item(0).firstChild.data;
		}
		return '\u00a0';//space
	},
	onGetArchive : function(text, xml){
		var posts = xml.getElementsByTagName('post');
		var l = posts.length;
		var i = -1, name, url, blog_url;
		while(this.divObj.firstChild) this.divObj.removeChild(this.divObj.firstChild);//remove old nodes
		while(++i<l){
			var p = posts[i];
			name = this.getNodeValue(p, 'user_name');
			url = this.root_url + 'member/' + encodeURIComponent(name);
			blog_url = url+'/blog/'+this.getNodeValue(p, 'id');
			var d1 = document.createElement('div');
			d1.className = 'postexcerpt';
			var a1 = document.createElement('a');
			a1.setAttribute('href', blog_url);

			var im = document.createElement('img');
			im.className = 'smallthumb';
			im.style.backgroundImage = 'url(\''+this.getNodeValue(p, 'avatar_url')+'\')';
			im.setAttribute('src', this.root_url + 'img/!pix.gif');
			a1.appendChild(im);
			d1.appendChild(a1);
				
			var d2 = document.createElement('div');
			d2.className = 'dotted test';
			var a2 = document.createElement('a');
			a2.setAttribute('href', blog_url);
			a2.className = 'posttitle test';
			a2.appendChild(document.createTextNode(this.getNodeValue(p, 'title')));
			d2.appendChild(a2);
			d1.appendChild(d2);
			
			var d3 = document.createElement('div');
			d3.className = 'lightgreen';
			d3.appendChild(document.createTextNode('posted by '));
			var a3 = document.createElement('a');
			a3.setAttribute('href', url);
			a3.appendChild(document.createTextNode(name));
			d3.appendChild(a3);
			d3.appendChild(document.createTextNode(' '+this.getNodeValue(p, 'time_posted')+' ago'));
			d1.appendChild(d3);
			
			var d4 = document.createElement('div');
			d4.className = 'clearfloat';
			d4.appendChild(document.createTextNode('\u00a0'));
			d1.appendChild(d4);
			
			this.divObj.appendChild(d1);
		}
		this.enablePageButtons();
	}
});
