var isAjax = true;


function loadPost(id)
{
	new Ajax.Request('posts/ajax/'+id, {asynchronous:true, onSuccess:onLoadPost}); 
}

function onLoadPost(response)
{
	$('detail').innerHTML = response.responseText;  
	Behaviour.apply();                            
}

function loadPostOverview()
{
	
}

var postRules = 
{
	'a.post' : function(element) {
		element.onclick = function(){
			var postId = this.href.split('/')[5];
	/*		var postId = this.href.split('/')[5];*/
			//window.console.log(this.href.split('/')[6]);
			
			loadPost(postId);
	
			return false;
		}
	}
}

if(isAjax)
	Behaviour.register(postRules);



