var fsmatrise = new Array;

function CleanMenu() {
	$(".subsub").html('');
	}

function Legend(gruppe) {
	var gruppe;
	var legend = "";
	var grp = '.grp_' + gruppe;
	$('#submeny A').removeClass('sekundar');
	$('#subsubmeny').hide('slow');
	$('.matrise').hide('slow');
	$('.linker').hide('slow');
	$(grp).show('slow');
	}

function Interiorlink() {
	$('#subsubmeny').show('slow');
	$('#submeny A').addClass('sekundar');
	$('interior').removeClass('sekundar');
	}
/* function matriseOpp() {
      $(this).find("IMG").animate({ 
        width: "100px",
        height: "200px",
        left: "0px",
        top: "0px", 
        borderWidth: "4px"
      }, 1500 );
      alert('this is ' + this + $(this).attr('id'));
    //  $(this).animate({ borderWidth: "10px" }, 1500);
    };
*/

function forsidematrisesetup() {
	// fsmatrise = jQuery.makeArray($("#pool").children());
	var pool = new Array;
	pool = $("#pool").html().split("@");
//	alert (pool.length);
	var node;
	for(i=0; i<pool.length; i++) {
		node = pool[i];
		if (node.length > 1) { fsmatrise.push(node); }
		}
	// $("#pool *").children().each(function(e,val) { alert(val.html());fsmatrise.push($(this).html()); });
	// alert(fsmatrise[7]);
	forsidematrisebytt();
	}

function forsidematrisebytt() {
	var rute = Math.floor(Math.random()*8);
	var rute = ('ramme' + rute);
	var nytt = fsmatrise.pop();
	fsmatrise.unshift($("#"+rute).html());
	// alert(nytt);
	//alert(fsmatrise.pop);
	$("#"+rute).fadeOut("fast", function() { $("#"+rute).html(nytt);$("#"+rute).fadeIn("fast")} );
	var t=setTimeout("forsidematrisebytt()",2000);
	}
