function showElement(elementname)
{
	document.getElementById(elementname).style.display='block';
}

function hideElement(elementname)
{
	document.getElementById(elementname).style.display='none';
}

function createPrintVersion()
{
	hideElement('headtab');
	hideElement('lefttab');
	hideElement('print');
	document.body.style.backgroundImage='url()';
	document.getElementById('maintab').style.marginLeft = '0px';
	document.getElementById('shadowLeft').style.cssFloat = 'left';

	/*@cc_on
		@if (@_jscript_version <= 5.6)
				document.getElementById("maintab").style.top = '0px';
		@end
	@*/
}

function showPrintVersion(url)
{
	// Open popup
	var popup = window.open(url);

	// Focus popup
//	popup.focus();
}

//Bildertausch
function bt(wohin,was){document.images[wohin].src=was}

//Bildertausch Menue
function changePic(wohin,was)
{bt(wohin, eval(was).src)};

/**
 *	Shows the specified gallery and image.
 */
function showGalerie(galerie,bild)
{
	// ... done
	openPopup("galerie_schule.jsp?gid=" + galerie + "&bid=" + bild,"Galerie"+galerie,540,540);
}

/**
 *	Attempts to show the video-popup.
 */
function showVideoPopup(iWidth,iHeight)
{
	// ... done
	openPopup("video.jsp","Video",iWidth,iHeight,"no","no","no");
}

/**
 *	Attempts to show the quiz-popup.
 */
function showQuizPopup()
{
	// ... done
	openPopup("quiz/index.jsp","Quiz",640,380,"no","no","no");
}

/**
 *	Opens a popup-window with the specified url,name and size.
 */
function openPopup(url,name,cx,cy,scrollbars,resizable,menubar)
{
	// Test
	if( scrollbars != "no" && scrollbars != "yes" && scrollbars != "auto" )
		scrollbars = "yes";

	// Test
	if( resizable != "no" && resizable != "yes" )
		resizable = "yes";

	// Test
	if( menubar != "no" && menubar != "yes" )
		menubar = "no";

	// Calculate coordinates
	var x  = ( screen.availWidth  - cx ) / 2;
	var y  = ( screen.availHeight - cy ) / 2;

	// Open popup
	var popup = window.open(url,name,"width=" + cx + ",height=" + cy + ",screenX=" + x + ",screenY=" + y + ",top=" + y + ",left=" + x + ",toolbar=no,location=no,directories=no,status=no,menubar=" + menubar + ",resizable=" + resizable + ",dependent=no,scrollbars=" + scrollbars);

	// Focus popup
	popup.focus();

	// ... done
	return popup;
}

function logout()
{
	// Test
	if( confirm('M\xF6chten Sie sich wirklich ausloggen?') == true )
	{
		// ... done
		window.location.href = "index.jsp?user.logout=yes";
	}
}

function showMenu()
{
	showElement("menu-sub");
	hideElement("menu-sub-replacer");
}

function hideMenu()
{
	hideElement("menu-sub");
	showElement("menu-sub-replacer");
}
