   var pageToLoad = "";
   var makePageWide = false;
   var pageSlim = true;
   var historyArray = new Array();
   
   $(document).ready(function()
   {
   	showBusinessMan();
   });
   
   function showBusinessMan()
   {
		// Hide and then fadein the business man
		$("#businessMan").hide();
		$("#businessMan").fadeIn("slow");   	
	}
	
	function goBack()
	{
		if(historyArray.length > 1)
		{
			// Pop the last page off the array (this will be the current page)
			url = historyArray.pop();
			
			// Now get the previous page
			url = historyArray.pop();
	
			if(url != "")
			{
				// Load that page
				showPage(url);
			}
		}
		else
		{
			close();	
		}
	}
	
	function showPage(page)
	{
		historyArray.push(page);
		pageToLoad = page;	// Set global var
		makePageWide = false;
		$("#contentBG").fadeOut("slow", loadPageFromServer);		
	}
	
	function showWidePage(page)
	{
		historyArray.push(page); 
		pageToLoad = page;	// Set global var
		makePageWide = true;
		$("#contentBG").fadeOut("slow", loadPageFromServer);		
	}	
	
	function loadPageFromServer()
	{		
		$("#content").html("");	
		
		if((makePageWide) && (pageSlim))
		{
			widePage();	
			setTimeout('$.get("loadpage.php?page=" + escape(pageToLoad), {}, pageDataLoaded);', 1000);
		}
		else if((!makePageWide) && (!pageSlim))
		{
			slimPage();	
			setTimeout('$.get("loadpage.php?page=" + escape(pageToLoad), {}, pageDataLoaded);', 1000);
		}	
		else
		{
			$.get("loadpage.php?page=" + escape(pageToLoad), {}, pageDataLoaded);
		}
	}
	
	function pageDataLoaded(responseText, textStatus, XMLHttpRequest)
	{
		if(textStatus == "success")
		{
			$("#content").html(responseText);
			$("#contentBG").fadeIn("slow");	
			doSIFR();
			var objDiv = document.getElementById("content");
			if(objDiv)
			{
				objDiv.scrollTop = 0;
			}
		}	
	}
	
	function doSIFR()
	{
sIFR.replace(HN, {
selector: 'h1'
,css: [
  '.sIFR-root { text-align: left; color: #000000; font-weight: bold; font-size: 21px; margin: 0; padding: 0; line-height: 1em;}'
], wmode: 'transparent'
});
		
sIFR.replace(HN, {
selector: 'h2'
,css: [
  '.sIFR-root { text-align: left; color: #ffffff; font-weight: normal; font-size: 16px; margin: 0; padding: 0; line-height: 1em;}'
], wmode: 'transparent'
});
		
sIFR.replace(HN, {
selector: 'h3'
,css: [
  '.sIFR-root { text-align: left; color: #ffffff; font-weight: bold; font-size: 12px; margin: 0; padding: 0; line-height: 1em;}'
], wmode: 'transparent'
});				            	  	
	}
	
	function widePage()
	{
		$("#businessMan").hide();
		$("#contentBG").animate({ 
        width: "600px"
      }, 1000 );
      
      pageSlim = false;
	}
	
	function slimPage()
	{
		$("#contentBG").animate({ 
        width: "460px"
      }, 1000 );
      
      setTimeout ( '$("#businessMan").show()', 1500 );
      
      pageSlim = true;
	}	 
	
	function close()
	{
		$("#spiritFlash").show();	
	}
	
	function loadPage(url)
	{
		// Called by flash
		$("#spiritFlash").hide(); 	
		showPage(url);
	}
	
	// Hide the content background div
	$("#contentBG").hide();
	
	// Show the default content area
	//showPage('telephony.html');
	
	// Inject the spirit flash movie into the page
	var so = new SWFObject("flash/spirit.swf", "spirit", "780", "540", "9", "#FFFFFF");
	so.addParam('allowscriptaccess','always');
	so.write("spiritFlash");	
	