function importJS(path)
{
	document.write("<");
	document.write("SCRIPT type='text/javascript' language='JavaScript' src='" + path + "'");
	document.write("></");
	document.write("SCRIPT>\n");
}

importJS ("js/prototype.lite.js");
importJS ("js/moo.fx.js");
importJS ("js/moo.fx.pack.js");
importJS ("js/ajax.js");
var exists;
var allStretch;

//the main function, call to the effect object
function init()
{
	var divs = document.getElementsByClassName("stretcher");
	allStretch = new fx.MultiFadeSize(divs, {duration: 400});

	items = document.getElementsByClassName("display");
	for (i = 0; i < items.length; i++)
	{
		var h3 = items[i];
		div = h3.nextSibling;
		h3.title = h3.className.replace("display ", "");

		if (window.location.href.indexOf(h3.title) < 0)
		{
			allStretch.hide(div, 'height');
			if (exists != true) exists = false;
		}
		else
		{
			exists = true;
			items[i].className = "display active";
			var href = location.href;
			var index = href.lastIndexOf("+");
			if (index > 0)
			{
				var idDoc = href.substr(index + 1);
				getContent(idDoc);
			}
		}

		h3.onclick = function()
		{
			allStretch.showThisHideOpen(this.nextSibling, 200, 'height');
			activate(this);
		}
	}
	if (exists == false)
	{
		$('menu').childNodes[1].fs.toggle('height');
		items[0].className = "display active";
		location.hash = items[0].title;
	}
}

function activate(active)
{
	var items = document.getElementsByClassName("display");

	for (var i=0; i<items.length; i++)
	{
		items[i].className = "display";
	}
	
	active.className = "display active";
}