function TLoad(){
var checkload = GetCookie('firstload');
if(checkload == '1'){
SpecialAction('resdesc');
}else{
SetCookie('firstload', '1');
}
}

function SetCookie(name, value){
document.cookie = name + "=" + value + ";path=/";
}	

function GetCookie(name) {
	var cookie = " " + document.cookie;
	var search = " " + name + "=";
	var setStr = null;
	var offset = 0;
	var end = 0;
	if (cookie.length > 0) {
		offset = cookie.indexOf(search);
		if (offset != -1) {
			offset += search.length;
			end = cookie.indexOf(";", offset)
			if (end == -1) {
				end = cookie.length;
			}
			setStr = unescape(cookie.substring(offset, end));
		}
	}
	return(setStr);
}

function SpecialAction(action){
// Создаем новый объект JSHttpRequest.
var req = new Subsys_JsHttpRequest_Js();
// Код, АВТОМАТИЧЕСКИ вызываемый при окончании загрузки.
req.onreadystatechange = function() {
if (req.readyState == 4) {
if (req.responseJS) {
// Запиcываем в результат работы. 

if(req.responseJS.outputresult!=0){
document.getElementById('brand_desc').innerHTML = (req.responseJS.out_desc||'');	
}

 }
            }
        }		
// Подготваливаем объект.
req.open('POST', 'modules/thread.php' + '?test=abc', true);
// Поcылаем данные запроcа (задаютcя в виде хэша).
req.send({action: action});	
}
