<?php
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
	$clientLocales = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
	$clientLocales = preg_replace("#[A-Z0-9]|q=|;|-|\.#", "", $clientLocales);
	$clientLocales = explode(',', $clientLocales);
	$availableLocales = array('en', 'fr');
	foreach ($clientLocales as $clientLocale) {
	if (in_array($clientLocale, $availableLocales)) {
		$locale = $clientLocale;
		break;
	}
	}
}

if (isset($locale) AND $locale == "fr")
	echo file_get_contents("404.fr.html");
else
	echo file_get_contents("404.en.html");

?>
