

function preload()

{

	// get the elements
	var imgmenu=document.getElementById('bgmenu');
	var imgs=imgmenu.getElementsByTagName('a');
	
	// create the flash object
	var so = new SWFObject("/assets/swf/bg.swf", "background", "800", "600", "8", "#FFFFFF");
	so.addParam('wmode','opaque');
	so.addParam('quality','best');
	// loop through the links
	for(var i=0;i<imgs.length;i++)
		so.addVariable('image'+(i+1),imgs[i].href);
	so.addVariable('randomslideshow','true');
	so.write("bg");
	
	// remove the HTML menu
	imgmenu.parentNode.removeChild(imgmenu);
	
	window.onload=function()
	{
		// plus minus button on content area
		var con=document.getElementById('content');
		var a=document.createElement('a');
		a.appendChild(document.createTextNode('-'));
		a.href="javascript:void(0);";
		a.onclick=closecontentarea;
		a.onfocus=unfocus;
		a.className="pluslink";
		con.insertBefore(a,con.firstChild);
	}
}

function closecontentarea(e)
{
		var te=null; // target element
		if(typeof e.target != 'undefined')
			te=e.target;
		else
			te=e.srcElement;
		while(te.nodeType==3 && te.parentNode!= null)
			te=te.parentNode;

	te.innerHTML='+';
	te.onclick=opencontentarea;
	document.getElementById('content').className='closed';
}
function opencontentarea(e)
{
		var te=null; // target element
		if(typeof e.target != 'undefined')
			te=e.target;
		else
			te=e.srcElement;
		while(te.nodeType==3 && te.parentNode!= null)
			te=te.parentNode;
			
	te.innerHTML='-';
	te.onclick=closecontentarea;
	document.getElementById('content').className='';
}
function unfocus(e)
{
		var te=null; // target element
		if(typeof e.target != 'undefined')
			te=e.target;
		else
			te=e.srcElement;
		while(te.nodeType==3 && te.parentNode!= null)
			te=te.parentNode;
			
	te.blur();
}
