function changePicture(fileSRC, ord, id) {
	var el = document.getElementById('popup');
	el.style.display = 'block';
	el.style.marginTop = (-200 +  parseInt(document.body.scrollTop));
	// Создаем новый объект JSHttpRequest.
	var req = new Subsys_JsHttpRequest_Js();
	// Код, АВТОМАТИЧЕСКИ вызываемый при окончании загрузки.
	req.onreadystatechange = function() {
		if (req.readyState == 4) {
			document.getElementById('container').innerHTML = req.responseJS.picture;
			document.getElementById('nav').innerHTML = req.responseJS.navigation;
		}
	}
	// Разрешаем кэширование (чтобы при одинаковых запросах
	// не обращаться к серверу несколько раз).
	req.caching = false;
	// Подготваливаем объект.
	file = siteURL + '/photo_JsHttpRequest.php';
	req.open('GET', file, true);
	// Посылаем данные запроса (задаются в виде хэша).
	req.send({ord:ord, id:id});
}

function slide(next, order, id) {
	var el = document.getElementById('popup');
	el.style.display = 'block';
	el.style.marginTop = (-250 +  parseInt(document.body.scrollTop));
	// Создаем новый объект JSHttpRequest.
	var req = new Subsys_JsHttpRequest_Js();
	// Код, АВТОМАТИЧЕСКИ вызываемый при окончании загрузки.
	req.onreadystatechange = function() {
		if (req.readyState == 4) {
			document.getElementById('container').innerHTML = req.responseJS.picture;
			document.getElementById('nav').innerHTML = req.responseJS.navigation;
		}
	}
	// Разрешаем кэширование (чтобы при одинаковых запросах
	// не обращаться к серверу несколько раз).
	req.caching = false;
	// Подготваливаем объект.
	file = siteURL + '/slide_JsHttpRequest.php';
	req.open('GET', file, true);
	// Посылаем данные запроса (задаются в виде хэша).
	req.send({next:next, order:order, id:id});
	
}

function preparePhotoCounter() {
	var width = screen.width;
	var photoInCol = 4;
	if(width >= 1152) {
		photoInCol = 5;	
	} 
	
	if(getCookie("photos") == null) {
		setCookie("photos", (photoInCol*3));
		window.location = window.location;
	}
}