var tID; var flag; var dl; var dr;

// Hover - вертикальное меню
sVmenu=function() {
        hObj=document.getElementById("vmenu").getElementsByTagName("div");
        for (i=0;i<hObj.length;i++) {
                if (hObj[i].className!="active") {
                        hObj[i].onmouseover=function() { this.className="shover"; }
                        hObj[i].onmouseout=function() { this.className=""; }
                }
        }
}
// Hover - горизонтальное меню
sHmenu=function() {
        ooDiv=document.getElementById("hmenu");
        if (ooDiv) {
                hHm=document.getElementById("hmenu").getElementsByTagName("div");
                for (i=0;i<hHm.length;i++) {
                        (hHm[i].className=="active")?flag=1:null;
                        if (hHm[i].className!="l"&&hHm[i].className!="active") {
                        
                                hHm[i].onmouseover=function() { clearTimeout(tID);
                                        ooDiv=document.getElementById("hmenu"); hHm=document.getElementById("hmenu").getElementsByTagName("div");
                                        (!flag)?ooDiv.className="on":null; this.className="on"; id=parseInt(this.id.substring(1));
                                        (id==0&&hHm[id+1].className!="l-a")?hHm[id+1].className="l-on":null;
                                        (id==(hHm.length-1)&&hHm[id-1].className!="l-a")?hHm[id-1].className="l-on":null;
                                        if (id>0&&id<(hHm.length-1)) {
                                                (hHm[id+1].className!="l-a")?hHm[id+1].className="l-on":null;
                                                (hHm[id-1].className!="l-a")?hHm[id-1].className="l-on":null;
                                        }
                                }

                                hHm[i].onmouseout=function() { clearTimeout(tID);
                                        ooDiv=document.getElementById("hmenu"); hHm=document.getElementById("hmenu").getElementsByTagName("div");
                                        (!flag)?tID=setTimeout("hideM()",5):null; this.className=""; id=parseInt(this.id.substring(1));
                                        (id==0&&hHm[id+1].className!="l-a")?hHm[id+1].className="l":null;
                                        (id==(hHm.length-1)&&hHm[id-1].className!="l-a")?hHm[id-1].className="l":null;
                                        if (id>0&&id<(hHm.length-1)) {
                                                (hHm[id+1].className!="l-a")?hHm[id+1].className="l":null;
                                                (hHm[id-1].className!="l-a")?hHm[id-1].className="l":null;
                                        }
                                }

                        } else if (hHm[i].className=="active") {
                                ooDiv.className="on"; id=hHm[i].id; id=parseInt(id.substring(1));
                                if (id==0) { hHm[id+1].className="l-a"; dl=id+1; }
                                if (id==(hHm.length-1)) { hHm[id-1].className="l-a"; dr=id-1; }
                                if (id>0&&id<(hHm.length-1)) { hHm[id+1].className="l-a"; hHm[id-1].className="l-a"; dl=id+1; dr=id-1; }
                        }
                }
        }
}
function hideM() { clearTimeout(tID); ooDiv.className="off"; }

// Hover - логотипы внизу
sLogo=function() {
        if (document.getElementById("logos")) {
                hLogo=document.getElementById("logos").getElementsByTagName("img");
                for (i=0;i<hLogo.length;i++) {
                        plink=hLogo[i].src;
                        if (plink.indexOf("p.gif")==-1) {
                                hLogo[i].onmouseover=function() { l=this.src; l=l.replace(new RegExp("-g.gif\\b"),""); this.src=l+"-c.gif"; }
                                hLogo[i].onmouseout=function() { l=this.src; l=l.replace(new RegExp("-c.gif\\b"),""); this.src=l+"-g.gif"; }
                        }
                }
        }
}

// Hover - логотипы в центре
sLogov=function() {
        if (document.getElementById("logos-v")) {
                hLogo=document.getElementById("logos-v").getElementsByTagName("img");
                for (i=0;i<hLogo.length;i++) {
                        plink=hLogo[i].src;
                        if (plink.indexOf("p.gif")==-1) {
                                hLogo[i].onmouseover=function() { l=this.src; l=l.replace(new RegExp("-g.gif\\b"),""); this.src=l+"-c.gif"; }
                                hLogo[i].onmouseout=function() { l=this.src; l=l.replace(new RegExp("-c.gif\\b"),""); this.src=l+"-g.gif"; }
                        }
                }
        }
}

// Hover - кнопка (в корзину)
sAddCart=function() {
        if (document.getElementById("catalog-collum")) {
                hBtn=document.getElementById("catalog-collum").getElementsByTagName("input");
                for (i=0;i<hBtn.length;i++) {
                        if (hBtn[i].id=="btn") {
                                hBtn[i].onmouseover=function() { this.src="/i/add-cart-on.gif"; }
                                hBtn[i].onmouseout=function() { this.src="/i/add-cart-off.gif"; }
                        }
                }
        }
}

bw.ie?sVmenu():null; sHmenu(); sLogo(); sLogov(); sAddCart();
