/* from Netscape Sidebar Developer's Guide */
function enableSidebar(name, url) { 
	if ((typeof window.sidebar == "object") &&
			(typeof window.sidebar.addPanel == "function")) { 
		window.sidebar.addPanel (name, url,""); 
	}  else  { 
		var rv = window.confirm("Sidebar je určen pouze pro prohlížeč " +
				"Mozilla nebo kompatibilní. " +
				"Chcete si stáhnout Mozillu?"); 
		if (rv) 
			document.location.href = "http://www.mozilla.org/";
	} 
} 

function init() {
	hideall();
	show('favourites');
	document.getElementById('topLinks').getElementsByTagName('A')[0].className = 'current';
	target();
}

function hideall() {
	var m = document.getElementById('content').getElementsByTagName('DIV');

	for (var i = 0; i < m.length; i++) {
		
		if ((m[i].getAttribute('id') != null) || (m[i].getAttribute('id') != '')) {
			m[i].style.display = 'none';
			m[i].className = 'nocurrent';
		}
		
	}
}

function show(id) {
	hideall();
	document.getElementById(id).style.display = '';
//	ahref.className = 'current';
//	alert(ahref.getAttribute('title'));
//	return true;
}

function curr(ahref) {

//	alert(ahref.getAttribute('id'));
//	document.getElementById(ahref.getAttribute('id')).className = 'current';
	var ah = document.getElementById('topLinks').getElementsByTagName('A');

	for (var i = 0; i < ah.length; i++) {
		ah[i].className = '';		
	}

	ahref.className = 'current';
//	alert(id);
//	alert(ahref.className);
}

function target() {
	var ta = document.getElementById('content').getElementsByTagName('A');

	for (var i = 0; i < ta.length; i++) {
		ta[i].setAttribute('target','_content');
	}
}
