<?php 

//+-----------------------------------------------------+//
//+ Copyright Floopo.com
//+ Index.php
//+ Main Loader for script
//+-----------------------------------------------------+//

//____Define base and load includes____________
include_once ('config/config.php');
include_once (BASEPATH.'/lib/lib_router/index.php');


//____Load router____________________________
$new_route = new Router();
$route = $new_route->Route();


//___Private Network Ckeck_____________________
include_once ('privacy.php');


//____Start routing____________________________
switch ($route['code']) {

        //Load Component
    case 200:
        include_once ($route['component']);
        break;

        // Load Home page
    case 204:

        // Display Home Page
        $route['component'] = 'com_text';
        $caller = 'index';
        include_once (BASEPATH.'/com/com_text/text.php');
        
        //To load a custom page (i.e not the public stream) use the settings below and comment out the 2 line above
        //----------------------------------------------------------------------------------------------------------
        //$inner_template = TEMPLATES . 'tpl_index.htm';
        //$template_wrapper = TEMPLATES.'wrapper.htm';
        // $display_output_index = true;

        break;

        //Load 404 error
    case 404:
        header('Location: pages/404'); //this will load /com/com_pages/pages.php - to give 404 error
        break;
}


//____Display any output_________________________
if ($display_output_index) {
    $TBS = new clsTinyButStrong;
    $TBS->NoErr = true;
    $TBS->LoadTemplate(TPL_WRAPPER);
    $TBS->MergeField('config', $config);
    $TBS->MergeField('lang', $lang);
    $TBS->Render = TBS_OUTPUT;
    $TBS->Show();
} ?>