<!--

///////////////////////////////////////////////////////////////////////////////////////////////////
// Code that runs each time the page is loaded

if (document.getElementById)
{
	document.write('<style type="text/css">')
	document.write('.switchcontent{display:none;}')
	document.write('.dropdownboxHighlight{ color: #000000; font-size: 10px; font-family: Arial, Helvetica, sans-serif; font-weight: normal; background-color: #d1e8ff }')
	document.write('.dropdownboxLinks{ color: #000000; font-size: 10px; font-family: Arial, Helvetica, sans-serif; font-weight: normal; }')
	document.write('</style>')
}

if (window.addEventListener)
	window.addEventListener("load", do_onload, false)

else if (window.attachEvent)
	window.attachEvent("onload", do_onload)

else if (document.getElementById)
	window.onload=do_onload


///////////////////////////////////////////////////////////////////////////////////////////////////
// Functions

function displayLanguageMenu(sSection)
{

	if(sSection == "")
		sSection = "langnav"

	document.write('<a href="" class="contentBoxLinks" onClick="expandcontent(\'' + sSection + '\'); return false;" style="cursor: pointer;">');
	document.write('<img name="toolsfolder" src="/icons/closed_folder.gif" alt="" border="0" height="13" hspace="3" width="15">Translated Abstracts</a><br>');
	document.write('<table cellpadding="0" cellspacing="0">');
  	document.write('<tbody><tr>');
	document.write('<td><span id="' + sSection + '" class="switchcontent">');

	if(abstractUrlMap.german_abstract != "")
  		document.write('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="' + abstractUrlMap.german_abstract + '" class="dropdownboxLinks" id="german_abstract">Deutsch</a><br>');

  	if(abstractUrlMap.spanish_abstract != "")
  		document.write('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="' + abstractUrlMap.spanish_abstract + '" class="dropdownboxLinks" id="spanish_abstract">Espaņol </a><br>');

	if(abstractUrlMap.french_abstract != "")
  		document.write('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="' + abstractUrlMap.french_abstract + '" class="dropdownboxLinks" id="french_abstract">Fran&ccedil;ais</a><br>');

	if(abstractUrlMap.italian_abstract != "")
  		document.write('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="' + abstractUrlMap.italian_abstract + '" class="dropdownboxLinks" id="italian_abstract">Italiano</a>');

  	document.write('</span></td>');
  	document.write('</tr>');
	document.write('</tbody></table>');

	if(abstractUrlMap.current != "" && abstractUrlMap.current != "english_abstract")
		setMenuHighlight(abstractUrlMap.current, sSection);
}


function setMenuHighlight(sId, sSection)
{

	// Set the rest back to normal
	if(abstractUrlMap.german_abstract != "")
		document.getElementById("german_abstract").className = "dropdownboxLinks";

	if(abstractUrlMap.spanish_abstract != "")
		document.getElementById("spanish_abstract").className = "dropdownboxLinks";

	if(abstractUrlMap.french_abstract != "")
		document.getElementById("french_abstract").className = "dropdownboxLinks";

	if(abstractUrlMap.italian_abstract != "")
		document.getElementById("italian_abstract").className = "dropdownboxLinks";

	// Change to highlighted
	document.getElementById(sId).className = "dropdownboxHighlight";
	
	// Show the menu open
	document.toolsfolder.src="/icons/open_folder.gif";
	
	// Show the menu
	document.getElementById(sSection).style.display = "block";

}

function getElementbyClass(classname)
{
	ccollect=new Array()
	var inc=0
	var alltags=document.all? document.all : document.getElementsByTagName("*")
	for (i=0; i<alltags.length; i++)
	{
		if (alltags[i].className==classname)
			ccollect[inc++]=alltags[i]
	}
}

function contractcontent(omit)
{
	var inc=0
	while (ccollect[inc])
	{
		if (ccollect[inc].id!=omit)
		ccollect[inc].style.display="none"
		inc++
	}
}

function expandcontent(cid)
{
	if (typeof ccollect!="undefined")
	{
		document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"

		//switch in open folder when expanded and close when closed

		document.toolsfolder.src="/icons/closed_folder.gif"

		if (document.getElementById(cid).style.display=="block")
		{
			document.toolsfolder.src="/icons/open_folder.gif"
		}
	}
}

function saveswitchstate()
{
	var inc=0, selectedItem=""
	while (ccollect[inc])
	{
		if (ccollect[inc].style.display=="block")
		selectedItem+=ccollect[inc].id+"|"
		inc++
	}
}


function do_onload()
{
	getElementbyClass("switchcontent")
}

function setURL(sId, sUrl)
{
	document.getElementById(sId).href = sUrl;
}


// End -->
