// onerror = stopError;	// 	Javascript Fehler unterdruecken
function stopError()
{ return true; }

document.write("");// muss unbedingt sein, denn sonnst macht nn4 probleme mit setTimeout !!!

eval('parent.menue_' + self.name + ' = \"nicht geladen\";'); // menue_seiten als nicht geladen markieren

var local = location.href.slice(0,(location.href.indexOf('cn') - 1));

var url = location.pathname;
var size = url.length;

var host = location.host

var parameter = location.search;
var anker = location.hash;
anker = anker.replace(/#/,"");

if (host.indexOf('beckhoff') != -1 || host.indexOf('twincat') != -1  || host.indexOf('busbox') != -1 || host.indexOf('twinsafe') != -1 || host.indexOf('be-home') != -1 || host == "") {
	cache = false;
}
else {
	cache = true;
}

url = url.substring(url.indexOf('cn')+3, size);

// frame_wrapper_teil +++ wenn meneu fehlt, nicht popup und keine index_datei
if ( top.frames.length == 0 && self.name != "popupwin" && location.href.indexOf('cn') != -1 && cache == false)
{ location.replace("/cn/default.htm?" + url); }

function menue_initial()	// menue_initialisierung
{//	wenn menues geladen
 
	if ( parent.frame_top_right && top.window.name.indexOf("menue_js_ist_geladen") != -1 )	// XXXXX evtl. anpassen
		{
			parent.frame_top_right.wechsel(location.href,"click");	// XXXXX evtl. frame_namen anpassen
			if (document.all && (navigator.appVersion.indexOf("Mac") != -1) )	// explorer_mac_menue_anpassung
			 	{ window.setTimeout("menue_initial()",1000);}
		}
	else { window.setTimeout("menue_initial()",100); }
}
			
// resize_teil fuer netscape
// if(document.layers && !parent.top.name) { parent.top.name = window.innerWidth * window.innerHeight; }

function resize()
{
	if ( window.innerWidth * window.innerHeight != parent.top.name )
	{
		window.stop();
		parent.top.name = window.innerWidth * window.innerHeight;
	//	top.location.href = local + "/sites/index_frames.htm?" + location.href;
		location.reload();
	}
}

if ( self.name == "main" )	//	wenn eine content_seite - menue initialisieren
{
	// if ( document.layers )
	// {
		// if ( navigator.appVersion.indexOf("Mac") != -1 ) { onresize = resize(); }	// mac
		// else { onresize = resize; }	// pc
	// }
	menue_initial();
}

if ( self.name == "popupwin" && window.focus ) { self.focus(); }	//	wenn ein popup_fenster - den in vordergrund stellen



//baum nachladen, nur wenn der Link nicht vom menu.php kommt
var ref = document.referrer;
var ref2 = parent.frame_left.location.href;

var suche = ref.indexOf('menu.php');
var sucheIT = ref2.indexOf('/it/'); //Gerändert LeonZ
var sucheCN = ref2.indexOf('/cn/'); //Gerändert LeonZ
var sucheAE = ref2.indexOf('/ae/'); //Gerändert LeonZ

// in speziellen Fällen Baum nachladen, wenn reload=1
var reload_menu = location.search.indexOf('reload=1');

//var suche2 = ref.indexOf('english/') //Gerändert LeonZ
//var suche3 = ref.indexOf('english.asp?') //Gerändert LeonZ

if ((suche < 0 && sucheIT < 0 && sucheCN < 0)|| reload_menu > 0 )
{
	var liste = new Werteliste(parent.frame_left.location.search);
	var p = "";
	
	for(eigenschaft in liste) {
	  if (eigenschaft == "p") {
		 p = liste[eigenschaft];
	  }
	}
	
	var liste = new Werteliste(location.search);
	var id = "";
	
	for(eigenschaft in liste) {
	  if (eigenschaft == "id") {
		 id = liste[eigenschaft];
	  }
	}

	if (sucheIT > 0) {  //Italia with own tree
		parent.frame_left.location.href = "../../it/contents/check_tree.php?id=" + id + "&content=" + url + "&k=" + p;	
	}
	else if (sucheAE > 0) { //Arabia with own tree
			parent.frame_left.location.href = "../../ae/contents/check_tree.php?id=" + id + "&content=" + url + "&k=" + p;	
	}
	else if (sucheCN > 0) { //Chinese with own tree
			parent.frame_left.location.href = "../../cn/contents/check_tree.php?id=" + id + "&content=" + url + "&k=" + p;	
	}	
	else { //Standard Tree
		parent.frame_left.location.href = "../contents/check_tree.php?id=" + id + "&content=" + url + "&k=" + p;
	}

}

function Werteliste(querystring) {
  if(querystring == '') return;
  var wertestring = unescape(querystring);
  wertestring = wertestring.slice(1);
  var paare = wertestring.split("&");
  for (var i=0; i < paare.length; i++) {
    var name = paare[i].substring(0, paare[i].indexOf("="));
    var wert = paare[i].substring(paare[i].indexOf("=")+1, paare[i].length);
    this[name] = wert;
  }
}
function openwin() {   
window.open ("/cn/2009.htm", "Beckhoff", "height=400, width=600, location=no, status=no£¬ toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no")   
//Ð´³ÉÒ»ÐÐ   
}  