// quick navigation
function MM_jumpMenu(targ,selObj,restore)
{
	//v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}

// set height of shadow layer to the height of the container layer
function shadowSetHeight()
{
	if(document.getElementById)
	{
		// only set height if the content is bigger than 100% of the screen
		if(document.getElementById('container').offsetHeight >= document.getElementById('book_shadow').offsetHeight)
		{
			document.getElementById('book_shadow').style.height = document.getElementById('container').offsetHeight + 'px';
		}
		
		// if book block is higher than container, set the shadow height after book block
		if((document.getElementById('book_block').offsetHeight+60) >= document.getElementById('container').offsetHeight)
		{
			document.getElementById('book_shadow').style.height = document.getElementById('book_block').offsetHeight+100 + 'px';
		}
	}
}

// third_content layer visibility
function thirdContentVisibility(iState) // bool true = show, false = hide
{
   	if(iState)
    {
		document.getElementById('third_content').style.display = 'block';
		
		// show/hide link
		document.getElementById('horizontal_hide').style.display = 'block';
		document.getElementById('horizontal_show').style.display = 'none';
	}
	else
	{
		document.getElementById('third_content').style.display = 'none';
		
		// show/hide link
		document.getElementById('horizontal_show').style.display = 'block';
		document.getElementById('horizontal_hide').style.display = 'none';
	}
}

// book layer visility
function book(iState) // bool true = show, false = hide
{
	//var sPage = window.location.pathname.substring(window.location.pathname.lastIndexOf('/') + 1);
	
	if(iState)
	{
		document.getElementById('book_shadow').style.display = 'block';
		document.getElementById('book_block').style.display = 'block';
		
		// ie fix, hides the quick navigation dropdown & also hide the menu
		document.getElementById('quickNav').style.visibility = 'hidden';
		document.getElementById('menu').style.visibility = 'hidden';
	
		shadowSetHeight();
	
		// hide flash on the firstpage
		//if(sPage == "index.php")
			document.getElementById('flashcontent').style.display = 'none';
	}
	else
	{
		document.getElementById('book_shadow').style.display = 'none';
		document.getElementById('book_block').style.display = 'none';
		
		document.getElementById('quickNav').style.visibility = 'visible';
		document.getElementById('menu').style.visibility = 'visible';
		
		// show flash
		//if(sPage == "index.php")
			document.getElementById('flashcontent').style.display = 'block';
	}
}

// book_main2 layer visibility
function bookMain2Visibility(iState) // bool true = show, false = hide
{
   	if(iState)
    {
		document.getElementById('book_main2').style.display = 'block';
		
		// show/hide link
		document.getElementById('book_horizontal_hide').style.display = 'block';
		document.getElementById('book_horizontal_show').style.display = 'none';
	}
	else
	{
		document.getElementById('book_main2').style.display = 'none';
		
		// show/hide link
		document.getElementById('book_horizontal_show').style.display = 'block';
		document.getElementById('book_horizontal_hide').style.display = 'none';
	}
	
	shadowSetHeight();
}

// submit a form
function submitForm(id) { document.getElementById(id).submit(); }

// clear a form
function clearForm(id) { document.getElementById(id).reset(); }

// preload images for education.php

// display image in education.php
function showImage(image)
{
	document.getElementById('image_big').src = image;
}

// open links with rel="external" in new windows
function linkNewWindow(id)
{
    id.target = "_blank";
}