var fn_nav=function(){};

fn_nav.current='';
fn_nav.default_hash='';

fn_nav.change=function(new_id){
	if(fn_nav.current!=''){
		$(fn_nav.current).fadeOut(400, function(){;
			$(new_id).fadeIn(400);
			fn_nav.current=new_id;
		});
	}else{
		$(new_id).fadeIn(400);
		fn_nav.current=new_id;
	}
	window.location.replace(window.location.href.replace(/#.*$/,'')+new_id);
	return false;
}
fn_nav.verify_location=function(){
	if(window.location.href.match(/#.*$/)){
		if(fn_nav.current!=window.location.href.replace(/.*(#.*)$/,'$1')){
			fn_nav.change(window.location.href.replace(/.*(#.*)$/,'$1'));
		}
	}else{
		fn_nav.change(fn_nav.default_hash);
	}
}

fn_nav.init=function(default_hash){
	if(typeof(default_hash)!='undefined' && default_hash!=''){
		fn_nav.default_hash=default_hash;
	}
	fn_nav.verify_location();
}
