var Navigation = {

	run: function()
	{
		if (!$('body.home').length) {
			Navigation.refresh();
		}
	},

	refresh: function()
	{
		setTimeout(Navigation.change, 5000);
	},
	change: function()
	{
		var image = $('#site_menu_1b');
		var content = $('#site_menu_1b_box .box_content');
		var current_id = content.find('h4 a[title]:first').attr('title');

		if (image.length && content.length) {
			$.ajax({
				url: location.href,
				dataType: 'json',
				type: 'GET',
				data: {
					plugin: 'navigation',
					mode: 'randomArticle',
					current_id: current_id
				},
				success: function(data){
					if (data['reload']) {
						image.empty().html(data['image']);
						image.find('img[src$=".png"]').ifixpng();
						content.empty().html(data['content']);
					}
					Navigation.refresh();
				}
			});
		}
	}

}
//StartUp(Navigation);
