
var http_request=false;function macheRequest(url){http_request=false;if(window.XMLHttpRequest){http_request=new XMLHttpRequest();if(http_request.overrideMimeType){http_request.overrideMimeType('text/plain');}}else if(window.ActiveXObject){try{http_request=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{http_request=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}}
if(!http_request){return false;}
http_request.open('GET',url,true);http_request.send(null);}
function setchar(letter){document.forms['suchboxform'].suchwert.value+=letter;document.forms['suchboxform'].elements['suchwert'].focus();}
function delchar(anzahl){var str=document.forms['suchboxform'].suchwert.value;str=str.substring(0,str.length-anzahl);document.forms['suchboxform'].suchwert.value=str;document.forms['suchboxform'].elements['suchwert'].focus();}
function alertInhalt(){if(http_request.readyState==4){if(http_request.status==200){}else{}}}
function onw(url){NeuesFenster=window.open(url,'industrystock','width=1000,height=700,left=60,top=40,scrollbars=yes,dependent=yes,resizable=yes');NeuesFenster.focus();}
function onw_forwww(url){NeuesFenster=window.open(url,'industrystock_forward','width=1000,height=700,left=10,top=10,scrollbars=yes,dependent=yes,resizable=yes');NeuesFenster.focus();}
function onwindow(url){NeuesFenster=window.open(url,'industrystock_advert');NeuesFenster.focus();}
function homewechsel(){document.form2lang.submit();}
function businesswechsel(url){document.myform.action='business-searched-'+url+'.html';document.myform.submit();}
function industrywechsel(url){document.myform.action='industry-searched-'+url+'.html';document.myform.submit();}
function chinawechsel(url){document.myform.action='china-searched-'+url+'.html';document.myform.submit();}
function openwindow(url){NeuesFenster=window.open('china-merke-'+url+'.html','merke','width=350,height=200,left=200,top=200,scrollbars=yes,dependent=yes,resizable=yes');NeuesFenster.focus();}
function onwphoto(url){NeuesFenster=window.open(url,'industrystock_photo','width=600,height=400,left=60,top=40,scrollbars=yes,dependent=yes,resizable=yes');NeuesFenster.focus();}
function alle(anzahl){for(var i=0;i<=anzahl;i++)
{document.forms[0].elements[i].checked=true;}}
function alleprodukt(anzahl){for(var i=0;i<=anzahl;i++)
{document.mailform.elements[i].checked=true;}}
function onw1(url){NeuesFenster=window.open(url,'produktbild','width=600,height=480,left=60,top=40,scrollbars=yes,dependent=yes,resizable=yes');NeuesFenster.focus();}
function produktabsenden(url){document.insertf.action='product-insertnow-'+url+'.html';document.insertf.submit();}
function produktabsendenb(url){document.insertf.action='product-insertb3-'+url+'.html';document.insertf.submit();}
function checkUncheckAll(theElement){var theForm=theElement.form,z=0;for(z=0;z<theForm.length;z++){if(theForm[z].type=='checkbox'&&theForm[z].name!='checkall'){theForm[z].checked=theElement.checked;}}}
function getObj(obj)
{if(document.layers)
return document.layers[obj];else if(document.getElementById)
return document.getElementById(obj);else if(document.all)
return document.all[obj];else
return null;}
function showkontakt(infoname,lang){var layer=getObj('con_'+infoname);if(!layer);if(document.layers)layer.display="block";else layer.style.display="block";var layer=getObj('conlink_'+infoname);if(!layer);if(document.layers)layer.display="none";else layer.style.display="none";macheRequest("/zaehle.php?getid="+infoname+"&lang="+lang);}
function showallkontakt(st,lang){var holeids=st.split("-");for(var x=0;x<=holeids.length;x++)
{if(holeids[x]>0)
{var layer=getObj('con_'+holeids[x]);if(layer);{if(document.layers)layer.display="block";else layer.style.display="block";}
var layer=getObj('conlink_'+holeids[x]);if(layer)
{if(document.layers)layer.display="none";else layer.style.display="none";macheRequest("/zaehle.php?getid="+holeids[x]+"&lang="+lang);}}}}
function showinfo(infoname){document.getElementById(infoname).style.visibility="visible";document.getElementById(infoname).style.display="block";}
function showinfohere(infoname){if(document.getElementById(infoname).style.display=="block"){document.getElementById(infoname).style.display="none";}
else{document.getElementById(infoname).style.display="block";}}
function hideinfo(infoname){document.getElementById(infoname).style.visibility="hidden";document.getElementById(infoname).style.display="none";}
function addLoadEvent(func)
{var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){oldonload();func();}}}
function ladebalken()
{var objLadebalken=document.getElementById('ladebalken');var objgreylayer=document.getElementById('greylayer');if(objgreylayer.style.display=='block')
{selects=document.getElementsByTagName("select");for(i=0;i!=selects.length;i++){selects[i].style.visibility="visible";}
objgreylayer.style.display='none';objLadebalken.style.display='none';}
else
{var arrayPageSize=getPageSize();var arrayPageScroll=getPageScroll();var Top=(arrayPageScroll[1]+30);var Left=((arrayPageSize[0]-20-100)/2);objLadebalken.style.top=(Top<0)?"0px":Top+"px";objLadebalken.style.left=(Left<0)?"0px":Left+"px";objLadebalken.style.width=100+'px';objLadebalken.style.height=100+'px';selects=document.getElementsByTagName("select");for(i=0;i!=selects.length;i++){selects[i].style.visibility="hidden";}
objgreylayer.style.display='block';objLadebalken.style.display='block';}}
function zeige_inhalt_in_fenster(response){if(document.getElementById('profilbox')&&document.getElementById('skyscraperdiv')&&document.getElementById('profilboxDetails')&&document.getElementById('greylayer')&&document.getElementById('ladebalken')){var objProfilbox=document.getElementById('profilbox');var objSkyscraperdiv=document.getElementById('skyscraperdiv');var objProfilboxDetails=document.getElementById('profilboxDetails');var objgreylayer=document.getElementById('greylayer');var objladebalken=document.getElementById('ladebalken');var arrayPageSize=getPageSize();var arrayPageScroll=getPageScroll();var profilboxTop=(arrayPageScroll[1]+30);var profilboxLeft=((arrayPageSize[0]-20-700)/2);objProfilbox.style.top=(profilboxTop<0)?"0px":profilboxTop+"px";objProfilbox.style.left=(profilboxLeft<0)?"0px":profilboxLeft+"px";objProfilboxDetails.style.width=700+'px';objProfilboxDetails.style.height=500+'px';objProfilboxDetails.style.overflow='auto';selects=document.getElementsByTagName("select");for(i=0;i!=selects.length;i++){selects[i].style.visibility="hidden";}
objProfilboxDetails.innerHTML=response;if(navigator.appVersion.indexOf("MSIE")!=-1){pause(250);}
objSkyscraperdiv.style.display='none';objgreylayer.style.display='block';$("#profilbox").show("slow");arrayPageSize=getPageSize();}}
function formatZahl(zahl,k,fix)
{if(!k)k=0;var neu='';var f=Math.pow(10,k);zahl=''+parseInt(zahl*f+(.5*(zahl>0?1:-1)))/f;var idx=zahl.indexOf('.');if(fix)
{zahl+=(idx==-1?'.':'')
+f.toString().substring(1);}
idx=zahl.indexOf('.');if(idx==-1)idx=zahl.length;else neu=','+zahl.substr(idx+1,k);while(idx>0)
{if(idx-3>0)
neu='.'+zahl.substring(idx-3,idx)+neu;else
neu=zahl.substring(0,idx)+neu;idx-=3;}
return neu;}
function setSuchformFocus(){var Obj=getObj('suchwerttopfeld');if(!Obj);else Obj.focus();}
function setvt(lang)
{if(typeof(window.getPageSize)=="function"){var arrayPageSize=getPageSize();}else return false;var VTLeft=((arrayPageSize[0]-20-680)/2);if(VTLeft<0){VTLeft=0;}
$("#virtuelletastatur").css("left",VTLeft+"px");$.ajax({type:"GET",timeout:7000,data:{lang:lang},url:"/ajax/get_vt.php",success:function(result)
{if(result!="")
{$("#vtcontent").html(result);}}});}
if(typeof(window.getPageSize)!="function"){function getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=document.body.scrollWidth;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){windowWidth=self.innerWidth;windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=windowWidth;}else{pageWidth=xScroll;}
arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight)
return arrayPageSize;}}

function toggleMaBaHe() {
	if ($("#haboelist").css("display")  != "none") {	closeHaboeList();	}
	if ($("#gebelist").css("display") 	!= "none") {	closeGebeList();	}
	
	$height = $("#mabahelist").height();	
	$heightOffset = 20;
	if ($("#mabahelist").css("display") == "none") {
		$("#mabahelist").css("height","0");
		$("#mabahelist").css("display","block");
		$("#mabahelist").animate({"height": ($height+$heightOffset)+"px"}, "slow");
		
		//$("#haboelink").css("font-weight", "normal");
		//$("#mabahelink").css("font-weight", "normal");
		//$("#mabahelink").css("font-weight", "bold");
	}
	else {
		$("#mabahelist").animate({"height": "0px"}, "slow", function() {
				$("#mabahelist").css("height",($height-$heightOffset)+"px");
				$("#mabahelist").css("display","none");
			}
		);		
		//$("#haboelink").css("font-weight", "normal");
		//$("#mabahelink").css("font-weight", "normal");
	}
}
function closeMabaheList(elem) {
	if ($(elem).attr("id") == "closeMabahelist") {
		$height = $("#mabahelist").height();
		$("#mabahelist").animate({"height": "0px"}, function() {
			$("#mabahelist").css("height",($height-20)+"px");
			$("#mabahelist").css("display","none");
		});
	}
	else {
		$("#mabahelist").css("height",($("#mabahelist").height()-20)+"px");
		$("#mabahelist").css("display","none");
	}	 
}

function getMabaheList(language, servername) {
	$action = "getMabaheList";
	$.ajax({
		type: "POST",
		timeout: 5000,
		data:{
			action: $action,
			lang: language,
			server: servername
		},
		url:
			"/ajax/getheaderlinklist.php",
		success: function(result) {
			if(result!="0") {
				$("#innermabahelist ul").remove();
				$("#innermabahelist").append(result);
				toggleMaBaHe(); 
			}
		}
	});
}
function getHaboeList(language) {
	$action = "getHaboeList";
	$.ajax({
		type:"POST",
		timeout:7000,
		data:{
			action:$action,
			lang:language			
		},
		url:
			"/ajax/getheaderlinklist.php",
		success: function(result) {
			if(result!="0") {
				$("#innerhaboelist ul").remove();
				$("#innerhaboelist").append(result);
				toggleHaboe(); 
			}
		}
	});
}

function getEclassList(language) {
	$action = "getEclassList";
	$.ajax({
		type:"POST",
		timeout:7000,
		data:{
			action:$action,
			lang:language			
		},
		url:
			"/ajax/getheaderlinklist.php",
		success: function(result) {
			if(result!="0") {
				$("#gebelist ul").remove();
				$("#gebelist").append(result);
				toggleGebe(); 
			}
		}
	});
}


function toggleHaboe() {
	if ($("#mabahelist").css("display") != "none") {	closeMabaheList();	}
	if ($("#gebelist").css("display") 	!= "none") {	closeGebeList();	}
	
	$height = $("#haboelist").height();	
	$heightOffset = 20;
	if ($("#haboelist").css("display") == "none") {
		
		$("#haboelist").css("height","0");
		$("#haboelist").css("display","block");
		$("#haboelist").animate({"height": ($height+$heightOffset)+"px"}, "slow");
		
		//$("#haboelink").css("font-weight", "normal");
		//$("#mabahelink").css("font-weight", "normal");
		//$("#haboelink").css("font-weight", "bold");
	}
	else {
		$("#haboelist").animate({"height": "0px"}, "slow", function() {
				$("#haboelist").css("height",($height-$heightOffset)+"px");
				$("#haboelist").css("display","none");
			}
		);
		//$("#haboelink").css("font-weight", "normal");
		//$("#mabahelink").css("font-weight", "normal");

		
	}
}
function closeHaboeList(elem) {
	if ($(elem).attr("id") == "closeHaboelist") {
		$height = $("#haboelist").height();
		$("#haboelist").animate({"height": "0px"}, function() {
			$("#haboelist").css("height",($height-20)+"px");
			$("#haboelist").css("display","none");
		});
		//$("#haboelink").css("font-weight", "normal");
		//$("#mabahelink").css("font-weight", "normal");
		//$("#haboelink").css("font-weight", "bold");
	}
	else {
		$("#haboelist").css("height",($("#haboelist").height()-20)+"px");
		$("#haboelist").css("display","none");
		
		//$("#haboelink").css("font-weight", "normal");
		//$("#mabahelink").css("font-weight", "normal");
	}
}

function toggleGebe() {
	if ($("#haboelist").css("display")  != "none") {	closeHaboeList();	}
	if ($("#mabahelist").css("display") != "none") {	closeMabaheList();	}
	
	$height = $("#gebelist").height();	
	$heightOffset = 20;
	if ($("#gebelist").css("display") == "none") {
		$("#gebelist").css("height","0");
		$("#gebelist").css("display","block");
		$("#gebelist").animate({"height": ($height+$heightOffset)+"px"}, "slow");
	}
	else {
		$("#gebelist").animate({"height": "0px"}, function() {
			$("#gebelist").css("height",($height-$heightOffset)+"px");
			$("#gebelist").css("display","none");
		});
	}
}
function closeGebeList(elem) {
	if ($(elem).attr("id") == "closeGebelist") {
		$height = $("#gebelist").height();
		$("#gebelist").animate({"height": "0px"}, function() {
			$("#gebelist").css("height",($height-20)+"px");
			$("#gebelist").css("display","none");
		});
	}
	else {
		$("#gebelist").css("height",($("#gebelist").height()-20)+"px");
		$("#gebelist").css("display","none");
	}
}
