// JavaScript Document

function getElementsByClass( searchClass, domNode, tagName) {
	if (domNode == null) domNode = document;
	if (tagName == null) tagName = '*';
	var el = new Array();
	var tags = domNode.getElementsByTagName(tagName);
	var tcl = " "+searchClass+" ";
	for(i=0,j=0; i<tags.length; i++) {
		var test = " " + tags[i].className + " ";
		if (test.indexOf(tcl) != -1)
			el[j++] = tags[i];
	}
	return el;
}
 
function mouseRollIn(obj,type)
{
	switch (type)
	{
		case 1: obj.style.backgroundColor='#bbaacc'; break;
		case 2: obj.style.textDecoration='underline'; break;
	}	
}

function mouseRollOut(obj,type)
{
	switch (type)
	{
		case 1: obj.style.backgroundColor=''; break;
		case 2: obj.style.textDecoration='none'; break;
	}	
}

function newWindow(mypage) 
{
	var winl = (screen.width/8);
	var wint = (screen.height);
	var windowtitle = "PDF";
	//var hh = screen.height - 100;
	var hh = 750;
	
	//var ww = screen.width/1.25;
	var ww = 620;
	if (winl < 0) winl = 0;
	if (wint < 0) wint = 0;
	var settings = 'height=' + hh + ',';
	settings += 'width=' + ww + ',';
	settings += 'top=' + 10 + ',';
	settings += 'left=' + winl + ',';
	settings += ' resizable=yes, scrollbars=yes';
	win = window.open(mypage,'newwindow',settings);
	win.document.open("text/html");
	win.document.write("<html style=\"height: 100%\"><head><title>"+windowtitle+"<\/title><\/head><body style=\"margin: 0; height: 100%\"><iframe src=\""+mypage+"\" width=\"100%\" height=\"100%\">Alternativinhalt<\/iframe><\/body><\/html>");  
	win.window.focus();
	win.document.close();  
}

function subMenuGen(subMenuText,pageTag,Lang)
{
	var color, useColor;
	document.writeln('<tr>');
	for(i=0;i<subMenuText.length;i++)
	{
		if(pageTag == i+1)
			document.writeln('<td class="subMenu" style="background-color:#cccccc; color:#000000;">'+subMenuText[i][0]+'</td>');
		else
			document.writeln('<td class="subMenu" onmouseover="mouseRollIn(this,1);" onmouseout="mouseRollOut(this,1);" onclick="window.location=\''+subMenuText[i][1]+'\'">'+subMenuText[i][0]+'</td>');
	}
    document.writeln('</tr>');
}


function getlevel(level)
{
	tmp="";
	for (var j=0;j<level;j++) tmp += "../" 

	return tmp;
}

