function pageset(x)
{
	if (x != 0)
	{
		document.getElementById('navlink'+x).className='navhighlight';
		document.getElementById('navh'+x).style.display="block";
	}
}
function secset(y)
{
	if (y != 0)
	{
		var a = String(y);
		var b = a.substr(0,1);
		document.getElementById('sec_'+b).className='sechighlight';
		document.getElementById('sec_'+a+'_link').className='seclinkhighlight';
		
		if(document.getElementById('sec_'+b+'_exp'))
		{
			document.getElementById('sec_'+b+'_exp').style.display="block";
		}
	}
}

function boxed(z,ow,oh)
{
	var iw = ow - 18;
	var ih = oh - 22;
	if ( z == 'open')
	{
		document.write('<div style="width:'+ow+'px; height:'+oh+'px;">');
		document.write('<div class="tl"></div>');
		document.write('<div class="t" style="width:'+iw+'px;"></div>');
		document.write('<div class="tr"></div>');
		document.write('<div class="l" style="height:'+ih+'px;"></div>');
		document.write('<div class="bb" style="width:'+iw+'px; height:'+ih+'px;">');
	}
	else
	{
		document.write('</div>');
		document.write('<div class="r" style="height:'+ih+'px;"></div>');
		document.write('<div class="bl"></div>');
		document.write('<div class="b" style="width:'+iw+'px;"></div>');
		document.write('<div class="br"></div>');
		document.write('</div>');
	}
}

function roll(a, b)
{
	if(a == "on")
	{
		document.getElementById(b).style.display="block";
	}
	else
	{
		document.getElementById(b).style.display="none";
	}
}

function rolli(r, s)
{
	document.getElementById(r).style.backgroundImage="url("+s+")";
}

function autoheight()
{
	var secheight = document.getElementById('sec').offsetHeight;
	var mainheight = document.getElementById('main').offsetHeight;
	var bodyheight = mainheight;
	if (secheight > mainheight) bodyheight = secheight;
	var wrapperheight = bodyheight + 364;
	document.getElementById('body').style.height = bodyheight + 'px';
	document.getElementById('wrapper').style.height = wrapperheight + 'px';
	document.getElementById('footer').style.top = wrapperheight + 'px';
}

function fisherYates ( myArray ) {
  var i = myArray.length;
  if ( i == 0 ) return false;
  while ( --i ) {
     var j = Math.floor( Math.random() * ( i + 1 ) );
     var tempi = myArray[i];
     var tempj = myArray[j];
     myArray[i] = tempj;
     myArray[j] = tempi;
   }
}
