<?
	ob_start();
    	
	// Configuration details
	include 'config.php';
	  		
  	// If PATH_INFO not set (no page specified in URL) then redirect to default page
  	if (!isset($_SERVER['PATH_INFO'])) {
  		$sql = 'SELECT friendly_url FROM ib_page_list WHERE default_page = "Y"';
	  	$result = mysql_query($sql, $conn);
	  	$row = mysql_fetch_row($result);
	  	header("Location: ".$absolute_url."index/".$row[0]);
	  	exit;
  	}
		
	// If PATH_INFO is set (page specified in URL) then load that page
	else {
    
        // Load page based on URL argument
        include 'system/includes/includes.index_loadpage.php';
        
        // Document head information
        include 'system/includes/includes.index_head.php';	
    	
        // Start page rendering			
    	include 'system/includes/includes.index_body_top.php';
	
        // Fetch page content
        include 'system/includes/includes.index_fetch_content.php';
        
        // Display page content
        include 'system/includes/includes.index_display_content.php';
  		
        // End page rendering      
        include 'system/includes/includes.index_body_bottom.php'; 	
			  					
	} // end else
	
	mysql_close($conn); // Close database connection

	ob_end_flush();

?>