//----------------------------------------

var mainNr = 0;
var subMenuNr = 0;
var subNr = 0;

function resetAll(){
	top.topnavileft.reset();
	top.topnaviright.reset();
	top.subnavigation.reset();
}

function changeMenu(aMainNr, aSubMenuNr, aSubNr){
	resetAll();
	top.mainNr = 0;
	top.subNr = aSubNr;
	
	if(aMainNr != 0 && aMainNr != 100){
		top.mainNr = aMainNr;
		if(aMainNr < 100){
			top.topnavileft.setMenu(aMainNr - 1);
		}
		else if(aMainNr > 100){
			top.topnaviright.setMenu(aMainNr - 101);
		}
	}

	if(aSubMenuNr == 0){
		top.subMenuNr = 0;
		top.subnavigation.location = "/general/navigation/de/sub_navi_start.html";
	}
	else{
		if(top.subMenuNr != aSubMenuNr){
			top.subMenuNr = aSubMenuNr;
			top.subnavigation.location = "/general/navigation/de/sub_navi_" + aSubMenuNr + ".html";
		}
		else{
			if(aSubNr > 0)
				top.subnavigation.setMenu(aSubNr - 1);
		}
	}

}

function fetchMenu(){
	if(top.subNr > 0){
		top.subnavigation.setMenu(top.subNr - 1);
	}
}

//----------------------------------------

function dropdownMenu(avalue, anObject)
{
	if(anObject && document.layers)	{
		var selected = anObject.selectedIndex;
		avalue = anObject.options[selected].value;
	}
	
	if(avalue.length > 0 && avalue != ""){
	
		var params = avalue.split(",");

		if(params.length == 4){
			if(params[0] != "" && params[0].length > 0){
				top.content.location = params[0];
			}
			changeMenu(params[1], params[2], params[3]);
		}
	}

	if(anObject){
		anObject.selectedIndex = 0;
	}
	
}

//----------------------------------------

function openApplication(aLang, anURL){

	window.open("/jobs/" + aLang + "/html/apply_frame.html", "Application", "width=500,height=500,scollbars=yes,scrollbars=1");

}