<!-- Original:  Fredrik Fridsten (fredrik.fridsten@home.se) -->
<!-- Web Site:  http://hem.passagen.se/dred -->

<!-- This script and many more are available free online at -->
<!-- The Javascript Source!! http://javascript.internet.com -->

<!-- Begin
var numtexts = 6; // Number of texts

var titlearray = new Array(); // An array for the title objects
var subtextarray = new Array(); // An array for the subtext objects
var titlepos = new Array(); // An array for the title objects
var subtextpos = new Array(); // An array for the subtext objects

if (document.layers) { // Set visibility for NN and IE
	visible = 'show';
	hidden = 'hide';
}
else 
{
	visible = 'visible';
	hidden = 'hidden';
}
// Fills the arrays with title and subtext objects
for (var i = 0; i < numtexts; i++) {
	titlearray[i] = ('title' + i);
	subtextarray[i] = ('subtext' + i);
	titlepos[i] = (90 + (25 * i));
	subtextpos[i] = (115 + (25 * i));
}
// Changes image when category is clicked
function picopen(n) {
	title = ('title' + n);
	pic = ('pic' + n);
	if (document.layers) 
	{
		document.layers[title].document.images[pic].src = "../images/opened.gif";
	}
	else 
	{
		document.all(pic).src = "../images/opened.gif";
   	}
}
function picclose(n) {
	title = ('title' + n);
	pic = ('pic' + n);
	if (document.layers) 
	{
		document.layers[title].document.images[pic].src = "../images/closed.gif";
	}
	else 
	{
		document.all(pic).src = "../images/closed.gif";
   	}
}

function toggle(n,move) {
	text = ('subtext' + n);
	if (document.layers) 
	{
		subtext = document.layers[text];
	}
	else 
	{
		subtext = document.getElementById(text).style;
	}
	if (subtext.visibility == visible) {
		subtext.visibility = hidden;
		picclose(n);
		for (var i = (n+1); i < numtexts; i++) {
			titlepos[i] -= move;
			subtextpos[i] -= move;
			if (document.layers) 
			{
				document.layers[titlearray[i]].top = titlepos[i] + "px";
				document.layers[subtextarray[i]].top = subtextpos[i] + "px";
			}	
			else 
			{
				document.getElementById(titlearray[i]).style.top = titlepos[i] + "px";
				document.getElementById(subtextarray[i]).style.top = subtextpos[i] + "px";
		    }
   		}
	}
	else {
		subtext.visibility = visible;
		picopen(n);

		for (var i = (n+1); i < numtexts; i++) {
			titlepos[i] += move;
			subtextpos[i] += move;
			if (document.layers) 
			{
				document.layers[titlearray[i]].top = titlepos[i] + "px";
				document.layers[subtextarray[i]].top = subtextpos[i] + "px";
			}
			else 
			{
				document.getElementById(titlearray[i]).style.top = titlepos[i] + "px";
				document.getElementById(subtextarray[i]).style.top = subtextpos[i] + "px";
	     	}
   		}
	}
	lasttext = subtext;
}

function detailClose(n,move) {
	text = ('subtext' + n);
	if (document.layers) 
	{
		subtext = document.layers[text];
	}
	else 
	{
		subtext = document.getElementById(text).style;
	}
	if (subtext.visibility == visible) {
		subtext.visibility = hidden;
		picclose(n);
		for (var i = (n+1); i < numtexts; i++) {
			titlepos[i] -= move;
			subtextpos[i] -= move;
			if (document.layers) 
			{
				document.layers[titlearray[i]].top = titlepos[i] + "px";
				document.layers[subtextarray[i]].top = subtextpos[i] + "px";
			}	
			else 
			{
				document.getElementById(titlearray[i]).style.top = titlepos[i] + "px";
				document.getElementById(subtextarray[i]).style.top = subtextpos[i] + "px";
		    }
   		}
	}
	lasttext = subtext;
}

function setStyleTop ()
{
		for (var i = 0; i < numtexts; i++) {
			if (document.layers) 
			{
				document.layers[titlearray[i]].top = titlepos[i] + "px";
				document.layers[subtextarray[i]].top = subtextpos[i] + "px";
			}	
			else 
			{
				document.getElementById(titlearray[i]).style.top = titlepos[i] + "px";
				document.getElementById(subtextarray[i]).style.top = subtextpos[i] + "px";
		    }
   		}
}
 
<!--
var i=0;
var ie=(document.all)?1:0;
var ns=(document.layers)?1:0;
function initStyleElements()
{var a = document.pad;
if (ie)
{
a.text.style.backgroundColor="#000080";
a.submit.style.backgroundColor="#C0C0A8";
a.submit.style.cursor="hand";
a.clear.style.backgroundColor="#C0C0A8";
a.clear.style.cursor="hand";
}
else return;
}
function LightOn(what)
{
if (ie) what.style.backgroundColor = '#E0E0D0';
else return;
}
function LightOff(what)
{if (ie) what.style.backgroundColor = '#C0C0A8';
else return;
}
-->
//  End -->
