function stopAllErrors() 
{
      return true;  
}

window.onerror = stopAllErrors; 	

function brightly(row, b){
	row.className = (b ? 'row_ower' : 'row_out');
}

function revert(id, up_id, cnt, name, file)
{
	if(!cnt) return;
	if(!file) file = '';
	file = file.replace('open', '');
	c = document.getElementById('tree-'+name+'-container-'+id);
	img = document.getElementById('tree-'+name+'-img-'+up_id+'-'+id);
	ico = document.getElementById('tree-'+name+'-icon-'+id);
	if(c.style.display=='none')
	{
		setCookie('show-'+name+'-container-'+id, 1);
		c.style.display='block'; 
		ico.src='images/open'+file+'.png';
		img.src='images/'+img.alt+'minus.png';
	}
	else
	{
		setCookie('show-'+name+'-container-'+id, -1);
		c.style.display='none'; 
		ico.src='images/'+file+'.png';
		img.src='images/'+img.alt+'plus.png';
	}
}	
		
function block_revert(id)
{
	b = document.getElementById('block-'+id);
	img = document.getElementById('block-img-'+id);
	if(b.style.display=='none')
	{
		setCookie('show-block-'+id, 1);
		b.style.display=''; 
		img.src='images/block_minus.gif';
	}
	else
	{
		setCookie('show-block-'+id, -1);
		b.style.display='none'; 
		img.src='images/block_plus.gif';
	}
}	
		
function addBookmark(url, title)
{
 if (!url) url = location.href;
 if (!title) title = document.title;
 
 //Gecko
 if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")) window.sidebar.addPanel (title, url, "");
 //IE4+
 else if (typeof window.external == "object") window.external.AddFavorite(url, title);
 //Opera7+
 else if (window.opera && document.createElement)
 {
   var a = document.createElement('A');
   if (!a) return false; //IF Opera 6
   a.setAttribute('rel','sidebar');
   a.setAttribute('href',url);
   a.setAttribute('title',title);
   a.click();
 }
 else return false;
 
 return true;
}		

function getCookie(name) 
{
	var prefix = name + "=";
	var cookieStartIndex = document.cookie.indexOf(prefix);
	if (cookieStartIndex == -1) return null;
	var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length);
	if (cookieEndIndex == -1) cookieEndIndex = document.cookie.length;
	return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}

function setCookie(name, value) 
{
	var curCookie = name + "=" + escape(value) + "; path=/;";
	document.cookie = curCookie;
}

function showRow(id){
	
	c = document.getElementById("row"+id);
	h = document.getElementById("hand"+id);
	if(c.style.display=="none")
	{
		setCookie("hand"+id, '1');
		c.style.display = "";
		h.src = 'images/minus.gif';
	}
	else
	{
		setCookie("hand"+id, '0');
		c.style.display = "none";
		h.src = 'images/plus.gif';
	}
}
