actions = new Array();categories = new Array();parentAcIdx = 0;function brandBoxGroup(title,marginTop,picto,imgWidth,imgHeight,bDir,color){ this.brandBoxes = new Array(); this.addBrandBox = addBrandBox; this.show = showBrandBoxGroup; this.idx = actions.length; this.title = title; this.marginTop = marginTop; this.picto = picto; actions[actions.length] = this; this.imgWidth = imgWidth; this.imgHeight = imgHeight; this.bDir = bDir; this.color = color;}function addBrandBox(o){ this.brandBoxes[this.brandBoxes.length] = o;}function showBrandBoxGroup(el){ oHTML = "<table width='128' cellspacing='0' cellpadding='4' style='border-bottom:1px solid #006;margin-top:" + this.marginTop + "px;border-right:1px solid #006;border-left:1px solid #006;' onmouseout='rdyHide()'><tr><td colspan=2 style='border-top:1px solid #006;padding:4px;border-bottom:1px solid #006;background-color:"+this.color+"' ><b>"+this.title+"</b></td></tr>"; i = 0; while (i < this.brandBoxes.length) { j = 0; while (j < this.brandBoxes[i].categories.length) { oHTML += "<tr style='cursor:hand;position:relative' onmouseover='hideAble=true;hideBrands();bpON(this,"+this.idx+","+i+","+j+");hideAble=false' id=cat"+this.idx+""+i+""+j+" "+((this.brandBoxes[i].categories[j].action != "") ? "onclick='"+this.brandBoxes[i].categories[j].action+"'" : "")+"><td bgcolor='#FFFFFF' style='padding-right:0px;padding-left:2px'><img src='../../img/cmn/act_fleche_gauche.gif' id=arrow"+this.idx+""+i+""+j+" height=14 width=8 align=absmiddle></td><td id=cell"+this.idx+""+i+""+j+"1 bgcolor='#FFFFFF'><a href='javascript:void(0)' style='text-decoration:none;padding-left:0px'>" + this.brandBoxes[i].categories[j].title + "</a></td></tr>"; j++; } i++; } oHTML += "</table>"; el.innerHTML += oHTML;}function brandBox(title,marginTop){ this.marginTop = marginTop; this.title = title; this.addCategory = addCategory; this.idx = actions.length; actions[actions.length] = this; parentAcIdx = this.idx; this.categories = new Array();}function category(title,action){ this.title = title; this.action = action; this.brands = new Array(); this.addBrand = addBrand;}function brand(name,id,cats,logo){ this.name = name; this.id = id; this.cats = cats; this.logo = new Image(); this.logo.src = logo;}function addCategory(title,dest){ this.categories[this.categories.length] = new category(title,dest); return this.categories[this.categories.length-1];}function addBrand(name,id,cats,logo){ this.brands[this.brands.length] = new brand(name,id,cats,logo);}function rdyHide(idxGrp,idxBox,idxCat){ hideAble=true; setTimeout("hideBrands()",500);}activeCat = -1;activeIdx = -1;divs = new Array();function findPosition( oLink ) { if( oLink.offsetParent ) { for( var posX = 0, posY = 0; oLink.offsetParent; oLink = oLink.offsetParent ) { posX += oLink.offsetLeft; posY += oLink.offsetTop; } return [ posX, posY ]; } else { return [ oLink.x, oLink.y ]; }}function bpON(obj,idxGrp,idxBox,idxCat){ if (activeCat != -1) hideBrands(); activeCat = obj; rowIdx = 0; colIdx = 0; i = 0; overText = document.createElement("DIV"); overText.style.position = "absolute"; overText.style.zIndex = 215; overText.style.top = findPosition(document.getElementById("cat"+idxGrp+""+idxBox+""+idxCat))[1]; overText.style.left = findPosition(document.getElementById("cat"+idxGrp+""+idxBox+""+idxCat))[0] - 5; overText.style.height = obj.clientHeight; overText.style.width = obj.clientWidth + 5; overText.style.borderTop = "1px solid #006"; overText.style.borderBottom = "1px solid #006"; overText.style.backgroundColor = "#FFFFFF"; overText.innerHTML = "<table cellpadding=4 cellspacing=0 style='margin-left:5px' width='"+obj.clientWidth+"'><tr style='cursor:hand;position:relative' onmouseout='rdyHide("+idxGrp+","+idxBox+","+idxCat+")' onmouseover='hideAble=false'><td bgcolor='#FFFFFF' style='padding-right:0px;padding-left:2px' width=8><img src='../../img/cmn/act_fleche_gauche_vert.gif' height=14 width=8 align=absmiddle onmouseout='return false'></td><td bgcolor='#FFFFFF'>" + actions[idxGrp].brandBoxes[idxBox].categories[idxCat].title + "</td></tr></table>"; divs[divs.length] = document.body.appendChild(overText); while (i < actions[idxGrp].brandBoxes[idxBox].categories[idxCat].brands.length) { t = findPosition(document.getElementById("cat"+idxGrp+""+idxBox+""+idxCat))[1] + (rowIdx*65); if (actions[idxGrp].bDir) l = findPosition(document.getElementById("cat"+idxGrp+""+idxBox+""+idxCat))[0] - 86 - (colIdx*81); else l = findPosition(document.getElementById("cat"+idxGrp+""+idxBox+""+idxCat))[0] + 126 + (colIdx*81); bgBrand = document.createElement("DIV"); bgBrand.id = "dBrandBG" + i; bgBrand.className = "noprint"; bgBrand.style.position = "absolute"; bgBrand.style.zIndex = 165; bgBrand.style.top = t; bgBrand.style.left = l; bgBrand.style.display = "none"; bgBrand.style.backgroundColor = "#FFFFFF"; divs[divs.length] = document.body.appendChild(bgBrand); dBrand = document.createElement("DIV"); dBrand.id = "dBrand"; dBrand.id = "dbr" + i; dBrand.className = "noprint"; dBrand.style.position = "absolute"; dBrand.style.zIndex = 166; dBrand.style.top = t; dBrand.style.left = l; dBrand.style.display = "none"; divs[divs.length] = document.body.appendChild(dBrand); iHTML = "<table id=br" + i + " cellpadding=0 cellspacing=0 style='border:1px solid #006;cursor:hand' onclick='selectBrand(" + i + "," + idxGrp +","+idxBox+","+idxCat+")' onmouseover='rollOn(" + i + ")' onmouseout='rollOff(" + i + ")' height=66><tr><td width=80 height=10 align=center style='cursor:hand' valign=top>Haga clic aquí</td></tr><tr><td width=80 align=center><img src='" + actions[idxGrp].brandBoxes[idxBox].categories[idxCat].brands[i].logo.src + "'></td></tr></table>"; dBrand.innerHTML = iHTML; bgBrand.style.width = 81; bgBrand.style.height = 66; dBrand.style.display = ""; bgBrand.style.display = ""; i++; colIdx++; if (colIdx == 3) rowIdx++; if (colIdx == 3) colIdx = 0; } activeIdx = idxGrp;}hideAble = true;function hideBrands(){ if (hideAble) { j = 0; while (j < divs.length) { document.body.removeChild(divs[j]); j++; } divs = new Array(); activeCat = -1; if (activeCustomEl != -1) {activeCustomEl.style.display = "none"; activeCustomEl = -1}; }}function rollOn(n){ document.getElementById("dBrandBG" + n).style.backgroundColor = "#DAE5F0"; document.getElementById("dbr" + n).style.zIndex = 200; hideAble = false;} function rollOff(n){ document.getElementById("dBrandBG" + n).style.backgroundColor = "#FFFFFF"; document.getElementById("dbr" + n).style.zIndex = 166; hideAble = true; setTimeout("hideBrands()",500);} 