//m.i.

var href = '';

function events(k) {
	$('#content a').not('a.highslide').click(function() {
		getContent($(this).attr('href'));
		return false;
	});
	
	if (k) {
		var s = $('#temp').html();
		$('#temp').html('');
		$('#block').html(s);		
	}
	
	$('#block a').not('a.highslide').click(function() {
		getContent($(this).attr('href'));
		return false;
	});
}

function gt() {
	document.location = href;	
}

function getContent(u) {
	href = u;
	if (u.split('?').length == 2) u = u + '&';
	else u = u + '?'; 
	
	hax({
		url : u + 'getcontent=1',
		id : 'content',
		onload : events,
		onerror : gt
	});
}

$(document).ready(function() {
	if (document.location.toString().search(/:ax:content:/)==-1) events(false);
	else events(true);
});