/* Генерация произвольного числа */
function GetRand() {
	result = '';
	result = Math.random() + '1';
	result = result.split('.');
	return result[1];
}
/* Trim строки */
function stringTrim(strToTrim) {
	var tmp_str = new String(strToTrim);
	return (tmp_str.replace (/^\s+|\s+$/g, ''));
}
/* Установка Cookie */
function SetCookie(sName, sValue) {
	document.cookie = sName + '=' + escape(sValue) + '; expires=Fri, 25 Dec 2020 23:59:59 GMT;';
}
/* Удаление Cookie */
function DelCookie(sName) {
	document.cookie = sName + '=; expires=Fri, 31 Dec 1999 23:59:59 GMT;';
}
/* Считывание Cookie */
function GetCookie(sName) {
	var aCookie = document.cookie.split('; ');
	for (var i=0; i < aCookie.length; i++) {
		var aCrumb = aCookie[i].split('=');
		if (sName == aCrumb[0]) return unescape(aCrumb[1]);
	}
	return null;
}
/* Ширина клиентской (рабочей) области окна */
function getClientWidth() {
    return document.compatMode == 'CSS1Compat' && !window.opera ? document.documentElement.clientWidth : document.body.clientWidth;
}
/* Высота клиентской (рабочей) области окна */
function getClientHeight() {
    return document.compatMode == 'CSS1Compat' && !window.opera ? document.documentElement.clientHeight : document.body.clientHeight;
}
/* На сколько прокручен документ с верху */
function getBodyScrollTop() {
    return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
}
/* На сколько прокручен документ с лева */
function getBodyScrollLeft() {
    return self.pageXOffset || (document.documentElement && document.documentElement.scrollLeft) || (document.body && document.body.scrollLeft);
}
/* Координата центра с учетом скроллинга по оси X */
function getClientCenterX() {
    return parseInt(getClientWidth() / 2) + getBodyScrollLeft();
}
/* Координата центра с учетом скроллинга по оси Y */
function getClientCenterY() {
    return parseInt(getClientHeight() / 2) + getBodyScrollTop();
}
/* Размер документа по вертикали */
function getDocumentHeight() {
    return (document.body.scrollHeight > document.body.offsetHeight) ? document.body.scrollHeight : document.body.offsetHeight;
}
/* Размер документа по горизонтали */
function getDocumentWidth() {
    return (document.body.scrollWidth > document.body.offsetWidth) ? document.body.scrollWidth : document.body.offsetWidth;
}