/*navi:2749954.97*/
//######NAVIGATION######
//######BILD-Formate Pull-Down######
var blocker=0;
var logo=0;
function logoTimer(){
if (blocker==1){
	document.getElementById('bildFormate').style.display ='block';
}else{
	document.getElementById('bildFormate').style.display='none';
}
}
if ((document.location.href.search(/www.bild.de\/$/) >= 0) ||
    (document.location.href.search(/BILD\/Home\/Home.html$/) >= 0))
{
var klLogo = document.getElementById('logoBTO').innerHTML;
var grLogo = klLogo + "<div id='bildFormate'><div class='computerbild'><a href='http://www.computerbild.de' target='_blank' id='computerbild'></a></div><div class='sportbild'><a href='http://www.sportbild.de' target='_blank' id='sportbild'></a></div><div class='bildderfrau'><a href='http://www.bildderfrau.de' target='_blank' id='bildderfrau'></a></div><div class='autobild'><a href='http://www.autobild.de' target='_blank' id='autobild'></a></div></div>";
document.getElementById('logoBTO').innerHTML = grLogo;
document.getElementById('logoBTO').onmouseover = function(){blocker=1;setTimeout("logoTimer()",800);
document.getElementById('logoBTO').onmouseout = function(){blocker=0;setTimeout("logoTimer()",500);}
document.getElementById('bildFormate').onmouseover = function(){blocker=1;setTimeout("logoTimer()",100);}
document.getElementById('bildFormate').onmouseout = function(){blocker=0;setTimeout("logoTimer()",500);}}
var  bildLogos=document.getElementById('bildFormate').getElementsByTagName('a');
var anzahlLogos=bildLogos.length;
for(var i=0;i<anzahlLogos;i++){
bildLogos[i].onmouseover=function(){this.style.background="transparent";};
bildLogos[i].onmouseout=function(){this.style.backgroundImage="";};
}
document.getElementById('computerbild').onclick=function(){loadRedirectPixel('homelogo/ComputerBild');wt_send_timeparams('ce1=homelogo/ComputerBild;ce2='+document.location.href+';ce3=http://www.computerbild.de',0)}
document.getElementById('sportbild').onclick=function(){loadRedirectPixel('homelogo/Sportbild');wt_send_timeparams('ce1=homelogo/Sportbild;ce2='+document.location.href+';ce3=http://www.sportbild.de',0)}
document.getElementById('bildderfrau').onclick=function(){loadRedirectPixel('homelogo/BildDerFrau');wt_send_timeparams('ce1=homelogo/BildDerFrau;ce2='+document.location.href+';ce3=http://www.bildderfrau.de',0)}
document.getElementById('autobild').onclick=function(){loadRedirectPixel('homelogo/AutoBild');wt_send_timeparams('ce1=homelogo/AutoBild;ce2='+document.location.href+';ce3=http://www.autobild.de',0)}
}

//######SalesNavi######
//Maus auf SalesNavi
if(document.getElementById('salesItems')){
var  sItems=document.getElementById('salesItems').getElementsByTagName('li');
var anz1=sItems.length;
for(var i=0;i<anz1;i++){
sItems[i].onmouseover=anzaktiv;
sItems[i].onmouseout=anzinaktiv;
if(sItems[i].innerHTML.match(/<span/i)){
sItems[i].d=1;
}
}
}
function anzaktiv(){
if(this.d==1){
this.getElementsByTagName('span')[0].style.display="block";
}
}
function anzinaktiv(){
if(this.d==1){
this.getElementsByTagName('span')[0].style.display="none";
}
}
/*
var sBox=document.getElementById('selectField').getElementsByTagName('div');
var anz2=sBox.length;
for(var i=0;i<anz2;i++){
sBox[i].onmouseover=openSearch;
sBox[i].onmouseout=closeSearch;
if(i>1){sBox[i].onclick=setSearch;}
}
function openSearch(){
for(var i=2;i<anz2;i++){
sBox[i].style.display="block";
}
if(this!=sBox[1]){
if(this.innerHTML=="BILD.DE"){
this.style.backgroundColor="#d00";
this.style.color="#FFF";
}else{
this.style.backgroundColor="#666";
this.style.color="#fff";
}
}
sBox[0].onclick=closeSearch;
}
function closeSearch(){
for(var i=2;i<anz2;i++){
sBox[i].style.backgroundColor="#fff";
sBox[i].style.color="#666";
sBox[i].style.display="none";
}
sBox[0].onclick=openSearch;
}
function setSearch(){
var site="all";
if (this.innerHTML=="BILD.DE"){
site="bto";
}else if (this.innerHTML=="SHOPPING"){
site="product";
}
document.getElementById("whichSearch").value=site;
feld1=sBox[1].innerHTML;
sBox[1].innerHTML=this.innerHTML;
this.innerHTML=feld1;
closeSearch();
}
*/
//######Hauptmenue######
//Maus auf Hauptnavi
var  mItems=document.getElementById('mainNavi').getElementsByTagName('li');
var anz3=mItems.length;
var aktivmenue=-1;
for(var i=0;i<anz3;i++){
mItems[i].w=i;
mItems[i].onmouseover=subauf;
mItems[i].onmouseout=function(){mausraus(this.w)};
if(mItems[i].className=="mainActive"){
aktivmenue=i;
}
// else {
// wobinich=document.location.href.match(/BILD\/Home\/Home|bild\.de\/$/);
// if(wobinich){
// regio=anz3-1;
// mItems[regio].className="mainActive";
// aktivmenue=regio;
// }
// } 
}
//Maus auf SubNavi
var  subItems=document.getElementById('subNavi').getElementsByTagName('ul');
var anz4=subItems.length;
for(var i=0;i<anz4;i++){
subItems[i].w=i;
subItems[i].onmouseover=subauf;
subItems[i].onmouseout=function(){mausraus(this.w)};
}
//Maus auf Subnavipunkt (fuer  "Anzeige")
var  subwerb=document.getElementById('subNavi').getElementsByTagName('li');
var anz5=subwerb.length;
for(var j=0;j<anz5;j++){
subwerb[j].w=j;
subwerb[j].onmouseover=swerbauf;
subwerb[j].onmouseout=swerbzu;
if(subwerb[j].innerHTML.match(/<span/i)){
subwerb[j].d=1;
}
}
if (aktivmenue==-1 && anz4>anz3){
aktivmenue=anz4-1;
}
(aktivmenue!=-1)?subItems[aktivmenue].style.display="block":"";
var aktivbremse=0,zuletztaktiv=aktivmenue;
function subauf(){
for(var i=0;i< anz4;i++){
subItems[i].style.display="none";
}
if(zuletztaktiv!=aktivmenue){
mItems[zuletztaktiv].getElementsByTagName('a')[0].style.background="transparent";
mItems[zuletztaktiv].getElementsByTagName('a')[0].style.color="#fff";
}
subItems[this.w].style.display="block";
if(this.w!=aktivmenue){
mItems[this.w].getElementsByTagName('a')[0].style.background="transparent";
mItems[this.w].getElementsByTagName('a')[0].style.color="#F90";
}
aktivbremse=1;
zuletztaktiv=this.w;
}
function mausraus(was){
aktivbremse=0;
vz=0;
verzoegerung(was,vz);
}
function verzoegerung(was){
if(aktivbremse==0){
vz++;
if(vz<30){
setTimeout('verzoegerung('+was+')',100);
}else{
subzu(was);
}
}else{
vz=0;
}
}
function subzu(was){
if(aktivbremse==0){
for(var i=0;i< anz4;i++){
subItems[i].style.display="none";
if(i!=aktivmenue){
mItems[i].getElementsByTagName('a')[0].style.background="transparent";
mItems[i].getElementsByTagName('a')[0].style.color="#fff";
}else{
mItems[i].getElementsByTagName('a')[0].style.color="#fff"; // kA für was
}
}
if(aktivmenue!=-1){
subItems[aktivmenue].style.display="block";
mItems[aktivmenue].getElementsByTagName('a')[0].style.background="#000";
mItems[aktivmenue].getElementsByTagName('a')[0].style.color="#f90"; // orange bei mainActive nach hover
}
}
}
function swerbauf(){
subwerb[this.w].style.backgroundColor="#464646";
subwerb[this.w].style.color="#d00";
if(subwerb[this.w].d==1){
subwerb[this.w].getElementsByTagName('span')[0].style.display="block";
}
}
function swerbzu(){
subwerb[this.w].style.backgroundColor="#000";
subwerb[this.w].style.color="#666";
if(subwerb[this.w].d==1){
subwerb[this.w].getElementsByTagName('span')[0].style.display="none";
}
}

