function catOpen(id){

	if ( document.getElementById( 'fo_' + id ).className == 'open' ) {

		document.getElementById( 'fo_' + id ).className = '';
		document.getElementById( 'al_' + id ).className = 'no';

	} else {

		document.getElementById( 'fo_' + id ).className = 'open';
		document.getElementById( 'al_' + id ).className = 'leafz';

	}

}

function catOpenAll(){

	var mainnodes = document.getElementById('mnode').getElementsByTagName('li');

    for ( var i=0; i<mainnodes.length; i++ ){

	//	if ( mainnodes[i].parentNode.id == 'mnode' && mainnodes[i].id != '' ){

			if ( mainnodes[i].id.indexOf('fo_') != -1 ) {

				var alregexp = mainnodes[i].id;
				alregexp = alregexp.replace("fo","al");

				var vane = 0;
				var leafnodes = document.getElementById( alregexp ).getElementsByTagName('li');
				for ( var j=0; j<leafnodes.length; j++ ){
					if ( leafnodes[j].className == 'open' ){ vane = 1; }
				}
				if ( vane ){
					mainnodes[i].className = 'open';
				}

			}
			if ( mainnodes[i].id.indexOf('al_') != -1 ) {

				var vane = 0;
				var leafnodes = document.getElementById( mainnodes[i].id ).getElementsByTagName('li');
				for ( var j=0; j<leafnodes.length; j++ ){
					if ( leafnodes[j].className == 'open' ){ vane = 1; }
				}
				if ( vane ){
					mainnodes[i].className = 'leafz';
				}

		//	}

		}

	}

}

function mmail(a){a.href=a.href.replace(/@KUKAC/g,"@");return true;}
function mstatus(a,b){if (b){window.status=a.href.replace(/@KUKAC/g,"@");} else {window.status="";}}

function picOpen(a,b,c){
	var c = c.split("x");
	popup_left = ( screen.width -  c[0] ) / 2 - 20;
	popup_top  = ( screen.height - c[1] ) / 2 - 20;
	open ("pre/picopen.html?" + a + "--pre--" + b,'fnet_pic','width=' + c[0] + ',height=' + c[1] + ',top='+popup_top+',left='+popup_left+',location=no,menubar=no,status=no,titlebar=no,resizable=no,scrollbars=no,toolbar=no');
}
