<?
if (isset($_SESSION['refer']) && $_SESSION['refer']!=NULL && !preg_match('#(rules)|(smiles)|(secure)|(aut)|(reg)|(umenu)|(zakl)|(mail)|(anketa)|(settings)|(avatar)|(info)\.php#',$_SERVER['SCRIPT_NAME']))
$_SESSION['refer']=NULL;

function otkuda($ref)
{
	if (preg_match('#^/forum/#',$ref))

	$mesto='Форум';

	elseif (preg_match('#^/chat/#',$ref))

	$mesto='Чат';

	elseif (preg_match('#^/lib/#',$ref))

	$mesto='Библиотека';

	elseif (preg_match('#^/news/#',$ref))

	$mesto='Новости';

	elseif (preg_match('#^/adm_panel/#',$ref))

	$mesto='Админка';

	elseif (preg_match('#^/votes/#',$ref))

	$mesto='Голосования';

	elseif (preg_match('#^/guest/#',$ref))

	$mesto='Гостевая';

	elseif (preg_match('#^/loads/#',$ref))

	$mesto='Загрузки';

	elseif (preg_match('#^/users\.php#',$ref))

	$mesto='Пользователи';

	elseif (preg_match('#^/online\.php#',$ref))

	$mesto='Сейчас на сайте';

	elseif (preg_match('#^/online_g\.php#',$ref))

	$mesto='Гости';

	elseif (preg_match('#^/reg\.php#',$ref))

	$mesto='Регистрация';

	elseif (preg_match('#^/obmen/#',$ref))

	$mesto='Обменник';

	elseif (preg_match('#^/aut\.php#',$ref))

	$mesto='Авторизация';

	elseif (preg_match('#^/index\.php#',$ref))

	$mesto='Главная';

	elseif (preg_match('#^/\??$#',$ref))

	$mesto='Главная';

	else

	$mesto=false;

	return $mesto;
}


?>