var flag = parent.state; if (flag == "OPENED") parent.close(); else if (flag == "CLOSED") parent.open(); if (this.state == "CLOSED") { this.opener.doStart(); this.setAttribute("state", "OPENED"); } if (this.state == "OPENED") { this.closer.doStart(); this.setAttribute("state", "CLOSED"); } if (this.state == "OPENED") { this.setAttribute('width', 18); this.setAttribute("state", "CLOSED"); } if (parent.state == "OPENED") setRotation(90); else setRotation(-90);