<!--

///////////////////////////////////////////////////////////////////////////////////////////////////
// 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 PDFs</a><br>');
	document.write('<table cellpadding="0" cellspacing="0">');
  	document.write('<tbody><tr>');
	document.write('<td><span id="' + sSection + '" class="switchcontent">');

	if(pdfUrlMap.spanish_pdf != "")
  		document.write('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="' + pdfUrlMap.spanish_pdf + '" class="dropdownboxLinks" id="spanish_pdf">Spanish</a><br>');

  	if(pdfUrlMap.polish_pdf != "")
  		document.write('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="' + pdfUrlMap.polish_pdf + '" class="dropdownboxLinks" id="polish_pdf">Polish </a><br>');

	if(pdfUrlMap.hungarian_pdf != "")
  		document.write('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="' + pdfUrlMap.hungarian_pdf + '" class="dropdownboxLinks" id="hungarian_pdf">Hungarian</a><br>');

	if(pdfUrlMap.russian_pdf != "")
  		document.write('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="' + pdfUrlMap.russian_pdf + '" class="dropdownboxLinks" id="russian_pdf">Russian</a><br>');

	if(pdfUrlMap.chinese_pdf != "")
  		document.write('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="' + pdfUrlMap.chinese_pdf + '" class="dropdownboxLinks" id="chinese_pdf">Chinese</a><br>');

	if(pdfUrlMap.turkish_pdf != "")
  		document.write('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="' + pdfUrlMap.turkish_pdf + '" class="dropdownboxLinks" id="turkish_pdf">Turkish</a><br>');
	
	if(pdfUrlMap.italian_pdf != "")
                document.write('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="' + pdfUrlMap.italian_pdf + '" class="dropdownboxLinks" id="italian_pdf">Italian</a><br>');

	if(pdfUrlMap.romanian_pdf != "")
                document.write('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="' + pdfUrlMap.romanian_pdf + '" class="dropdownboxLinks" id="romanian_pdf">Romanian</a><br>');

	if(pdfUrlMap.french_pdf != "")
                document.write('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="' + pdfUrlMap.french_pdf + '" class="dropdownboxLinks" id="french_pdf">French</a><br>');

	if(pdfUrlMap.japanese_pdf != "")
                document.write('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="' + pdfUrlMap.japanese_pdf + '" class="dropdownboxLinks" id="japanese_pdf">Japanese</a><br>');

	if(pdfUrlMap.german_pdf != "")
                document.write('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="' + pdfUrlMap.german_pdf + '" class="dropdownboxLinks" id="german_pdf">German</a><br>');

	if(pdfUrlMap.czech_pdf != "")
                document.write('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="' + pdfUrlMap.czech_pdf + '" class="dropdownboxLinks" id="czech_pdf">Czech</a>');

  	document.write('</span></td>');
  	document.write('</tr>');
	document.write('</tbody></table>');

	if(pdfUrlMap.current != "" && pdfUrlMap.current != "english_pdf")
		setMenuHighlight(pdfUrlMap.current, sSection);
}


function setMenuHighlight(sId, sSection)
{

	// Set the rest back to normal
	if(pdfUrlMap.spanish_pdf != "")
		document.getElementById("spanish_pdf").className = "dropdownboxLinks";

	if(pdfUrlMap.polish_pdf != "")
		document.getElementById("polish_pdf").className = "dropdownboxLinks";

	if(pdfUrlMap.hungarian_pdf != "")
		document.getElementById("hungarian_pdf").className = "dropdownboxLinks";

	if(pdfUrlMap.russian_pdf != "")
		document.getElementById("russian_pdf").className = "dropdownboxLinks";
	if(pdfUrlMap.chinese_pdf != "")
		document.getElementById("chinese_pdf").className = "dropdownboxLinks";

	if(pdfUrlMap.turkish_pdf != "")
		document.getElementById("turkish_pdf").className = "dropdownboxLinks";

	if(pdfUrlMap.italian_pdf != "")
                document.getElementById("italian_pdf").className = "dropdownboxLinks";

	if(pdfUrlMap.romanian_pdf != "")
                document.getElementById("romanian_pdf").className = "dropdownboxLinks";

	if(pdfUrlMap.french_pdf != "")
                document.getElementById("french_pdf").className = "dropdownboxLinks";

	if(pdfUrlMap.japanese_pdf != "")
                document.getElementById("japanese_pdf").className = "dropdownboxLinks";

	if(pdfUrlMap.german_pdf != "")
                document.getElementById("german_pdf").className = "dropdownboxLinks";

	if(pdfUrlMap.czech_pdf != "")
                document.getElementById("czech_pdf").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 -->
