//Script zum Bestimmen des richtigen Stylesheets
//Copyright ars navigandi GmbH - Johannes Hauf
//Anzulegen sind in /css : 
// win_ns.css, win_ie.css, win_mo.css (Die drei wichtigen Windows Browser)
// mac_ns.css, mac_ie.css, mac_mo.css (Die drei wichtigen MAC-Browser)
// std_ns.css, std_mo.css, std_std.css (NN4.x z.b. Linux, Mozilla z.b. Linux, alles andere)
var bp;
var msg;
/* this class is used to detect os, browser and browser version.
Get the information like this:
bp.platform -> OS
bp.browser -> Browser
bp.version -> Browser version
if the detection fails, the retun will be some standard values (fallback - std, std, '')
You can set Your own strings for the detection so You may use less then 21 stylesheets ;-)
*/

function BP() {
	//Set here the strings for the os identification
	var win = 'win'; //Microsoft Windows; default: win
	var mac = 'mac'; //Macintosh; default: mac
	var lin = 'std'; //Linux; default: lin
	
	//Set the information for the browser identification strings
	var ie = 'ie'; //Internet Explorer; default: ie
	var mo = 'mo'; //Mozilla; default: mo
	var ns = 'ns'; //Netscape Navigator <= 4.x; default: ns
	var nn6 = 'mo'; //Netscape 6+; default: nn6
	var opera = 'ie'; //Opera; default: opera
	var konq = 'std'; //KDE Konqueror; default: konq
	var safari = 'safari'; //Apple Safari; default: safari
	
	//set some default variables
	this.browser = 'std';
	this.platform = 'std';
	this.version = '';
	
	//Check for the os used
	if (navigator.platform.indexOf('Mac') > -1) {
		this.platform = mac;
	} else if (navigator.platform.indexOf('Win') > -1) {
		this.platform = win;
	} else if (navigator.platform.indexOf('Linux') > -1) {
		this.platform = lin;
	}
	
	if (navigator.appName.indexOf('Microsoft') > -1) {
		if(navigator.userAgent.indexOf('Opera') > -1) {
			this.browser = opera;
			this.version = getVersion("Opera ");
		} else {
			this.browser = ie;
			this.version = getVersion("MSIE ");
		}
	} else if (navigator.appName.indexOf('Konqueror') > -1) {
		this.browser = konq;
		this.version = '';
	}else {
		if (navigator.appVersion.charAt(0) <= 4) {
			this.browser = ns;
			this.version = getVersion("Mozilla/");			
		} else if (this.platform == mac && navigator.userAgent.indexOf('Safari') > -1) {
			this.browser = safari;
		} else {
			/*var ausgabe = '';
			for(var i in navigator) {
				ausgabe += i+": "+navigator[i]+"\n";
			}
			alert(ausgabe);*/
			if(navigator.vendor.indexOf('Netscape') > -1) {
				this.browser = nn6;
				this.version = navigator.vendorSub;
			} else {
				this.browser = mo;
				this.version = getVersion("rv:");
			}
		}
	}
	
	return this;
	
}

//Function to get the exact version of the browser
function getVersion(pattern) {
	var ua = window.navigator.userAgent
	var patternIndex = ua.indexOf (pattern);
	var version = ua.substring (patternIndex+pattern.length, (ua.indexOf (".", patternIndex+pattern.length ))+3);
	while(isNaN(version) && version.length > 0) {
		version = version.substring(0,version.length-1);
	} 
	return version;
}

bp = new BP();

//alert("Platform: "+bp.platform+"\nBrowser: "+bp.browser+"\nVersion: "+bp.version);
	
//alert ('<LINK HREF="/de/de/css/' + bp.platform + '_' + bp.browser + '.css" REL="styleSheet" TYPE="text/css">');
//Normale Auswahl css mit 4 Files
document.write('<LINK HREF="/css/' + bp.platform + '_' + bp.browser + '.css" REL="styleSheet" TYPE="text/css">');

//Auswahl nur zwischem MAC und PC
//document.write('<LINK HREF="/de/css_achensee/' + bp.platform + '.css" REL="styleSheet" TYPE="text/css">');

//-----------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------------------

//Einblendung des Textes in der Browser-Linkleiste



//Bildwechselfunktion
if (document.images) {
	//Hauptmenue
	itcube1=new Image();			itcube1.src="/images/itcube.gif";
	itcube2=new Image();			itcube2.src="/images/itcube_over.gif";
	aktuelles3=new Image();			aktuelles3.src="/images/aktuelles.gif";
	aktuelles4=new Image();			aktuelles4.src="/images/aktuelles_over.gif";
	produkte5=new Image();			produkte5.src="/images/produkte.gif";
	produkte6=new Image();			produkte6.src="/images/produkte_over.gif";
	support7=new Image();			support7.src="/images/support.gif";
	support8=new Image();			support8.src="/images/support_over.gif";
	referenzen9=new Image();		referenzen9.src="/images/referenzen.gif";
	referenzen10=new Image();		referenzen10.src="/images/referenzen_over.gif";
	download31=new Image();			download31.src="/images/download.gif";
	download32=new Image();			download32.src="/images/download_over.gif";
	
	//Submenue itcube
	firmenprofil11=new Image();		firmenprofil11.src="/images/firmenprofil.gif";
	firmenprofil12=new Image();		firmenprofil12.src="/images/firmenprofil_over.gif";
	team13=new Image();			team13.src="/images/team.gif";
	team14=new Image();			team14.src="/images/team_over.gif";
	partner15=new Image();			partner15.src="/images/partner.gif";
	partner16=new Image();			partner16.src="/images/partner_over.gif";
	kontakt17=new Image();			kontakt17.src="/images/kontakt.gif";
	kontakt18=new Image();			kontakt18.src="/images/kontakt_over.gif";
	stellenangebote19=new Image();		stellenangebote19.src="/images/stellenangebote.gif";
	stellenangebote20=new Image();		stellenangebote20.src="/images/stellenangebote_over.gif";
	agb21=new Image();			agb21.src="/images/agb.gif";
	agb22=new Image();			agb22.src="/images/agb_over.gif";
	
	//Submenue Produkte und Dienstleistungen
	itsecurity23=new Image();		itsecurity23.src="/images/itsecurity.gif";
	itsecurity24=new Image();		itsecurity24.src="/images/itsecurity_over.gif";
	netzwerke25=new Image();		netzwerke25.src="/images/netzwerke.gif";
	netzwerke26=new Image();		netzwerke26.src="/images/netzwerke_over.gif";
	consulting27=new Image();		consulting27.src="/images/consulting.gif";
	consulting28=new Image();		consulting28.src="/images/consulting_over.gif";
	produktesub29=new Image();		produktesub29.src="/images/produktesub.gif";
	produktesub30=new Image();		produktesub30.src="/images/produktesub_over.gif";
	

//Beginn 3. Navigationsebene Dropdown
//Beginn Firmenprofil
	kernkompetenzen51=new Image();		kernkompetenzen51.src="/images/kernkompetenzenm.gif";
	kernkompetenzen52=new Image();		kernkompetenzen52.src="/images/kernkompetenzenm_over.gif";
	philosophie53=new Image();				philosophie53.src="/images/philosophie.gif";
	philosophie54=new Image();				philosophie54.src="/images/philosophie_over.gif";
//Beginn IT-Security
	sicherheitskonzepte71=new Image();	sicherheitskonzepte71.src="/images/sicherheitskonzepte.gif";
	sicherheitskonzepte72=new Image();	sicherheitskonzepte72.src="/images/sicherheitskonzepte_over.gif";
	assessments73=new Image();				assessments73.src="/images/assessments.gif";
	assessments74=new Image();				assessments74.src="/images/assessments_over.gif";
	firewalls75=new Image();				firewalls75.src="/images/firewalls.gif";
	firewalls76=new Image();				firewalls76.src="/images/firewalls_over.gif";
	vpn77=new Image();						vpn77.src="/images/vpn.gif";
	vpn78=new Image();						vpn78.src="/images/vpn_over.gif";
	wirelesslan79=new Image();				wirelesslan79.src="/images/wirelesslan.gif";
	wirelesslan80=new Image();				wirelesslan80.src="/images/wirelesslan_over.gif";
	ids81=new Image();						ids81.src="/images/ids.gif";
	ids82=new Image();						ids82.src="/images/ids_over.gif";
	contentsecurity83=new Image();		contentsecurity83.src="/images/contentsecurity.gif";
	contentsecurity84=new Image();		contentsecurity84.src="/images/contentsecurity_over.gif";
	managedsecurity85=new Image();		managedsecurity85.src="/images/managedsecurity.gif";
	managedsecurity86=new Image();		managedsecurity86.src="/images/managedsecurity_over.gif";
	training87=new Image();					training87.src="/images/training.gif";
	training88=new Image();					training88.src="/images/training_over.gif";
//Beginn Netzwerke
	kompetenz89=new Image();			kompetenz89.src="/images/kompetenz.gif";
	kompetenz90=new Image();			kompetenz90.src="/images/kompetenz_over.gif";
	planung91=new Image();				planung91.src="/images/planung.gif";
	planung92=new Image();				planung92.src="/images/planung_over.gif";
	outtasking93=new Image();			outtasking93.src="/images/outtasking.gif";
	outtasking94=new Image();			outtasking94.src="/images/outtasking_over.gif";
	sicherheit95=new Image();			sicherheit95.src="/images/sicherheit.gif";
	sicherheit96=new Image();			sicherheit96.src="/images/sicherheit_over.gif";
	zuhd97=new Image();				zuhd97.src="/images/zuhd.gif";
	zuhd98=new Image();				zuhd98.src="/images/zuhd_over.gif";
	flexibilitaet99=new Image();			flexibilitaet99.src="/images/flexibilitaet.gif";
	flexibilitaet100=new Image();			flexibilitaet100.src="/images/flexibilitaet_over.gif";
	neutralitaet101=new Image();			neutralitaet101.src="/images/neutralitaet.gif";
	neutralitaet102=new Image();			neutralitaet102.src="/images/neutralitaet_over.gif";
	ueberzeugung103=new Image();			ueberzeugung103.src="/images/ueberzeugung.gif";
	ueberzeugung104=new Image();			ueberzeugung104.src="/images/ueberzeugung_over.gif";
	
}

var statustext=new Array (
	'', 
	'@ IT-CUBE', 
	'AKTUELLES', 
	'PRODUKTE & DIENSTLEISTUNGEN', 
	'SUPPORT', 
	'REFERENZEN', 
	'Firmeprofil', 
	'Team', 
	'Partner', 
	'Kontakt & Anfahrtsskizze', 
	'Stellenangebote',
	'AGB',
	'IT-Security',
	'Netzwerke',
	'Consulting',
	'Produkte',
	'Download'
);

// Tauscht per MouseOver zwei Bilder aus
function mark(layerName, imgName, num, st) {
	if ( document.layers && layerName != "" && bp.browser == "ns") {
		// Netscape
		document.layers[layerName].document.images[imgName].src = eval(imgName+num+".src");
	} else {
		// IE
		if (document.images) {
			document[imgName].src = eval(imgName+num+".src");
		}
	}
	
	// Einblendung des Status-Textes in der Browser-Statusleiste
	status = statustext[st];
}

// ------------------------------------------------------------------------------------------------
// Routinen fuer das Layer-Menue ab hier
// ------------------------------------------------------------------------------------------------
// ACHTUNG: Das entsprechende Hauptmenue-Bild muss den gleichen Namen (also NAME=...) haben, wie der Layer, der
// aufpopen soll! Bsp:
//	<IMG SRC="/images/kaiserwinkl_over.gif" WIDTH="88" HEIGHT="37" ALT="kaiserwinkl" NAME="kaiserwinkl" BORDER="0">
//	...
//	<DIV id="kaiserwinkl">
//		...
//	</DIV>

// Bestimmung des Browsers
setBrowser();

// Variablen global setzten; wird zum Ausschalten des Layers benoetigt
var stay = 0;
var layerName = 0;
var layerNameTemp = 0;

// Variablen fuer Positionierung setzten
var xImg = 0;
var yImg = 0;
var xPos = 0;
var yPos = 0;
var xOff = 0;
var yOff = 0;

//Macht Layer auf der Seite sichtbar/unsichtbar
function switchLayer(layerName, flag, xOff_temp, yOff_temp) {
	stay = 1;	//verhindert, das der Layer abgeschaltet werden kann
	
	xOff = xOff_temp;
	yOff = yOff_temp;
	
	//den Layer sofort ausschalten, wenn Maus ueber neuem Layer ist
	if (layerName != layerNameTemp) {
		stay = 0;
		layerOff(layerNameTemp);
	}
	layerNameTemp = layerName;
	
	//Layer zeigen / verbergen (alle Browser-Versionen)
	if (layerName != 0) {
		if (document.all) {
			document.all.tags("div")[layerName].style.visibility = (flag == 0) ? "hidden" : "visible";
		} else if (bp.browser == "mo") {
			document.getElementById(layerName).style.visibility = (flag == 0) ? "hidden" : "visible";
		} else {
			document.layers[layerName].visibility = (flag == 0) ? 'hide' : 'show';
		}
	}
	
	// Layer richtig positionieren
	// Bildposition bestimmen
	BildPos(layerName);
	// Layer an Position plus x- und y-Offset angliedern
	// Durch x- und y-Offset kann der Layer bzgl. des Hauptmenues verschoben werden
	moveIdTo(layerName,xImg+xOff,yImg+yOff);
}

//Ruft die Funktion zum Ausschalten des Layers Zeitverzoegert aus (Angabe in ms)
function leOffIdle(layerNameIdle) {
	stay = 0;
	if (bp.browser == "ns" || bp.browser == "mo") {
		setTimeout(layerOff,1500,layerNameIdle);
	} else {
		setTimeout("layerOff('"+layerNameIdle+"')",1500);
	}
}

//Schaltet den eingeblendeten Layer wieder aus, wenn Maus wirklich ueber keinem Button mehr ist
function layerOff(layerNameOff) {
	
	if (stay == 0) {
		switchLayer(layerNameOff, 0, xOff, yOff);
	}
}

// Bildposition bezogen auf den Fensterrand ermitteln
function BildPos(imageName){
	if (isNav6) {
		xImg = document.images[imageName].x;
		yImg = document.images[imageName].y;
	} else if (isNav4) {
		xImg = document.images[imageName].x;
		yImg = document.images[imageName].y;
	} else {
		xImg = getXPos(document.images[imageName]);
		yImg = getYPos(document.images[imageName]);
	}
}

// Liest die X-Position eines Bildes im IE4 aus; wird von Funktion BildPos benoetigt
function getXPos(thisObject) {
	return((thisObject.offsetParent) ? (thisObject.offsetLeft + getXPos(thisObject.offsetParent)) : thisObject.offsetLeft);
}

// Liest die Y-Position eines Bildes im IE4 aus; wird von Funktion BildPos benoetigt
function getYPos(thisObject) {
	return((thisObject.offsetParent) ? (thisObject.offsetTop + getYPos(thisObject.offsetParent)) : thisObject.offsetTop);
}

/*
 * Browser version snooper; determines your browser
 * (Navigator 4, Navigator 6, or Internet Explorer 4/5)
 */
function setBrowser() {
	if (navigator.appVersion.charAt(0) == "4")
	{
		if (navigator.appName.indexOf("Explorer") >= 0)
		{
			isIE4 = true;
		}
		else
		{
			isNav4 = true;
		}
	}
	else if (navigator.appVersion.charAt(0) > "4")
	{
		isNav6 = true;
	}
}

/*
 *
 * Given a selector string, return a style object
 * by searching through stylesheets. Return null if
 * none found
 *
 */
function getStyleBySelector( selector )
{
	if (!isNav6)
	{
		return null;
	}
	var sheetList = document.styleSheets;
	var ruleList;
	var i, j;

	/* look through stylesheets in reverse order that
	   they appear in the document */
	for (i=sheetList.length-1; i >= 0; i--)
	{
		ruleList = sheetList[i].cssRules;
		for (j=0; j<ruleList.length; j++)
		{
			if (ruleList[j].type == CSSRule.STYLE_RULE &&
				ruleList[j].selectorText == selector)
			{
				return ruleList[j].style;
			}
		}
	}
	return null;
}

/*
 *
 * Given an id and a property (as strings), return
 * the given property of that id.  Navigator 6 will
 * first look for the property in a tag; if not found,
 * it will look through the stylesheet.
 *
 * Note: do not precede the id with a # -- it will be
 * appended when searching the stylesheets
 *
 */
function getIdProperty( id, property )
{
	if (isNav6)
	{
		var styleObject = document.getElementById( id );
		if (styleObject != null)
		{
			styleObject = styleObject.style;
			if (styleObject[property])
			{
				return styleObject[ property ];
			}
		}
		styleObject = getStyleBySelector( "#" + id );
		return (styleObject != null) ?
			styleObject[property] :
			null;
	}
	else if (isNav4)
	{
		return document.layers[id][property];
	}
	else
	{
		return document.all.tags("div")[id].style[property];
	}
}

/*
 *
 * Given an id and a property (as strings), set
 * the given property of that id to the value provided.
 *
 * The property is set directly on the tag, not in the
 * stylesheet.
 *
 */
function setIdProperty( id, property, value )
{
	if (isNav6)
	{
		var styleObject = document.getElementById( id );
		if (styleObject != null)
		{
			styleObject = styleObject.style;
			styleObject[ property ] = value;
		}
		
		/*
		styleObject = getStyleBySelector( "#" + id );
		if (styleObject != null)
		{
			styleObject[property] = value;
		}
		*/
	}
	else if (isNav4)
	{
		document.layers[id][property] = value;
	}
	else if (isIE4)
	{
		document.all.tags("div")[id].style[property] = value;
	}
}

/*
 *
 * Move a given id.  If additive is true,
 * then move it by xValue dots horizontally and
 * yValue units vertically.  If additive is
 * false, then move it to (xValue, yValue)
 *
 * Note: do not precede the id with a # -- it will be
 * appended when searching the stylesheets
 *
 * Note also: length units are preserved in Navigator 6
 * and Internet Explorer. That is, if left is 2cm and
 * top is 3cm, and you move to (4, 5), the left will
 * become 4cm and the top 5cm.
 *
 */
function generic_move( id, xValue, yValue, additive )
{
	var left = getIdProperty(id, "left");
	var top = getIdProperty(id, "top");
	var leftMatch, topMatch;
	
	if (isNav4)
	{
		leftMatch = new Array( 0, left, "");
		topMatch = new Array( 0, top, "");
	}
	else if (isNav6 || isIE4 )
	{
		var splitexp = /([-0-9.]+)(\w+)/;
		leftMatch = splitexp.exec( left );
		topMatch = splitexp.exec( top );
		if (leftMatch == null || topMatch == null)
		{
			leftMatch = new Array(0, 0, "px");
			topMatch = new Array(0, 0, "px");
		}
	}
	left = ((additive) ? parseFloat( leftMatch[1] ) : 0) + xValue;
	top = ((additive) ? parseFloat( topMatch[1] ) : 0) + yValue;
	
	setIdProperty( id, "left", left + leftMatch[2] );
	setIdProperty( id, "top", top + topMatch[2] );
}

/*
 *
 * Move a given id to position (xValue, yValue)
 *
 */
function moveIdTo( id, x, y )
{
	generic_move( id, x, y, false );
}

/*
 *
 * Move a given id to (currentX + xValue, currentY + yValue)
 *
 */
function moveIdBy( id, x, y)
{
	generic_move( id, x, y, true );
}


//--------------------------------------------------------------
//--------------------------------------------------------------


function mailto(x) {
if(x == "leer") {
	document.forms[0].reset();
	document.forms[0].elements[0].blur();
	return;
} else {
	window.location.href = x;
	document.forms[0].reset();
	document.forms[0].elements[0].blur();
}
}


/*Written 2003 Georg Kemser (kemser@arsnavigandi.de)
Version 1.0 - Last modified 6.1.2003 
Method:
Erzeugt ein neues Fenster mit bestimmbarer Zieldatei, Internem Titel (müssen verschiedene Namen für verschiedene Pop-ups haben), Breite, Hoehe, relative X-Position und Y-Position
und passt das Fenster für Ausnahme Netscape an*/

var isNav4, isNav6, isIE4;

function NeuFenster(Datei,InternTitel,Breite,Hoehe,XPos,YPos,auto) {
	if (isNav6) {
		fbreite = Breite +  8; fhoehe = Hoehe + 27;
	} else if (isNav4) {
		fbreite = Breite + 15; fhoehe = Hoehe + 15;
	} else {
		fbreite = Breite + 12; fhoehe = Hoehe + 31;
	}
	Fenster = window.open(Datei,'InternTitel','width='+fbreite+',height='+fhoehe+',screenX='+XPos+',screenY='+YPos+',scrollbars='+auto+',dependent=yes,resizable=yes');
	Fenster.moveTo(XPos,YPos);
	Fenster.resizeTo(fbreite,fhoehe);
}



/*Written 2003 Johannes Hauf (hauf@arsnavigandi.de)
Version 1.1 - Last modified 6.1.2003
These are JS-methods to connect Javascript and Flash
When You embed your movie be sure you have the following in the "object" tag:
id="myMovie" (DO NOT SET the name-attribute in the "object"-tag (Mozilla)
In the "embed"-tag you need both: id and name.
If you want use a other name than "myMovie" You have to replace all items.

Version history:
1.0 initial release
1.1 added support for multiple Arguments from AS to JS, removed some bugs*/

/*This method waits for a call from myMovie
and calls a javascript method, given in argument "method"*/

var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
function myMovie_DoFSCommand(method, args) {
	var myMovieObj = InternetExplorer ? myMovie : document.myMovie;
	var args = args.split('###');
	eval(method)(args[0],args[1],args[2],args[3],args[4]);
}

if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('Sub myMovie_FSCommand(ByVal command, ByVal args)\n');
	document.write(' call myMovie_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('</SCRIPT\> \n');
}

/*Method Caller
This javascript function calls any actionscript-method/-function
whithin "myMovie"
Arguments: 
method -> This is the full name of the function within the movie
argument0-argument5 -> up to 5 arguments which are passed to the function
(if you need more arguments just copy and paste ;-))*/

function methodCaller(method, argument0, argument1, argument2, argument3, argument4){
	window.document.myMovie.SetVariable("_root.JS.method", method);
	window.document.myMovie.SetVariable("_root.JS.argument0", trimLineEnding(argument0));
	window.document.myMovie.SetVariable("_root.JS.argument1", trimLineEnding(argument1));
	window.document.myMovie.SetVariable("_root.JS.argument2", trimLineEnding(argument2));
	window.document.myMovie.SetVariable("_root.JS.argument3", trimLineEnding(argument3));
	window.document.myMovie.SetVariable("_root.JS.argument4", trimLineEnding(argument4));
	window.document.myMovie.TCallFrame("_root.JS", 0);
}

//This sets some information about the browser in flash movie
function setBrowserInFlash(){
	var browser = 'std';
	if (navigator.appName.indexOf('Microsoft') > -1) {
		browser = 'ie';
	} else {
		if (navigator.appVersion.charAt(0) <= 4) {
			browser = 'ns';
		} else {
			browser = 'mo';
		}
	}
	window.document.myMovie.SetVariable("_root.JS.browser", browser);
	window.document.myMovie.SetVariable("_root.JS.browserMainVer", navigator.appVersion.charAt(0));
}

//Sets all properties in movie/object
function setProperty(method, property){
	window.document.myMovie.SetVariable(method, property);
}

//This method replaces the windows line-ending "\r\n" by "\n" (UNIX)
function trimLineEnding(text){
	var mytext = ""+text;
	var mytext = mytext.replace(/\r\n/g,"\n");
	return (mytext);
}

/*It is important to "escape" text or other variables in Flash.
Only when the Argument is "escaped", ist is possibe to transmit special characters
like "'" or linefeeds*/

function copyTextToHTML(text){
	window.document.myForm.user_input.value = decode_utf8(unescape(text));
}

//Text encoding in UTF-8
function encode_utf8(rohtext) {
	// dient der Normalisierung des Zeilenumbruchs
	rohtext = rohtext.replace(/\r\n/g,"\n");
	var utftext = "";
	for(var n=0; n<rohtext.length; n++)
		{
		// ermitteln des Unicodes des  aktuellen Zeichens
		var c=rohtext.charCodeAt(n);
		// alle Zeichen von 0-127 => 1byte
		if (c<128)
			utftext += String.fromCharCode(c);
		// alle Zeichen von 127 bis 2047 => 2byte
		else if((c>127) && (c<2048)) {
			utftext += String.fromCharCode((c>>6)|192);
			utftext += String.fromCharCode((c&63)|128);}
		// alle Zeichen von 2048 bis 66536 => 3byte
		else {
			utftext += String.fromCharCode((c>>12)|224);
			utftext += String.fromCharCode(((c>>6)&63)|128);
			utftext += String.fromCharCode((c&63)|128);}
		}
	return utftext;
}

//Text decoding in UTF-8
function decode_utf8(utftext) {
	var plaintext = ""; var i=0; var c=c1=c2=0;
	// while-Schleife, weil einige Zeichen uebersprungen werden
	while(i<utftext.length)
		{
		c = utftext.charCodeAt(i);
		if (c<128) {
			plaintext += String.fromCharCode(c);
			i++;}
		else if((c>191) && (c<224)) {
			c2 = utftext.charCodeAt(i+1);
			plaintext += String.fromCharCode(((c&31)<<6) | (c2&63));
			i+=2;}
		else {
			c2 = utftext.charCodeAt(i+1); c3 = utftext.charCodeAt(i+2);
			plaintext += String.fromCharCode(((c&15)<<12) | ((c2&63)<<6) | (c3&63));
			i+=3;}
		}
	return plaintext;
}

/* This calls the JS-method */

function setNavigation(status, status2) {
	methodCaller('_root.setNavigation',status, status2)
}
