function ShowOnly(item_id, group) {
		var item = document.getElementById(item_id);
		if(!group) group = 0;		
		if (!ShowOnly.current) ShowOnly.current = new Array();
		var s = item.style.display;
		if (s == "none") {
			if (ShowOnly.current[group]) ShowOnly.current[group].style.display = "none";
			item.style.display = "block";
			ShowOnly.current[group] = item;
		} else {
			ShowOnly.current[group] = null;
			item.style.display = "none";
		}	
}
function InitShowElements(child_id_mask, active, parent_id, group) {
	var parent;
	if(!group) group = 0;		
	if (parent_id)
		parent = document.getElementById(parent_id);
	else
		parent = document;
	var a = parent.getElementsByTagName('div');
	
	for (var i = 0; i < a.length; i++) {
		if (a[i].id.indexOf(child_id_mask) >= 0) {
			if (a[i].id != active)
				a[i].style.display = "none";	
			else {
				ShowOnly.current = new Array();
				ShowOnly.current[group] = a[i];
			}
		}
	}	
}

function ColoriseTRs(parent_id, odd_class, unite_rows_with_class, exclude_table_with_class) {
	if (!odd_class) odd_class = "odd";
	var tables = document.getElementById(parent_id).getElementsByTagName('table');
	for (var i = 0; i < tables.length; i++) {
		if (tables[i].className == exclude_table_with_class) continue;
		
		var TRs = tables[i].getElementsByTagName('tr');
		for (var j = 1; j < TRs.length; j+= 2	)
			if (TRs[j]) TRs[j].className = odd_class;
	}
	
	imgs = document.getElementById(parent_id).getElementsByTagName('a');
	for (var i = 0; i < imgs.length; i++) {
		if ((im = imgs[i].childNodes[0]) && im.className && im.className.indexOf('img') > -1)
			imgs[i].onclick = new Function("return OpenPic(this)");
	}
}


function OpenPic(node) {
	ur = node.href;
	var a = window.open('about:blank','imag','resizable=yes,location=no,menubar=no,titlebar=no,scrollbars=no,status=no,toolbar=no,fullscreen=no,dependent=yes');
	var html = "<html><head><title>"+node.title+"<\/title><\/head>";
	html += "<body style='padding:10px; margin:0px; text-align: center; vertical-align: middle; background-color: #003058'>";
	html += "<img onclick='window.close()' onload=\"window.resizeTo(Math.min(screen.availWidth+46,this.width+46),Math.min(screen.availHeight+116,this.height+116))\" style='cursor:pointer; border: 2px solid #fff; cursor: pointer' src='"+ur+"' alt='Закрыть' \/>";
	html += "<br /><p style='font-family: Verdana;text-align: center; color: #fff'>"+node.title+"</p>";
	html += "<\/body><\/html>";
	a.document.write(html);
	a.document.close();
	return false;
}