<!--
function pismo(mail, subject, body) {

  var str = mail.substr(0, mail.length - 3);
  var rm = '';
  for (var i=str.length-1; i >= 0; i--) { rm += str.substr(i, 1) }
  var loc = 'mailto:' + rm;
  if (subject || body) loc += '?';
  if (subject) loc += 'Subject=' + subject;
  if (subject && body) loc += '&';
  if (body) loc += 'Body=' + body;
  document.location = loc;
}

function createRequest() {

	var request = false;
	try{
		request = new XMLHttpRequest();
	}
	catch(trymicrosoft){
		try{
			request = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(othermicrosoft){
			try{
				request = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(failed){
				request = false;
			}
		}
	}

	if(!request)
		alert("Ваш браузер не поддреживает технологию Ajax.");
	else	
		return request;
}
	
var rusChars = new Array('А','Б','В','Г','Д','Е','Ё','Ж','З','И','Й','К','Л','М','Н','О','П','Р','С','Т','У','Ф','Х','Ч','Ц','Ш','Щ','Э','Ю','Я','Ы','Ъ','Ь','Ё','а','б','в','г','д','е','ё','ж','з','и','й','к','л','м','н','о','п','р','с','т','у','ф','х','ч','ц','ш','щ','э','ю','я','ы','ъ','ь','ё',' ','-','_');
var latChars = new Array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
var transChars = new Array('A','B','V','G','D','E','Jo','Zh','Z','I','J','K','L','M','N','O','P','R','S','T','U','F','H','Ch','C','Sh','Shch','E','Ju','Ja','Y','','','E','a','b','v','g','d','e','jo','zh','z','i','j','k','l','m','n','o','p','r','s','t','u','f','h','ch','c','sh','shch','e','ju','ja','y','','','e','_','_','_');

function translit(name) {

	var to = "";
	var len = name.length;
	var character, isRus;
	for ( var i = 0; i < len; i++ ) {
		character = name.substr(i,1);
		isRus = false;
		isLat = false;
		for ( var j = 0; j < rusChars.length; j++ )
			if ( character == rusChars[j] ) {
				isRus = true;
				break;
			}
		if(!isRus) {
			for ( var k = 0; k < latChars.length; k++ )
				if ( character == latChars[k] ) {
					isLat = true;
					break;
				}
		}
		to += isRus ? transChars[j] : (isLat ? latChars[k] : '');
	}
	return to;
}

function globalSearchFocus() {

	if(document.getElementById('globalsearchtext').value == 'Поиск по материалам') document.getElementById('globalsearchtext').value = '';
	return;
}
function globalSearchBlur() {

	if(document.getElementById('globalsearchtext').value == '') document.getElementById('globalsearchtext').value = 'Поиск по материалам';
	return;
}

function funcDisplayJumper(id) {

	div = document.getElementById(id);
	if(div.style.display == 'block') div.style.display = 'none';
	else div.style.display = 'block';
	return;
}

function number_format(number, decimals, dec_point, thousands_sep) {
 
    var i, j, kw, kd, km;
 
    if (isNaN(decimals = Math.abs(decimals)))
        decimals = 2;
    if (dec_point == undefined)
        dec_point = ',';
    if (thousands_sep == undefined)
        thousands_sep = '.';
 
    i = parseInt(number = (+number || 0).toFixed(decimals)) + '';
 
    j = (j = i.length) > 3 ? j % 3 : 0;
	 
    km = (j ? i.substr(0, j) + thousands_sep : '');
    kw = i.substr(j).replace(/(\d{3})(?=\d)/g, '$1' + thousands_sep);
    kd = (decimals ? dec_point + Math.abs(number - i).toFixed(decimals).replace(/-/, 0).slice(2) : '');
 
 
    return km + kw + kd;
}

//alert(number_format(1234.5678, 2, '.', ' '))
//-->