	// if (loaded) will be asked in the DHTML-menu-functions before showing/hiding layers because this would cause mistakes if layer are not loaded in that moment
	var loaded = false;
	// if (archived) the box script will be disabled
	var archived = false;

	//client detection
	var agt=navigator.userAgent.toLowerCase();

	var is_major = parseInt(navigator.appVersion);
	var is_minor = parseFloat(navigator.appVersion);

	var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1));

	var ns5 = (is_nav && (is_major >= 5));
	var ns4 = (document.layers)? true:false;
	var ie4 = (document.all)? true:false;
	var nsMac = (ns4 &&  navigator.platform == "MacPPC")? true:false;
	var ieMac = (ie4 &&  navigator.platform == "MacPPC")? true:false;

	function nix() {
		null;
	}

	function resizeFix() {
		if (widthCheck != window.innerWidth || heightCheck != window.innerHeight) {
			document.location.href = document.location.href;
		}
	}
	//image preloading
	function preload(imgObj,imgSrc) {
		eval(imgObj+' = new Image()');
		eval(imgObj+'.src = "'+imgSrc+'"');
	}

	//change the image for any image object (this has to be named)
	function changeImage(nested, layer, imgName, imgObj) {
		if (ns4) {
			tmpStr = (nested) ? "document."+nested+".document."+layer+"." : "document."+layer+".";
			if ( eval(tmpStr+"document.images[\""+imgName+"\"]") )
			eval(tmpStr+"document.images[\""+imgName+"\"].src = "+imgObj+".src");
		}
		if (ie4){
			if ( eval("document.images[\""+imgName+"\"]") )
			eval("document.images[\""+imgName+"\"].src = "+imgObj+".src")
		}
	}

	//ns6
	function getStyleBySelector( selector ) {
		if (!ns5) {
			return null;
		}
		var sheetList = document.styleSheets;
		var ruleList;
		var i, j;
		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;
	}

	//ns6 functions
	function getIdProperty( id, property ){
	    if (ns5){
	        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 (ns4){
	        return document[id][property];
	    } else {
	        return document.all[id].style[property];
	    }
	}

	function setIdProperty( id, property, value ){
		if (ns5){
	        var styleObject = document.getElementById( id );
	        if (styleObject != null){
	            styleObject = styleObject.style;
	            styleObject[ property ] = value;
	        }
	    }
	    else if (ns4){
	        document[id][property] = value;
	    }
	    else if (ie4){
	         document.all[id].style[property] = value;
	    }
	}

	function generic_move( id, xValue, yValue, additive ){
	    var left = getIdProperty(id, "left");
	    var top = getIdProperty(id, "top");
	    var leftMatch, topMatch;
	    if (ns4){
	        leftMatch = new Array( 0, left, "");
	        topMatch = new Array( 0, top, "");
	    }
	    else if (ns5 || ie4 ){
	        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] );
	}

	function moveTo(id,x,y) {
		if (ns5) {
			id.style.xpos = String(x) + "px";
			id.style.left = String(x) + "px";
			id.style.ypos = y;
			id.style.top = y;
		}
		else {
			id.xpos = x
			id.left = id.xpos
			id.ypos = y
			id.top = id.ypos
		}
	}

	//relative moving
	function moveBy(obj,x,y) {
		obj.xpos += x
		obj.left = obj.xpos
		obj.ypos += y
		obj.top = obj.ypos
	}

	//general show/hide-functions work on any client that supports <div></div>
	function show(id) {
		if (ns4) document.layers[id].visibility = "show";
		else if (ie4) document.all[id].style.visibility = "visible";
		else if (ns5) setIdProperty( id, "visibility", "visible" );
	}

	function hide(id) {
		if (ns4) document.layers[id].visibility = "hide";
		else if (ie4) document.all[id].style.visibility = "hidden";
		else if (ns5) setIdProperty( id, "visibility", "hidden" );
	}

	//opening of the main popup
	function popup(url) {
		popupWin = window.open(url,"popupWin","width=590,height=380,resizable=no,scrollbars=yes,location=no,directories=no,status=no,menubar=yes,toolbar=yes");
	}

	//opening of the nestle secure and datasecurity infos
	function disclaimer(url) {
		disclaimerWin = window.open(url,"disclaimerWin","width=450,height=380,resizable=no,scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no");
	}

	function spezial() {
		speziWin = window.open("/push/online/unternehmen/de/tmpl/karriere_spezieal.tmpl","speziWin","width=450,height=380,resizable=no,scrollbars=yes,location=no,directories=no,status=no,menubar=yes,toolbar=yes");
	}

	function layerWrite(id,nestref,text) {
		if (ns4) {
			var lyr = (nestref)? eval('document.'+nestref+'.document.'+id+'.document') : document.layers[id].document;
			lyr.open();
			lyr.write(text);
			lyr.close();
		}
		else if (ie4) document.all[id].innerHTML = text;
	}

	//function for the secure pages
	function secure() {
		var aime = document.URL;
		var b = aime.split('://');
		if (b[0] == "http") {
			eval('document.location.href="https://' + b[1] + '";');
		} else null;
	}

	function unsecure() {
		var aime = document.URL;
		var b = aime.split('://');
		if (b[0] == "https") {
			eval('document.location.href="http://' + b[1] + '";');
		} else null;
	}
