// NAVIGATION OBJECT // provides rollover functions function NavObject() { // attributes this.label = new Array(); this.segments = new Array(); this.segcount = 0; // methods this.setLabel = setLabel; this.addSegment = addSegment; this.change = change; } function setLabel(labelElem, labelFileNorm, labelFileHigh) { this.label['elem'] = document.images[labelElem]; this.label['norm'] = new Image(); this.label['norm'].src = imgLangDir + labelFileNorm; this.label['high'] = new Image(); this.label['high'].src = imgLangDir + labelFileHigh; } function addSegment(segElem, segFileNorm, segFileHigh) { var seg = new Array(); seg['elem'] = document.images[segElem]; seg['norm'] = new Image() seg['norm'].src = imgDir + segFileNorm; seg['high'] = new Image() seg['high'].src = imgDir + segFileHigh; //this.segments[this.segCount] = seg; this.segments.push(seg); this.segcount++; //alert (this.segcount); } function change(type) { this.label['elem'].src = this.label[type].src; //alert (this.segments.length); for(var i=0; i < this.segments.length; i++) { this.segments[i]['elem'].src = this.segments[i][type].src; } }