/*	Site: www.m2m.-net.de / Author: Andreas Sternak / Date: 2001-08-01 */
																		  
var ie=false, ie4=false, ns4=false, ns6=false; 
var loadstring = '<script language=\"JavaScript1.2\" type=\"text/javascript\" src=\"';


//	determine the browser we are runnig on and include appropriate js-scripts
function init(level,file,flag)
{
	ver   = navigator.appVersion;		 
	agent = navigator.userAgent; 
	if (!file) file = 'index.html';	
	if (!flag) flag = false;
	if (navigator.appName.indexOf('Microsoft') >=0) 
	{
		ie=true;	 
		if (ver.indexOf('MSIE 4.') >=0) ie4=true;
		if (level) loadstring = loadstring+level;
		loadstring = loadstring + 'lib/x-api-ie.js\"></script>';
	}		
	if (navigator.appName.indexOf('Netscape') >=0)
	{
		if (agent.indexOf('Mozilla/4.') >=0)
		{
			ns4=true;
			if (level) loadstring = loadstring+level;
			loadstring = loadstring + 'lib/x-api-ns4.js\"></script>'; 
		}			
		if (agent.indexOf('Mozilla/5.') >=0)
		{
			ns6=true;				 
			if (level) loadstring = loadstring+level;
			loadstring = loadstring + 'lib/x-api-ns6.js\"></script>';
		}
	}
	document.write(loadstring);
	document.onselectstart = doNothing;				// prevents text-selections
	function doNothing()
	{
		return false;
	}
	// check whether frameset exists in order to restore frame-pages
	if ((parent.nav && parent.content && parent.logo && parent.bottom) || flag) return;
	else window.location.href = file;
}


// opens a new window; in case an open window already exists, this is being used
function newWin(file, w, h)
{
	if (!w) w = 540;
	if (!h) h = 400;
	nwin = 
	window.open(file,'','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width='+w+',height='+h);
	// set popup's relative position
	if (ie)
	{	
		parentx = parent.window.screenLeft;
		parenty = parent.window.screenTop;	
	}
	if (ns4)
	{
		parentx = parent.window.screenX;
		parenty = parent.window.screenY;
	}
	nwin.moveTo(parentx+15,parenty+65);
	nwin.focus();
}	


// display submenu-content with number "which"
function displayContent(which)
{
	window.focus();
	hide('text');
	for (i=1; exists('content0'+i); i++) 
	{
		hide('content0'+i);	 
		hide('title0'+i);	
	}
	hide('scrolldown215'); hide('scrollup215'); hide('scrollbar215');	hide('scrolldots215');
	hide('scrolldown240'); hide('scrollup240'); hide('scrollbar240');	hide('scrolldots240');
	clearSubcontent(which);
	show('content'+which);		 
	show('title'+which);
}	


// display submenu-content with number "which"
function displaySubContent(which)
{
	window.focus();
	hide('text');
	for (i=1; exists('content0'+i); i++) 
	{
		hide('content0'+i);
		hide('title0'+i);	
	}
	// hide previously visible elements
	for (i=1; exists('content0'+i+'1'); i++) 
	{
		for (j=1; exists('content0'+i+j); j++)
		{
			hide('content0'+i+j);
			hide('title0'+i+j); 
			hide('picture0'+i+j);
		}
	}			
	hide('scrolldown215'); hide('scrollup215'); hide('scrollbar215');	hide('scrolldots215');
	hide('scrolldown240'); hide('scrollup240'); hide('scrollbar240');	hide('scrolldots240');
 	hide('scrolldown'); hide('scrollup');
	// display current elements
	show('content'+which);		 
	show('title'+which);
}	 
 
 
// wipes submenu-content with id "which" from screen
function clearSubcontent(which)
{
	for (i=1; exists('title'+which+i); i++)
	{
		hide('title'+which+i);
		hide('content'+which+i); 
		hide('picture'+which+i);	 
	}
}


// display layer with id "which" in order to show picture
function showPic(which)
{
	show('picture'+which);
}	