function navigation_switch(type) {

	//fade out the main div
	function create_navigation() {
		xajax.call( 'menu_gen', { mode:'synchronous', parameters:[] } );
		//xajax_menu_gen();
		//document.getElementById("navigation-wrapper").innerHTML = 
		jQuery("#content-link").fadeIn("slow");
		jQuery("#navigation-wrapper").fadeIn("slow");
	}
	
	function content_refill() {
		//jQuery("#content-link").fadeOut("slow");
		jQuery("#content-link").fadeOut("slow", function () {jQuery("#content-wrapper").fadeIn("slow");});
		//jQuery("#content-wrapper").fadeIn("slow");
	
	}
	//fade it out, fill it up, and fade it in
	
	if (type == 'navigation') {
		//jQuery("#content-wrapper").slideUp("slow", function () {});
		document.getElementById('content-wrapper').style.display = 'none';
		if (document.getElementById('navigation-wrapper').innerHTML == '') {
			create_navigation();
		} else {
			jQuery("#content-link").fadeIn("slow");
			jQuery("#content-link").fadeIn("slow");
			jQuery("#navigation-wrapper").fadeIn("slow");
		}
	} else {
		jQuery("#navigation-wrapper").fadeOut("fast", function () {content_refill();});
		//document.getElementById('content-wrapper').style.display = '';
	}
	
	//syncronously build the menu
	//document.getElementById("wrapper").innerHTML = "fast";
	
	//fade in the main div
	//jQuery("#wrapper").fadeIn("fast");
	
	
}

function menu_navigate(code,page) {
	
	function menu_regen() {
		xajax.call( 'menu_gen', { mode:'synchronous', parameters:[code, page] } );
	}

	if (page.match(/id=[0-9]+/)) {
		jQuery("#navigation-wrapper").fadeOut("slow", function () {menu_regen();});

	} else {
		jQuery("#navigation-wrapper").fadeOut("slow", function () {menu_regen();});
		jQuery("#navigation-wrapper").fadeIn("slow");
	}

}

function article_load() {
	//document.getElementById('content-wrapper').style.display = 'none';
	
	jQuery("#navigation-wrapper").fadeOut("slow", function () { 
		jQuery("#content-link").fadeOut("slow");
		jQuery("#content-wrapper").fadeIn("slow");
	});

	//jQuery("#navigation-wrapper").slideUp("slow", function () {content_refill();});
	//jQuery("#content-link").fadeOut("slow");
	//jQuery("#content-wrapper").slideDown("slow");

}
//window.onload = function() {
//alert('hi');

//jQuery("#everything").animate({left:0},'slow','linear',function(){
	//On completion of the animation set the DIV back to static
//	jQuery("#everything").css('position','static');
//});

}
/*
window.onbeforeunload = function() {
//jQuery("#everything").css('position','relative');
jQuery("#everything").fadeOut("slow");
/*
jQuery("#everything").animate({right:500},'slow','linear',function(){
	//On completion of the animation set the DIV back to static
});
*/

//}
