var fonster = null;
var x = 0; var y = 0;
if(parseInt(navigator.appVersion) > 3) {
x = (screen.availWidth - 500) / 2; y = (screen.availHeight - 460) / 2;
}



function oppna(url, width, height) {
x = screen.width;
y = screen.height;
if(parseInt(navigator.appVersion) > 3 || navigator.appName == 'Netscape') {
if(!fonster || fonster.closed) {


fonster = window.open('',"subwin","top=" + parseInt(y/2-height/2-16) + ",left=" + parseInt(x/2-width/2-5) + ",width=" + width + ",scrollbars,height=" + height);

fonster.location.href = url;
fonster.focus();
} else {
fonster.location.href = url;
fonster.focus();
}
}else{
location.href = url;
 }
}


function oppna_custom(url, width, height) {
x = screen.width;
y = screen.height;
if(parseInt(navigator.appVersion) > 3 || navigator.appName == 'Netscape') {
if(!fonster || fonster.closed) {


fonster = window.open('',"subwin","top=" + parseInt(y/2-height/2-16) + ",left=" + parseInt(x/2-width/2-5) + ",width=" + width + ",scrollbars=no,height=" + height);

fonster.location.href = url;
fonster.focus();
} else {
fonster.location.href = url;
fonster.focus();
}
}else{
location.href = url;
 }
}


function formPopup(target,properties){

	winy=180;
	winx=300;
	h=winy;
	w=winx;

	var x = 0; var y = 0;
	x = (screen.availWidth - winx) / 2; y = (screen.availHeight - winy) / 2;

        var myWin=window.open("", 'foo', 'scrollbars=no,height= ' + h + ',width=' + w + ',top=' + y + ',left=' + x);
	myWin.focus();
	return true;
}

function toggle(n) {
	var ie = /*@cc_on!@*/false;
	var obj = document.getElementById('node_' + n);
	var subMenu = document.getElementById('sub_' + n);
	if (ie) {
		var current = obj.className;
		obj.className = (current == 'div-lvl-3') ? 'div-lvl-3-open' : 'div-lvl-3';
		if (subMenu) subMenu.style.display = (current == 'div-lvl-3') ? 'block' : 'none';
	} else {
		var current = obj.getAttribute('class');
		var current = (current == 'div-lvl-3') ? 'div-lvl-3-open' : 'div-lvl-3';
		obj.setAttribute('class', current);
		if (subMenu) subMenu.style.display = (current == 'div-lvl-3') ? 'none' : 'block';
	}
	return false;
};
