function toggleSearch() { var search= document.getElementById('search'); if (search.style.display== 'block') search.style.display= 'none'; else search.style.display= 'block'; } // returns absolute x and y pos of object function zxcPos(zxcobj){ zxclft=zxcobj.offsetLeft; zxctop=zxcobj.offsetTop; while(zxcobj.offsetParent!=null){ zxcpar=zxcobj.offsetParent; zxclft+=zxcpar.offsetLeft; zxctop+=zxcpar.offsetTop; zxcobj=zxcpar; } return [zxclft,zxctop]; } /* CATEGORY POPUP */ // static factory method CategoryElement.elementList= new Array(); CategoryElement.instance= function(elementId,openerElementId) { if (!CategoryElement.elementList[elementId]) CategoryElement.elementList[elementId]= new CategoryElement(elementId,openerElementId); return CategoryElement.elementList[elementId]; } // class function CategoryElement(elementId,openerElementId) { this.cancelHide= 0; this.element= document.getElementById(elementId); this.openerElement= document.getElementById(openerElementId); this.oldOpenerClass= this.openerElement.className; this.disapear(); this.openerElement.categoryElement= this; this.openerElement.onmouseover= function() { CategoryElement.instance(this.categoryElement.element.id,null).show(); } this.openerElement.onmouseout= function() { setTimeout("CategoryElement.instance('"+this.categoryElement.element.id+"',null).hide()",200); } this.element.onmouseover= function() { CategoryElement.instance(this.id,null).show(); } this.element.onmouseout= function() { setTimeout("CategoryElement.instance('"+this.id+"',null).hide()",200); } } CategoryElement.prototype.appear= function(element) { // store old style class this.oldOpenerClass= this.openerElement.className; this.openerElement.className= this.oldOpenerClass+" hover"; // align with opener element.style.left= zxcPos(this.openerElement)[0]+'px'; element.style.top= zxcPos(this.openerElement)[1]+this.openerElement.clientHeight+'px'; // let box appear return Effect.Appear(element, {duration: .2}); } CategoryElement.prototype.disapear= function (element) { // restore old style class this.openerElement.className= this.oldOpenerClass; // let box disappear Element.hide(this.element); } CategoryElement.prototype.show= function () { this.cancelHide++; if (this.cancelHide> 1) return; this.appear(this.element); } CategoryElement.prototype.hide= function () { if (this.cancelHide> 0) this.cancelHide--; if (this.cancelHide> 0) return; this.disapear(this.element); }