<?php

include './core.php';

if( isset( $_REQUEST['class'] ) )
{
    if( $Smarty->template_exists( 'classes/'.$_REQUEST['class'].'.tpl' ) )
    	$page['content'] = $Smarty->fetch( 'classes/'.$_REQUEST['class'].'.tpl' );
    else
    	$page['content'] = $Smarty->fetch( 'race.tpl' );
}
elseif( isset( $_REQUEST['race'] ) )
{
    if( $Smarty->template_exists( 'races/'.$_REQUEST['race'].'.tpl' ) )
    	$page['content'] = $Smarty->fetch( 'races/'.$_REQUEST['race'].'.tpl' );
    else
    	$page['content'] = $Smarty->fetch( 'race.tpl' );
}
elseif( isset( $_REQUEST['nation'] ) )
{
    if( $Smarty->template_exists( 'nations/'.$_REQUEST['nation'].'.tpl' ) )
    	$page['content'] = $Smarty->fetch( 'nations/'.$_REQUEST['nation'].'.tpl' );
    else
    	$page['content'] = $Smarty->fetch( 'race.tpl' );
}
else
{
	$page['content'] = $Smarty->fetch( 'race.tpl' );
}

$Smarty->assign( 'page', $page );
$Smarty->display( 'main.tpl' );

?>