	// <![CDATA[
	// strips page name out of url
	
	// defaultPage is the page to load by default if there is no page name in the url
	// analogy to index.html
	// not that page name is assumend to be .html if not specified
	var defaultPage = "home";

	function getPageID(url){
		// set a default
		// defaultPage initialised at top
		var result=defaultPage;
		url=url+'';
		//if( url.test("#")){
		if( url.indexOf("#") != -1 ){
			if( url.indexOf("&") != -1 ){
				result=url.slice( url.indexOf("#")+1, url.indexOf("&") );
			}
			else {
				result=url.substring(url.indexOf("#")+1);
			}
		}
		return result;
	};

	// strips page name out of url
	function getMenuID(url){
		// set a default	
		var result='';
		url=url+'';
		if( url.indexOf("&") != -1 ){
			result=url.substring( url.indexOf("&")+1 );
		}
		return result;
	};
	
	//takes the name of a page with or without suffix and returns url to that page
	//if there is no '.' in the page name '.html' is added to the end of the page name
	function buildPagesURL(pageID){
		var url = "./pages/" + pageID;
		//if there is no '.' in the page name add the html suffix
		if( pageID.indexOf(".") == -1 ){
			url = url + ".html";
		}
		return url;
	};
	
	// page loader
	function loadPage( href ){
		var pageID = getPageID(href);
		// home the default
		// the home page would just blank the page as best we can
		// clearing the content and opacityDown
		//
		// anything other than clear should opacityUp''
		//
		if ( pageID == "home" ){
			blankPage();
		}
		else{
		//set up the page url
		var url = buildPagesURL( getPageID(href) );
		//load page
		ajaxInnerHtmlById( url,  pageID, 'main', true );
		}
	};
//]]>
