﻿function addBookmark(url,title){if(!url)url=location.href;if(!title)title=document.title;if((typeof window.sidebar=="object")&&(typeof window.sidebar.addPanel=="function"))window.sidebar.addPanel(title,url,"");else if(typeof external=="object")external.AddFavorite(url,title);else if(window.opera&&document.createElement){var a=document.createElement('A');if(!a)return false;a.setAttribute('rel','sidebar');a.setAttribute('href',url);a.setAttribute('title',title);a.click();}else return false;return true;}function anyDisp(id){if(document.getElementById){if(document.getElementById(id).style.display=='block'){document.getElementById(id).style.display='none';}else if(document.getElementById(id).style.display=='none'){document.getElementById(id).style.display='block';}}return;}function oneDisp(id,arr){if(document.getElementById){for(var i=0;i<arr.length;i++){document.getElementById(arr[i]).style.display='none';}document.getElementById(id).style.display='block';}return;}function treeChange(id,field){if(document.getElementById){if(field.firstChild.firstChild.nodeValue=='+'){document.getElementById(id).style.display='block';field.firstChild.firstChild.nodeValue='-';}else{document.getElementById(id).style.display='none';field.firstChild.firstChild.nodeValue='+';}}return;}function formTest(field){var pattern=/\S/;if(!pattern.test(field.value)){alert('Поле с комментарием не заполнено!');return false;}return true;}function checkAll(oForm,cbName,arg){if(oForm[cbName]&&oForm[cbName].length){for(var i=0;i<oForm[cbName].length;i++){oForm[cbName][i].checked=arg;}}else if(oForm[cbName]){oForm[cbName].checked=arg;}return;}function commentsFocus(idBlock,idField){if(document.getElementById){if(document.getElementById(idBlock).style.display=='block'){document.getElementById(idField).focus();}}return;}