function NavList(css_class,current,time) {
	this.css_class = css_class;
	this.current = current;
	this.elements = false;
	this.time = time;
}
NavList.prototype.setImgSrc = function(img,suffix) {
	img.src = img.src.replace(/(_on|_off|_over)/,suffix);
}
NavList.prototype.subNavId = function(nav_id) {
	return nav_id.replace('slide_','subnav_');
}
NavList.prototype.doMouseOver = function(e) {
	var args = $A(arguments);
	args.shift();
	var num = args[0];
	if(this.current == this.elements[num].id) {
	} else {
		this.setImgSrc(this.elements[num],'_over');
	}
}
NavList.prototype.doMouseOut = function(e) {
	var args = $A(arguments);
	args.shift();
	var num = args[0];
	if(this.current == this.elements[num].id) {
	} else {
		this.setImgSrc(this.elements[num],'_off');
	}
}
NavList.prototype.hideAndShow = function(hide_id,show_num) {
	var hide_sub_id = this.subNavId(hide_id);
	var show_sub_id = this.subNavId(this.elements[show_num].id);
	new Effect.BlindUp(hide_sub_id,{duration: this.time,queue: {scope: 'subnav',position: 'end'}});
	this.setImgSrc($(hide_id),'_off');
	new Effect.BlindDown(show_sub_id,{duration: this.time,queue: {scope: 'subnav',position: 'end'}});
	this.setImgSrc(this.elements[show_num],'_on');
	this.current = this.elements[show_num].id;
}
NavList.prototype.showOne = function(show_num) {
	var show_sub_id = this.subNavId(this.elements[show_num].id);
	new Effect.BlindDown(show_sub_id,{duration: this.time});
	this.setImgSrc(this.elements[show_num],'_on');
	this.current = this.elements[show_num].id;
}
NavList.prototype.doClick = function(e) {
	var args = $A(arguments);
	args.shift();
	var num = args[0];
	if(this.current == this.elements[num].id)
		return;
	if(this.current)
		this.hideAndShow(this.current,num);
	else
		this.showOne(num);
}
NavList.prototype.init = function() {
	this.elements = document.getElementsByClassName(this.css_class);
	for(var i = 0, len = this.elements.length; i < len; i++) {
		Event.observe(this.elements[i],'mouseover',this.doMouseOver.bindAsEventListener(this,i));
		Event.observe(this.elements[i],'mouseout',this.doMouseOut.bindAsEventListener(this,i));
		Event.observe(this.elements[i],'click',this.doClick.bindAsEventListener(this,i));
	}
}

var load_imgs = new Array();
function PreloadNav(selector,states) {
	var imgs = $$(selector);
	imgs.each(function(img) {
		states.each(function(state) {
			var new_src = img.src.replace(/(_on|_off|_over)/,state);
			if(new_src != img.src) {
				load_imgs[load_imgs.length] = new Image();
				load_imgs[load_imgs.length - 1].src = new_src;
			}
		});
	});
}