String.prototype.trim = function()
{
    return this.replace(/(^\s*)|(\s*$)/g, "");
}

function ch(id)
{
	id.style.backgroundColor = '#ffdd00';
	id.style.color = '#0000ff';
}

function rech(id, bg_color_flg)
{
	id.style.color = '#ffffff';
	if(bg_color_flg == 1)
	{
		id.style.backgroundColor = '#0000ff';
	} else {
		id.style.backgroundColor = '#6666ff';
	}
}

function open_sub(div_id)
{
	expr = div_id + '.style.display';
	res = eval(expr);
	if(res == 'none')
	{
		expr += " = '';";
	} else {
		expr += " = 'none';";
	}
	eval(expr);
}

function roll_cat(div_id, roll_flg)
{
//	alert("div_" + div_id + " " + roll_flg + " I'm here");
	if(roll_flg == 1)
	{
		expr = "div_" + div_id + '.style.display';
//		alert(expr);
		res = eval(expr);
		if(res == 'none')
		{
			expr += " = '';";
		} else {
			expr += " = 'none';";
		}
		eval(expr);
	}
}

function redirect(url_str)
{
	window.location.href=url_str;
}

function MM_jumpMenu(selObj, restore){ //v3.0
	if(selObj.options[selObj.selectedIndex].value != "")
	{
		NewWin = window.open(selObj.options[selObj.selectedIndex].value, "SearchWindow" + selObj.selectedIndex);
		selObj.selectedIndex=0;
	}
}

function warning()
{
	ErrMsg = window.open("", "WrnMsg", "toolbar=no, status=no, width=400, height=30");
	ErrMsg.document.write("<html><head><title>Ошибка!</title></head><body>");
	ErrMsg.document.write("<div style=\"background-color:#ffeeee; padding:5; border-style:solid; border-color:#ff0000; border-width:1\"><font color=\"#FF0000\"><center><b>Данная функция находится в разаработке.</b></center></font>");
	ErrMsg.document.write("</body></html>");
}

function new_win_redirect(url_str)
{
	NewWin = window.open(url_str, "NewWin");
}

function showLoginForm() {
	document.getElementById('login-form').style.display = '';
}
function hideLoginForm() {
	document.getElementById('login-form').style.display = 'none';
}