	//функция передачи ссылки в родительское окно
	function sendReference(href)
	{
		//проверка на пустоту
		if(href != "")
		{
			parent.opener.form.upload_file.value = href;
			parent.opener.form.submit();
			window.close();
		}
	}

	//открываем окно
	function openWindow(href)
	{
		//открываем окно
		var win = window.open(href, "", "width=800,height=600");
	}

	//функция работы с кружками
	function mainMenu(theme, id, type, title, about)
	{
		//получаем объект
		var obj = document.getElementById(id);
		var objDiv = document.getElementById("div_main_menu");
		var tempString = "";
		//затемняем
		if(type == 0)
		{
			//выводим надпись
			tempString = '<table width = "100%">';
			tempString += '<tr><td noWrap><p class = "main_title_text">' + title + '</p></td></tr>';
			tempString += '<tr><td><p class = "text_h5">' + about + '</p></td></tr>';
			tempString += '</table>';

			objDiv.innerHTML = tempString;
			objDiv.style.visibility = "visible";
			
			//выбираем иконку
			switch(id)
			{
				case "img_red_circle_0": obj.src = "pictures/" + theme + "/red_circle_dark_miklesoft.gif"; break;
				case "img_red_circle_1": obj.src = "pictures/" + theme + "/red_circle_dark_micro.gif"; break;
				case "img_red_circle_2": obj.src = "pictures/" + theme + "/red_circle_dark_wave.gif"; break;
				case "img_red_circle_3": obj.src = "pictures/" + theme + "/red_circle_dark_$.gif"; break;
				case "img_red_circle_4": obj.src = "pictures/" + theme + "/red_circle_dark_bag.gif"; break;
				case "img_red_circle_5": obj.src = "pictures/" + theme + "/red_circle_dark_list.gif"; break;
			}
		}
		else
		{
			objDiv.style.visibility = "hidden";

			//выбираем иконку
			switch(id)
			{
				case "img_red_circle_0": obj.src = "pictures/" + theme + "/red_circle_light_miklesoft.gif"; break;
				case "img_red_circle_1": obj.src = "pictures/" + theme + "/red_circle_light_micro.gif"; break;
				case "img_red_circle_2": obj.src = "pictures/" + theme + "/red_circle_light_wave.gif"; break;
				case "img_red_circle_3": obj.src = "pictures/" + theme + "/red_circle_light_$.gif"; break;
				case "img_red_circle_4": obj.src = "pictures/" + theme + "/red_circle_light_bag.gif"; break;
				case "img_red_circle_5": obj.src = "pictures/" + theme + "/red_circle_light_list.gif"; break;
			}

		}
		
	}


	//функция работы с маленькими кружками
	function sectionMenu(theme, id, type)
	{
		//получаем объект
		var obj = document.getElementById(id);

		//затемняем
		if(type == 0) obj.src = "pictures/" + theme + "/red_circle_dark_small.gif";
		else obj.src = "pictures/" + theme + "/red_circle_light_small.gif";
	}

	//функция выбора всех checkbox
	function checkedAll()
	{	
		var i = 0;	
		
		//либо включаем, либо выключа
		for(i = 0; i < form.elements.length; i++)
		{
			if(form.flag_all.value == "") form.elements[i].checked = true;
			else form.elements[i].checked = false;
		}

		if(form.flag_all.value == "") form.flag_all.value = "all";
		else form.flag_all.value = "";
	}

	//функция открытия/закрытия разделов
	function openClose(id)
	{
		//либо открываем, либо закрываем
		if(document.all(id).style.display == 'block') document.all(id).style.display = 'none';
		else document.all(id).style.display = 'block';
	}