function init(){
	setMenu();
	ChangeAnchors();
}

function setMenu(){ // to current URL
	items = document.getElementById( 'sidebar').children;
	for( i=0; i<items.length; i++){
		if( items[i].href == document.URL){
			items[i].setAttribute( "id", "current");
		}
	}
}

/* changes link target for the 'new_win' class links  to open a new window or a new tab */
function ChangeAnchors() {
	var elements = document.getElementsByTagName( "a");
	for( var i = 0; i < elements.length; i++) {
		if( elements[i].className == "new_win") {
			elements[i].onclick = function() {
					window.open( this.href ,"myWin");
					return false;
			};
		}
	}
}

window.onload = init;
