/* Minitec - Javascript Datei */
var browser = navigator.userAgent.toLowerCase();
var integer_value = parseInt(navigator.appVersion);
var value = parseFloat(navigator.appVersion);
//ist es netscape
var netscap = ((browser.indexOf('mozilla')!=-1) && (browser.indexOf('spoofer')==-1) && (browser.indexOf('compatible') == -1) && (browser.indexOf('opera')==-1) && (browser.indexOf('webtv')==-1) && (browser.indexOf('hotjava')==-1));
var netscap4 = (netscap && (integer_value == 4));
var netscap4up = (netscap && (integer_value >= 4));
var netscaponly = (netscap && ((browser.indexOf(";nav") != -1) || (browser.indexOf("; nav") != -1)));
//ist es netscape 6
var netscap6 = (netscap && (integer_value == 5));
var netscap6up = (netscap && (integer_value >= 5));
var is_gecko = (browser.indexOf('gecko') != -1);
//ist es internet explorer
var explorer = ((browser.indexOf("msie") != -1) && (browser.indexOf("opera") == -1));
var explorer3 = (explorer && (integer_value < 4));
var explorer4 = (explorer && (integer_value == 4) && (browser.indexOf("msie 5")==-1));
var explorer4up = (explorer && (integer_value >= 4));
var explorer5 = (explorer && (integer_value == 4) && (browser.indexOf("msie 5.0")!=-1));
var explorer5_5 = (explorer && (integer_value == 4) && (browser.indexOf("msie 5.5") !=-1));
var explorer5up = (explorer && !explorer3 && !explorer4);
var explorer5_5up =(explorer && !explorer3 && !explorer4 && !explorer5);
var explorer6 = (explorer && (integer_value == 4) && (browser.indexOf("msie 6.0") !=-1));
var explorer6up = (explorer && !explorer3 && !explorer4 && !explorer5 && !explorer6);
var explorer7 = (explorer && (integer_value == 4) && (browser.indexOf("msie 7.0") !=-1));
var explorer7up =  (explorer && !explorer3 && !explorer4 && !explorer5 && !explorer6 && !explorer7);
//ist es opera
var opera = (browser.indexOf("opera") != -1);
var opera4 = (browser.indexOf("opera 4") != -1);
var opera5 = (opera && (integer_value == 5));
var opera5up = (opera && (integer_value >=5));

var browserWidth     = 0;
var browserHeight    = 0;
var is_activNotepad  = 0;
var is_activImageBox = 0;
if(explorer) {
	if (explorer7 || explorer7up) {
		document.write('<link rel="Stylesheet" href="/css/load_css.css"  type="text/css" />')
	}
	else {
		document.write('<link rel="Stylesheet" href="/css/load_css_IE6_lt.css"  type="text/css" />')
	}
}
else {
	document.write('<link rel="Stylesheet" href="/css/load_css.css"  type="text/css" />')
}



function GoSelect_location_language(x) {
	var splitValues = x.split("|");
	document.location.href= splitValues[2]+"&location="+splitValues[0]+"&language="+splitValues[1];
}


function GoPartnerCountry (continent, country, url, language) {
	if (url !="") {
		document.location.href = url+"&partnerContinent="+continent+"&partnerCountry="+country+"&language="+language;
	}

}

function GoPartnerContinent (country, url, language) {
	if (url !="") {
		document.location.href = url+"&partnerContinent="+country+"&language="+language;
	}
}

function GoPartnerZip (continent, country, zip, id, language) {
	document.location.href = "index.php?id="+id+"&partnerContinent="+continent+"&partnerCountry="+country+"&partnerZIP="+zip+"&language="+language;
}
/*
function GoPartnerAgentZip (continent, country, zip, agentZIP, id, language) {
document.location.href = "index.php?id="+id+"&partnerContinent="+continent+"&partnerCountry="+country+"&partnerZIP="+zip+"&partnerAgentZIP="+agentZIP+"&language="+language;
}
*/
function GoPartner (zip, url, language) {
	if (url !="") {
		document.location.href = url+"&partnerAgentZIP="+zip+"&language="+language;
	}
}

function GoContactPLZ (country, id, plz) {
	document.location.href = "index.php?id="+id+"&contactCountry="+country+"&plz="+plz;
}

function GoContactState (country, id,state) {
	document.location.href = "index.php?id="+id+"&contactCountry="+country+"&contactState="+state;
}

function openWindow (url, windowName, setoptions) {
	if (setoptions == 1) {
		options = "width=800,height=600,left=100,top=100,resizable=yes,status=yes,toolbar=yes,scrollbars=yes,menubar=yes";
	}
	else if (setoptions == "") {
		options = "width=800,height=600,left=100,top=100,resizable=yes,scrollbars=yes;";
	}
	else {
		options = setoptions;
	}

	myWindow = window.open(url, windowName, options);
	myWindow.focus();
}

function Go(url) {
	if (url !="") {
		document.location.href = url;
	}
}


function newsletterAbo(value) {
	document.formNewsletter['newsletter_cancel'].value = 0;
	if (value == 2) {
		document.formNewsletter['newsletter_cancel'].value = 1;
	}
	document.formNewsletter.submit();
}


function show(obj, id, image, imagePath) {
	if (obj && id) {
		/*showBorder (obj, id)*/
	}
	document.getElementById(id).src = imagePath + image;
	document.getElementById(id).style.zIndex = 1;
}

function showBorder (obj, id) {
	document.getElementById(obj.id).style.borderRight = "solid black 1px";
}

function hide(obj, id, image, imagePath) {
	if (obj && id) {
		/*hideBorder (obj, id)*/
	}
	document.getElementById(id).src =imagePath + image;
}

function hideBorder(obj, id) {
	document.getElementById(obj.id).style.borderRight = "solid transparent 1px";
}



if(window.navigator.systemLanguage && !window.navigator.language) {
	function hoverIE() {
            var LI = "";
		/*
		var LI = document.getElementById("Navigation1").firstChild;
		do {
		if (sucheUL(LI.firstChild)) {
		LI.onmouseover=einblenden; LI.onmouseout=ausblenden;
		}
		LI = LI.nextSibling;
		}
		while(LI);
		*/
		/*
		var LI = document.getElementById("Navigation2").firstChild;
		do {
		if (sucheUL(LI.firstChild)) {
		LI.onmouseover=einblenden; LI.onmouseout=ausblenden;
		}
		LI = LI.nextSibling;
		}
		while(LI);
		*/

		if (document.getElementById("Navigation3") != null) {
			LI = document.getElementById("Navigation3").firstChild;
			if (LI != null) {
				do {
					if (sucheUL(LI.firstChild)) {
						LI.onmouseover=einblenden; LI.onmouseout=ausblenden;
					}
					LI = LI.nextSibling;
				}
				while(LI);
			}
		}
		if (document.getElementById("topNaviItem1") != null) {
			LI = document.getElementById("topNaviItem1").firstChild;
			if (LI != null) {
				do {
					if (sucheUL(LI.firstChild)) {
						LI.onmouseover=einblenden; LI.onmouseout=ausblenden;
					}
					LI = LI.nextSibling;
				}
				while(LI);
			}
		}
		if (document.getElementById("topNaviItem2") != null) {
			LI = document.getElementById("topNaviItem2").firstChild;
			if (LI != null) {
				do {
					if (sucheUL(LI.firstChild)) {
						LI.onmouseover=einblenden; LI.onmouseout=ausblenden;
					}
					LI = LI.nextSibling;
				}
				while(LI);
			}
		}
		if (document.getElementById("topNaviItem3") != null) {
			LI = document.getElementById("topNaviItem3").firstChild;
			if (LI != null) {
				do {
					if (sucheUL(LI.firstChild)) {
						LI.onmouseover=einblenden; LI.onmouseout=ausblenden;
					}
					LI = LI.nextSibling;
				}
				while(LI);
			}
		}
		if (document.getElementById("topNaviItem4") != null) {
			LI = document.getElementById("topNaviItem4").firstChild;
			if (LI != null) {
				do {
					if (sucheUL(LI.firstChild)) {
						LI.onmouseover=einblenden; LI.onmouseout=ausblenden;
					}
					LI = LI.nextSibling;
				}
				while(LI);
			}
		}
		if (document.getElementById("topNaviItem5") != null) {
			LI = document.getElementById("topNaviItem5").firstChild;
			if (LI != null) {
				do {
					if (sucheUL(LI.firstChild)) {
						LI.onmouseover=einblenden; LI.onmouseout=ausblenden;
					}
					LI = LI.nextSibling;
				}
				while(LI);
			}
		}
		if (document.getElementById("topNaviItem6") != null) {
			LI = document.getElementById("topNaviItem6").firstChild;
			if (LI != null) {
				do {
					if (sucheUL(LI.firstChild)) {
						LI.onmouseover=einblenden; LI.onmouseout=ausblenden;
					}
					LI = LI.nextSibling;
				}
				while(LI);
			}
		}
		if (document.getElementById("topNaviItem7") != null) {
			LI = document.getElementById("topNaviItem7").firstChild;
			if (LI != null) {
				do {
					if (sucheUL(LI.firstChild)) {
						LI.onmouseover=einblenden; LI.onmouseout=ausblenden;
					}
					LI = LI.nextSibling;
				}
				while(LI);
			}
		}
	}


	function sucheUL(UL) {
		do {
			if(UL) UL = UL.nextSibling;
			if(UL && UL.nodeName == "UL") return UL;
		}
		while(UL);
		return false;
	}

	function einblenden() {
		var UL = sucheUL(this.firstChild);
		UL.style.display = "block";

	}
	function ausblenden() {
		sucheUL(this.firstChild).style.display = "none";
	}

	function changeLocation (selectionId, languageId) {
		setQuestionMark = "?";
		setAnd = "";
		if (languageId) {
			set = setQuestionMark+"language="+languageId;
			setQuestionMark = "";
			setAnd = "&";
		}
		if (selectionId) {
			set = set+setQuestionMark+setAnd+"location="+selectionId;
		}

		document.location.href =  "<?=$_SERVER['PHP_SELF']?>"+set;

	}


	window.onload=hoverIE;
}

function clearField (obj, checkValue) {
	if (obj.value ==  checkValue) {
		obj.value = "";
	}
}

function temp_05 (data) {

	var result = temp_04(data);
	if (result !="") {
		document.location.href = "mailto:"+result;
	}
}

function temp_04 (data) {
	delimiter = new Array("\\$","\\?","%","&");
	for (var i = 0; i < delimiter.length ; i++) {
		var search = "/("+ delimiter[i] +")/gi";
		data = data.replace(eval(search), "|");
	}
	var dataNeu = data.split("|");
	var dataLength = dataNeu.length;
	var result = "";
	var key = dataNeu[(dataLength-1)];

	for (var i = 0; i < (dataLength-1) ; i++) {
		var charcode = dataNeu[i]/key;
		charcode = Math.round(charcode);
		result = result+ String.fromCharCode(charcode);
	}
	return result;
}


function showHideDiv (divName, showHide) {
	var obj = document.getElementById(divName).style;
	if (showHide == "hidden" || showHide == "visible") {
		obj.visibility = showHide;
	}
}

// Funktion wechselt von visible zu hidden und umgekehrt
// und setzt display block oder none
function changeVisibilityDiv (divName) {
	var obj = document.getElementById(divName).style;
	if (obj.visibility == "hidden") {
		obj.visibility = "visible";
		obj.display = "block";
	}
	else {
		obj.visibility = "hidden";
		obj.display = "none";
	}
}

// Funktion aendert den Display Wert (block/none)
function changeDisplay (divName, value) {
	var obj = document.getElementById(divName).style;
	if (divName !="" && value !="") {
		obj.display = value;
	}

}


function extendedSearch(divName1,divName2, buttonActivName, buttonInactiv) {
	var obj1 = document.getElementById(divName1).style;
	var showHide = "";
	if (obj1 == "visible") {
		showHide1 = "hidden";
		showHide2 = "visible";
		display1   = "none";
		display2   = "block";
	}
	else {
		showHide1 = "visible";
		showHide2 = "hidden";
		display1   = "block";
		display2   = "none";
	}
	changeDisplay (divName1, display1);
	changeDisplay (divName2, display2);
	showHideDiv (divName1, showHide1);
	showHideDiv (divName2, showHide2);
	if (buttonActivName != "" && buttonInactiv !="") {
		document.getElementById(buttonActivName).style.background = "#ebeef3";
		document.getElementById(buttonInactiv).style.background   = "#b4c1d1";
	}
}

function set_DIV_position (x_position, y_position , divName) {
  // Abstand vom linken Seitenrand
  document.getElementById (divName).style.left = x_position;
  // Amstand vom oberen Seitenrand
  document.getElementById (divName).style.top = y_position;
}


// einen bestimmten Wert in einem Array suchen und loeschen
Array.prototype.array_value_delete = function(wert) {

	for (var x = 0; x < this.length; ++x) {
		if (this[x] == wert) {
			this[x] = this[x + 1];
		}

	} this.pop();
};


Array.prototype.in_array = function (elem) {
  var i;
  for (i = 0; i < this.length; i++) {
    if (this[i] == elem) {
      return true;
    }
  }

  return false;
};


// Funktion gibt die Breite des Browserfensters zurueck
function getBrowserWidth () {
  if (window.innerWidth) {
    return window.innerWidth;
 } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    return document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    return document.body.clientWidth;
  } else {
    return 0;
  } 
}

// Funktion gibt die Hoehe des Browserfensters zurueck
function getBrowserHeight () {
 if (window.innerHeight) {
    return window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    return document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    return document.body.clientHeight;
  } else {
    return 0;
  } 
}

// Funktion setzt die Hoehe eines DIVs auf die Browserhoehe (abzueglich eines Randes von "margin" oben und unten)
function resizeDivHeight (resizeDiv, margin) {

// ZUM TEST
 //   document.getElementById("test").innerHTML = getBrowserHeight()+" "+getBrowserWidth()+ "-->"+ document.getElementById("notepadDiv").style.height;
   if (browserWidth != getBrowserWidth() || browserHeight != getBrowserHeight()) {
    var tempHeight = getBrowserHeight()- margin;
    document.getElementById(resizeDiv).style.height = tempHeight+"px";
    }
}


// Funktion wird zu Beginn aktivert, um bei Aenderungen des Browserfenster bestimmte Funktionen aufzurufen
function setResizeFunction () {
    // wenn das Notepad DIV geoeffnet ist, dann wird die Funktion aktiviert
   if (is_activNotepad == 1) {
        resizeDivHeight("notepadDiv", 40);
   }
    if (is_activImageBox == 1) {
        resizeDivHeight("ImageBox", 40);
   }
   browserWidth  = getBrowserWidth();
   browserHeight = getBrowserHeight();
}

// Browser Hoehe und Breite initialisieren
if (!window.browserWidth && window.innerWidth) {
    window.onresize = setResizeFunction;
    browserWidth  = getBrowserWidth();
    browserHeight = getBrowserHeight();
 }

 /* Login Formular ueberpruefen und abschicken */
 function sendLogin () {
	if(document.formLogin['user'].value == "") {
		document.formLogin['user'].value = " ";
	}

	document.formLogin.submit();
}
