// List Object// generic selection widget built primarily to be incorporated into other List-based widgets (MenuList, ScrollList, SelectList)// Copyright (C) 1999 Dan Steinman// Original version available at http://www.dansteinman.com/dynduo/// Distributed under the terms of the GNU Lesser General Public License, http://www.fsf.org/copyleft/lesser.html// Modified by Zentropy Partners, July 2000.var basehref = "http://" + location.hostname + "/"function List(x,y,width,itemH) {	this.name = "List"+(List.count++)	this.x = x	this.y = y	this.w = width	if (arguments.length==4) {		this.itemH = itemH		this.itemHset = true		this.h = -1	}	else {		this.itemH = null		this.itemHset = false		this.h = (is.ns)? -1 : 1000	}	this.itemSpacing = sub_border_w;	this.fontname = sub_font;	this.fontsize = sub_font_size;	this.visibility = 'inherit'	this.overOpen = false	this.menulist = null	this.indent = sub_indent		this.color = new Object()	this.color.textNormal = sub_font_color;	this.color.textSelected = sub_selected_color;	this.color.bgNormal = sub_bgcolor;	this.color.bgSelected = sub_selected_bgcolor;	this.color.border = sub_border_color	this.items = new Array()	this.selectedIndex = null	this.obj = this.name + "ListObject"	eval(this.obj + "=this")	this.add = ListAdd	this.build = ListBuild	this.activate = ListActivate	this.over = ListOver	this.out = ListOut	this.down = ListDown	this.select = ListSelect	this.deselect = ListDeselect	this.redirect = ListRedirect	this.onSelect = new Function()}function ListAdd(href,text) {	var i = this.items.length	this.items[i] = new Array()	this.items[i].selected = false	this.items[i].href = (href.indexOf("http")==-1) ? basehref + href : href	this.items[i].text = arguments[1]	this.items[i].textNormal = '<span class="'+this.name+'TextNormal">'+this.items[i].text+'</span>'	this.items[i].textSelected = '<span class="'+this.name+'TextSelected">'+this.items[i].text+'</span>'	this.h += this.itemH+this.itemSpacing	this.items[i].y = i*this.itemH+i*this.itemSpacing}function ListBuild() {	this.css = '';	this.css += css(this.name+'List',this.x,this.y,this.w,this.h,this.color.border)	for (var i=0;i<this.items.length;i++) {		this.css += css(this.name+'ListItem'+i,0,this.items[i].y,this.w,this.itemH,this.color.bgNormal)		this.css += css(this.name+'ListItemSel'+i,0,this.items[i].y,this.w,this.itemH,this.color.bgSelected,hidden)		this.css += css(this.name+'ListItemC'+i,0,this.items[i].y,this.w,this.itemH,null,null,null,"cursor:hand")	}	this.css += '.'+this.name+'TextNormal {font-family:"'+this.fontname+'"; font-size:'+this.fontsize+'; color:'+this.color.textNormal+'; background-color:transparent; margin-left:'+this.indent+'px;}\n'+	'.'+this.name+'TextSelected {font-family:"'+this.fontname+'"; font-size:'+this.fontsize+'; color:'+this.color.textSelected+'; background-color:transparent; margin-left:'+this.indent+'px;}\n'	this.div = '<div id="'+this.name+'List">\n'	for (var i=0;i<this.items.length;i++) {		this.div += '<div id="'+this.name+'ListItem'+i+'">'+this.items[i].textNormal+'</div>\n'		this.div += '<div id="'+this.name+'ListItemSel'+i+'">'+this.items[i].textSelected+'</div>\n'		this.div += '<div id="'+this.name+'ListItemC'+i+'"><img src="'+imgDir+'spacer.gif" width="'+this.w+'" height="'+this.itemH+'"></div>\n'	}	this.div += '</div>'}function ListActivate() {	if (is.ie) this.h -= 1001	this.lyr = new DynLayer(this.name+'List')	this.lyr.clipInit()	for (var i=0;i<this.items.length;i++) {		this.items[i].lyr = new DynLayer(this.name+'ListItem'+i)		this.items[i].slyr = new DynLayer(this.name+'ListItemSel'+i)		this.items[i].lyre = new DynLayer(this.name+'ListItemC'+i)		if (is.ns4) this.items[i].lyre.elm.captureEvents(Event.MOUSEDOWN | Event.MOUSEOVER | Event.MOUSEOUT)		this.items[i].lyre.elm.onmouseover = new Function(this.obj+'.over('+i+'); return false;')		this.items[i].lyre.elm.onmouseout = new Function(this.obj+'.out('+i+'); return false;')		this.items[i].lyre.elm.onmousedown = new Function(this.obj+'.down('+i+'); return false;')	} 	this.lyr.css.visibility = this.visibility;}function ListOver(i) {	if (timerID) self.clearTimeout(timerID);	if (!this.items[i].selected) {		this.items[i].slyr.show()		window.status = this.items[i].href		return true	}}function ListOut(i) {	if (!this.items[i].selected) {		this.items[i].slyr.hide()		window.status = ''		return true	}	timerID = self.setTimeout(this.obj+".menulist.hide()",delay);}function ListDown(i) {	if (!this.items[i].selected) {		if (this.selectedIndex!=null) this.deselect(this.selectedIndex)		this.select(i)	}}function ListSelect(i) {	if (timerID) self.clearTimeout(timerID);	if (this.items[i]!=null) {			this.selectedIndex = i		this.items[i].slyr.show()		this.items[i].selected = true		this.redirect(i)	}}function ListDeselect(i) {	if (this.items[i]!=null) {	   if (this.items[i].selected) {		this.items[i].slyr.hide();		this.items[i].selected = false	   }	}} function ListRedirect(i) {	window.location = this.items[i].href}List.count = 0