var bNav=false;

function getBrowser()
{
	fAppVersion = parseFloat( navigator.appVersion );
	sUserAgent = navigator.userAgent.toLowerCase();
	sAppName = navigator.appName.toLowerCase();
	fNavigatorVersionOK = 4.0;
	if( sAppName.indexOf( "netscape" ) > -1 && sUserAgent.indexOf( "gecko" ) < 0 )
	{
		if ( fAppVersion >= fNavigatorVersionOK && fAppVersion < 5.0 )
			bNav = true;
	}
}

//Schauen ob in MainFrame (wichtig z.B. für Suchmaschinen), wenn nein, dann in MainFrame laden
function openInMainFrame()
{
	if ( !window.parent.frames.length )
	{
		ind = location.href.lastIndexOf('/');
		path = location.href.substr(0, ind+1);
		doc = location.href.substr(ind+1);
		
		indhtm = 'index.htm';
		if ( doc.search(/_es.htm|_spanisch.htm/) != -1)
			indhtm = 'index_es.htm';
			
		if ( doc.search(/^top.htm$|^top_es.htm$|^left.htm$|^left_es.htm$|^left1.htm$|^home.htm$|^home_es.htm$|^home_spanisch.htm$/) != -1 )
			newDoc = path + indhtm;
		else
			newDoc = path + indhtm + '?' + doc;
			
		location.href = newDoc;
	}
}


function switchLang( lang_code )
{
	win = window.parent.frames["main"];
	if ( win )
	{
		ind = win.location.href.lastIndexOf('/');
		path = win.location.href.substr(0, ind+1);
		doc = win.location.href.substr(ind+1);

		bookm = "";
		ind = doc.lastIndexOf('#');
		if ( ind > 0 )
		{
			bookm = doc.substr(ind);
			doc = doc.substr( 0, ind-1 );;
		}
		
		doc = doc.substr( 0, doc.lastIndexOf('.') );;		
		
		docOhneNc = doc;
		if ( doc.search(/_es$/) != -1 )
		{
			ind = doc.lastIndexOf('_');
			docOhneNc = doc.substr(0,ind);
		}
			
		newDoc = path;
		if ( lang_code == 'es' )
			newDoc += docOhneNc + '_' + 'es.htm' + bookm;
		else 
			newDoc += docOhneNc + '.htm' + bookm;
			
		//alert( path + "\n" + doc + "\n" + docOhneNc + "\n" + newDoc + "\n" + bookm);
			
		window.parent.location = newDoc;
	}	
}


function newWin(theURL,winName,features) 
{
  win = window.open(theURL,winName,features);
  win.focus();
}


function wri( str )
{
	str = str.replace(/\%40/g,'@');
	str = str.replace(/\%60/g,'<');
	str = str.replace(/\%2e/ig,'.');
	str = str.replace(/\%3a/ig,':');
	document.write( str );
}