function tbl_init (id, skip_rows, leave_rows, normal_class, inv_class, hover_class, click_class) {
	if(document.all || document.getElementById) {
		var table = null;
		if(document.getElementById) {
			table = document.getElementById(id);
		} else {
			table = document.all[id];
		}
		if(table != null && table.length == null) {
			for(var i = skip_rows; i < table.rows.length - leave_rows; i++) {
				if(i % 2 == 0) {
					table.rows[i].rowclass = normal_class;
				} else {
					table.rows[i].rowclass = inv_class;
				}
				table.rows[i].className = table.rows[i].rowclass;
				table.rows[i].hoverclass = hover_class;
				table.rows[i].clickclass = click_class;
				table.rows[i].onmouseover = tbl_mouseover;
				table.rows[i].onmouseout = tbl_mouseout;
				table.rows[i].onclick = tbl_click;
				table.rows[i].clicked = false;
			}
		}
	}
}

function tbl_mouseover() {
	if(this.hoverclass && !this.clicked) {
		this.className = this.hoverclass;
	}
}

function tbl_mouseout() {
	if(this.rowclass && !this.clicked) {
		this.className = this.rowclass;
	}
}

function tbl_click() {
	if(this.clickclass) {
		if(this.clicked) {
			this.clicked = false;
			this.onmouseover();
		} else {
			this.clicked = true;
			this.className = this.clickclass;
		}
	}
}
