window.onload=init;

function init() {
	startList();
}


function startList() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("menu_fall");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}


function doDiv(id) {
	var obj, oimg;

	if (!(obj = document.getElementById('his_div_'+id))) return;
	if (!(oimg = document.getElementById('i_'+id))) return;
	
	if (!obj) {
		oimg.src = gc_path+"/images/minus.gif";
		return;
	}
	
	if (obj.style.display == 'block') {
		obj.style.display = 'none';
		oimg.src = gc_path+"/images/plus.gif";
	} else {
		obj.style.display = 'block';
		oimg.src = gc_path+"/images/minus.gif";
	}
}



function checkSearchField(obj) {
	var elem;
	if (obj.value == 'num') {
		if ((elem = document.getElementById('num_search'))) elem.style.display='block';
		if ((elem = document.getElementById('reg_search'))) elem.style.display='none';
		if ((elem = document.getElementById('search_query'))) elem.value='';
	} else {
		if ((elem = document.getElementById('num_search'))) elem.style.display='none';
		if ((elem = document.getElementById('reg_search'))) elem.style.display='block';
		if ((elem = document.getElementById('search_from'))) elem.value='';
		if ((elem = document.getElementById('search_to'))) elem.value='';
	}
}


function openNew(obj, width, height, titul) {
	var newwin = window.open('/images/spacer.gif', 'Information', 'toolbar=0,status=0,menubar=0,scrollbars=0,resizable=1,width=' + width + ',height=' + height);
	newwin.document.open();
	newwin.document.write('<html><head><title>'+ titul + '</title></head>');
 	newwin.document.write('<body style="margin-left:0; margin-right:0; margin-top:0; margin-bottom:0;padding-top:0; padding-left:0; padding-right:0; padding-bottom:0;"><a href="javascript:void(0)" onClick="window.close()"><img src="' + obj + '" border="0" alt="Скрыть"/></a></body></html>');
 	newwin.document.close();
	newwin.focus();
}