document.write("<div class=\"pastie\">\n");
document.write("  <link href=\"http://pastie.org/stylesheets/embed.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" />\n");
document.write("  <link href=\"http://pastie.org/stylesheets/clean.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" />\n");
document.write("  \n");
document.write("\n");
document.write("  \n");
document.write("  \n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("\n");
document.write("	\n");
document.write("	<div class=\"allcode\">\n");
document.write("		<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n");
document.write("		<tr>\n");
document.write("			<td>\n");
document.write("				\n");
document.write("				<pre class=\"textmate-source-numbers\">1\n");
document.write("2\n");
document.write("3\n");
document.write("4\n");
document.write("5\n");
document.write("6\n");
document.write("7\n");
document.write("8\n");
document.write("9\n");
document.write("10\n");
document.write("11\n");
document.write("12\n");
document.write("13\n");
document.write("14\n");
document.write("15\n");
document.write("16\n");
document.write("<\/pre>\n");
document.write("			<\/td>\n");
document.write("		<td>\n");
document.write("		<pre class=\"textmate-source\"><pre class=\"sunburst\"><span class=\'source source_php source_php_embedded source_php_embedded_block source_php_embedded_block_html\'>&lt;?php\n");
document.write("\n");
document.write("<span class=\'variable variable_other variable_other_php\'>$langs<\/span> <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_php\'>=<\/span> <span class=\'meta meta_array meta_array_php\'><span class=\'support support_function support_function_construct support_function_construct_php\'>array<\/span>(<span class=\'string string_quoted string_quoted_single string_quoted_single_php\'>\'<span class=\'meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php\'>fr<\/span>\'<\/span>,<span class=\'string string_quoted string_quoted_single string_quoted_single_php\'>\'<span class=\'meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php\'>en<\/span>\'<\/span>,<span class=\'string string_quoted string_quoted_single string_quoted_single_php\'>\'<span class=\'meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php\'>nl<\/span>\'<\/span>)<\/span>; <span class=\'comment comment_line comment_line_double-slash comment_line_double-slash_php\'>// the first item is the default language<\/span>\n");
document.write("\n");
document.write("<span class=\'keyword keyword_control keyword_control_php\'>if<\/span> (<span class=\'support support_function support_function_construct support_function_construct_php\'>isset<\/span>(<span class=\'variable variable_other variable_other_global variable_other_global_php\'>$_COOKIE<\/span>[<span class=\'string string_quoted string_quoted_single string_quoted_single_php\'>\'<span class=\'meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php\'>lang<\/span>\'<\/span>]) <span class=\'keyword keyword_operator keyword_operator_logical keyword_operator_logical_php\'>&amp;&amp;<\/span> <span class=\'support support_function support_function_array support_function_array_php\'>in_array<\/span>(<span class=\'variable variable_other variable_other_global variable_other_global_php\'>$_COOKIE<\/span>[<span class=\'string string_quoted string_quoted_single string_quoted_single_php\'>\'<span class=\'meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php\'>lang<\/span>\'<\/span>], <span class=\'variable variable_other variable_other_php\'>$langs<\/span>)) {\n");
document.write("	<span class=\'variable variable_other variable_other_php\'>$lang<\/span> <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_php\'>=<\/span> <span class=\'variable variable_other variable_other_global variable_other_global_php\'>$_COOKIE<\/span>[<span class=\'string string_quoted string_quoted_single string_quoted_single_php\'>\'<span class=\'meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php\'>lang<\/span>\'<\/span>];\n");
document.write("}\n");
document.write("<span class=\'keyword keyword_control keyword_control_php\'>else<\/span> {\n");
document.write("	<span class=\'variable variable_other variable_other_php\'>$lang<\/span> <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_php\'>=<\/span> <span class=\'support support_function support_function_string support_function_string_php\'>substr<\/span>(<span class=\'variable variable_other variable_other_global variable_other_global_safer variable_other_global_safer_php\'>$_SERVER<\/span>[<span class=\'string string_quoted string_quoted_single string_quoted_single_php\'>\'<span class=\'meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php\'>HTTP_ACCEPT_LANGUAGE<\/span>\'<\/span>], <span class=\'constant constant_numeric constant_numeric_php\'>0<\/span>, <span class=\'constant constant_numeric constant_numeric_php\'>2<\/span>);\n");
document.write("\n");
document.write("	<span class=\'keyword keyword_control keyword_control_php\'>if<\/span> (<span class=\'keyword keyword_operator keyword_operator_logical keyword_operator_logical_php\'>!<\/span><span class=\'support support_function support_function_array support_function_array_php\'>in_array<\/span>(<span class=\'variable variable_other variable_other_php\'>$lang<\/span>, <span class=\'variable variable_other variable_other_php\'>$langs<\/span>))\n");
document.write("		<span class=\'variable variable_other variable_other_php\'>$lang<\/span> <span class=\'keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_php\'>=<\/span> <span class=\'variable variable_other variable_other_php\'>$langs<\/span>[<span class=\'constant constant_numeric constant_numeric_php\'>0<\/span>];\n");
document.write("}\n");
document.write("\n");
document.write("<span class=\'support support_function support_function_head support_function_head_php\'>header<\/span>(<span class=\'string string_quoted string_quoted_single string_quoted_single_php\'>\'<span class=\'meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php\'>HTTP/1.1 301 Moved Permanently<\/span>\'<\/span>);\n");
document.write("<span class=\'support support_function support_function_head support_function_head_php\'>header<\/span>(<span class=\'string string_quoted string_quoted_single string_quoted_single_php\'>\'<span class=\'meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php\'>Location: /index_<\/span>\'<\/span><span class=\'keyword keyword_operator keyword_operator_string keyword_operator_string_php\'>.<\/span><span class=\'variable variable_other variable_other_php\'>$lang<\/span><span class=\'keyword keyword_operator keyword_operator_string keyword_operator_string_php\'>.<\/span><span class=\'string string_quoted string_quoted_single string_quoted_single_php\'>\'<span class=\'meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php\'>.php<\/span>\'<\/span>);\n");
document.write("<\/pre><\/pre>\n");
document.write("		<\/td>\n");
document.write("		<\/tr>\n");
document.write("		<\/table>\n");
document.write("	\n");
document.write("	<\/div>\n");
document.write("\n");
document.write("\n");
document.write("  \n");
document.write("  \n");
document.write("  <div class=\"credit\">\n");
document.write("    <div class=\"buttons\">\n");
document.write("      <a href=\"http://pastie.org/pastes/699888.txt\">\n");
document.write("      <img src=\"http://pastie.org/images/view.png\" height=\"20\" width=\"67\" /><\/a>\n");
document.write("    <\/div>\n");
document.write("  \n");
document.write("    <a href=\"http://pastie.org/699888\">Pastie #699888<\/a> linked directly from <a href=\"http://pastie.org/\">Pastie<\/a>.\n");
document.write("  <\/div><\/div>");
