function preload(image_src)
{ var temp=new Image();	temp.src=image_src;	return temp; }

var ticker1=0;
var ticker2=0;
var w;

function init_content()
{
 var i;
 var ifs=parent.frames;
 var ifo=parent.document.getElementsByTagName("iframe");
 if(ifs&&ifo.length>0)
 {
  for(i=0;i<ifs.length;i++)
  {
   if(ifs[i].name==window.name)
   {
    ifo[i].style.height=(document.getElementById("ifrc").offsetHeight+100)+"px";
   }
  }
 }

 ticker1=document.getElementById("ticker1");
 ticker2=document.getElementById("ticker2");
 if(ticker1&&ticker2)
 {
	w=ticker1.offsetWidth;
	ticker1.style.left="0px";
	ticker2.style.left="0px";//String(w)+"px";
      ticker2.style.visibility="visible";
	ticker();
 }
 init_navi2();
 if(document.getElementById("navigation"))
 {
   if(document.getElementById("navigation").innerHTML.replace(/\s/g,"")=="")
	{
		document.getElementById("navigation").style.display="none";
		if(document.getElementById("leftcolumn"))
			document.getElementById("leftcolumn").style.display="block";
	}
 }
 if(window.replace_iframe)
	f_replace_iframe();
}
var print_ifr=0;
function f_replace_iframe()
{	
	if(!print_ifr)
	{
	if(document.getElementsByTagName("iframe").length>0)
	{
		if (window.XMLHttpRequest)
		{
			xmlhttp=new XMLHttpRequest();
		}
		// code for IE
		else if (window.ActiveXObject)
		{
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
		xmlhttp.open("GET", document.getElementsByTagName("iframe")[0].src);
		xmlhttp.onreadystatechange = function() {
			print_ifr=document.createElement("div");

			if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {							
				print_ifr.innerHTML=xmlhttp.responseText;
				if(print_ifr.getElementsByTagName("body").length>0)
					print_ifr.innerHTML=print_ifr.getElementsByTagName("body")[0].innerHTML;
				var pn=document.getElementsByTagName("iframe")[0].parentNode;
				var ri=document.getElementsByTagName("iframe")[0];
				pn.replaceChild(print_ifr,ri);
			}
		}
		xmlhttp.send(null);
	}
	}
}

function ticker()
{
        t1=parseInt(ticker1.style.left.replace("px",""));
        t2=parseInt(ticker2.style.left.replace("px",""));
        if( t1<-w)
        {
            t1=w;
            ticker1.style.left=String(t1)+"px";
        }
        if( t2<-2*w)
        {
         t2=0;
         ticker2.style.left=String(t2)+"px";
        }
        ticker1.style.left=String(t1-1)+"px";
        ticker2.style.left=String(t2-1)+"px";
        setTimeout("ticker()",20);
}
function f1()
{
popup('/C1256D9100331610/f1_index_e.html',792,565,'F1_FS')
}
function f1_d()
{
popup('/C1256D9100331610/f1_index.html',792,565,'F1_FS')
}
function jumpPortal() {  Navigation = window.open("https://portal.mahle.com/", "Navigation", "resizable=yes");  Navigation.focus();  } 

function popup(PopURL,x,y,wname) 
{
//	var pg=new makePageCoords();
	var fens=window.open(PopURL,wname,'directories=no,location=no,menubar=no,resizable=no,status=no,scrollbars=yes,toolbar=no,width='+x+',height='+y); 
	fens.focus();
}

function popup2(PopURL,x,y,wname) 
{
	var fens=window.open(PopURL,wname,'directories=no,location=no,menubar=no,resizable=yes,status=no,scrollbars=yes,toolbar=no,width='+x+',height='+y); 
	fens.focus();
}
function go(q)
{
	if(document.forms[0].suchfeld.value!="")
		window.location.href=q+"?open&q="+document.forms[0].suchfeld.value+"&#se";
}

function gosb(o,targets,sbid)
{
 if(!o)
	o=document.getElementById(sbid);
 if(o.options.selectedIndex==0)
   return;
 var t=targets.split(",");
 var target="";
 if(o.options.selectedIndex>t.length)
    target=t[0];
 else
    target=t[o.options.selectedIndex-1];
 if(target=="_top")
 {
  window.location.href=o.options[o.options.selectedIndex].value;
  return;
 }
 if(target=="_blank")
 {
  window.open(o.options[o.options.selectedIndex].value,"_blank","location=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=yes");
  return;
 }
  window.location.href=o.options[o.options.selectedIndex].value;
  return;
// frames[0].location.href=o.options[o.options.selectedIndex].value;
}

function switch_l(nl)
{
 window.location.href="/"+JSBaseReplicaIDx+"/vwContentByKey/"+fldkey.substring(0,fldkey.length-2)+nl
}

var currn2=0;
var n2=new Array();
var n2t=new Array();


function init_navi2()
{
	var i=0;
	var o=document.getElementById("navi2");
	if(o)
	{
	max=o.parentNode.offsetWidth;
	if(o.offsetWidth>=max)
	{
		max-=33;
		var tmp=0;
		document.getElementById("arrows").style.visibility="visible";
		n2[0]=0;
		n2t[0]=0;
		var tds=o.getElementsByTagName("td");
		var j=0;
		for(i=0;i<tds.length;i++)
		{
			tmp+=tds[i].offsetWidth;
			if(tmp>max)
			{
				j++;
				n2[j]=i;
				n2t[j]=i;
				tds[i].style.visibility="hidden";
				tmp=tds[i].offsetWidth;
			}
			if(tds[i].className.indexOf("IOP_1")>-1)
			{
				currn2=j;
			}
		}
		if(tmp<max)
		{
			for(i=n2[j]-1;i>=0;i--)
			{
				tmp+=tds[i].offsetWidth;

				if(tmp>max)
				{
					n2[j]=i+1;
					break;
				}
			}
		}
		move_n2(0);
	}
	o.style.visibility="visible";

	}
}

function move_n2(x)
{
	currn2+=x;
	if(currn2<0)
		currn2=0;
	else
	{
		if(currn2>=n2.length)
			currn2=n2.length-1;
		else
		{
			var o=document.getElementById("navi2");
			var tds=o.getElementsByTagName("td");
			if(tds.length>0)
			{
				o.style.left=-tds[n2[currn2]].offsetLeft;
				tds[n2t[currn2]].style.visibility="visible";
				if((currn2+1)<n2.length)
					tds[n2t[currn2+1]].style.visibility="hidden";
				o=document.getElementById("arrows");
				if(currn2==0)
					o.getElementsByTagName("img")[0].src=o.getElementsByTagName("img")[0].src.replace(/l2/,"l1");
				else
					o.getElementsByTagName("img")[0].src=o.getElementsByTagName("img")[0].src.replace(/l1/,"l2");
				if(currn2+1==n2.length)
					o.getElementsByTagName("img")[1].src=o.getElementsByTagName("img")[1].src.replace(/r2/,"r1");
				else
					o.getElementsByTagName("img")[1].src=o.getElementsByTagName("img")[1].src.replace(/r1/,"r2");
			}
		}
	}	
}
