<?php

class language{
	var $var;

	function __construct(){
		if($_GET['language']=='RU'){ $value='RU'; }
		elseif($_GET['language']=='US'){ $value='US'; }
		else{ ban_acc(); $value='null'; }

		$text=$GLOBALS['lang']['mes3']; $location=$this->Location();
		
		print '<script type="text/javascript"> $.cookie("lang","'.$value.'", { expires: 365 }); </script>';
		include('./inc/success.php');
	}

	private function Location(){
		$location=end(explode('?',$_SERVER['HTTP_REFERER']));
		if(!$location or strstr($location,'language')){ $location='home'; }

		return $location;
	}
}

?>