	jQuery(function( $ ){
		/**
		 * Actual call to jQuery.localScroll.
		 * Most jQuery.LocalScroll's defaults, belong to jQuery.ScrollTo, check it's demo for an example of each option.
		 * @see http://flesler.demos.com/jquery/scrollTo/
		 */

		$('#pageContent').localScroll({// Only the links inside that jquery object will be affected
			lazy: true, // This is the KEY setting here, makes the links work even after an Ajax load.
			target: '#pageContent', // The element that gets scrolled
			axis:'x', // Horizontal scrolling
			duration:500,
			onBefore:function( e, subsec, $cont ){//'this' is the clicked link
				if( this.blur )
					this.blur(); // Remove the awful outline
			}
		});
	});
	
	function rbf_loadContent(url) {	
		$('#pageContent').html( '<div class="center wide"><br><br><img src="facebox/loading-blue.gif"><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br></div>' ).load( url, function(){
			$('a[rel*=facebox]').facebox();
			if (!document.all) {
				$('.figureContainer').corner("keep");
			}
		});
	}
	
	function rbf_loadInitialContent(url) {
		var pcURL = rbf_getParameter('pcURL');
		if (pcURL.length > 5) {
			url = pcURL;
		}
		rbf_loadContent(url);
	}
	
	function rbf_getParameter(name) {
		name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
		var regexS = "[\\?&]"+name+"=([^&#]*)";
		var regex = new RegExp( regexS );
		var results = regex.exec( window.location.href );
		if( results == null )
			return "";
		else
			return results[1];
	}