
	// class ic_disable_class_item

	function ic_disable_class_item(parent, ref) {
		this.parent = parent;
		this.ref = ref;
		this.type = null;
		
		this.input = null;
		
		this.construct();
	}
	
	ic_disable_class_item.prototype.construct = function() {
		var cl = this.ref.className;
		
		if (
			(cl.length >= 5 && cl.substr(0, 5) == "first") ||
			(cl.length >= 3 && cl.substr(0, 3) == "sec")
		) {
			this.type = "text";
			
		} else if (
			(cl.length >= 13 && cl.substr(0, 13) == "input_box_man")
		) {
			this.type = "input_man";
			if ((this.input = this.parent.get_sub(this.ref, "INPUT")) == null)
				this.input = this.parent.get_sub(this.ref, "SELECT");
				
		} else if (
			(cl.length >= 16 && cl.substr(0, 16) == "input_box_normal")
		) {
			this.type = "input_normal";
			if ((this.input = this.parent.get_sub(this.ref, "INPUT")) == null)
				this.input = this.parent.get_sub(this.ref, "SELECT");
				
		} else {
			if ((this.input = this.parent.get_sub(this.ref, "INPUT")) != null) this.type = "input_other";
			else this.type = "text_other";
		}
	}
	
	ic_disable_class_item.prototype.toggle = function(flag) {
		switch (this.type) {
			case "text" :
				if (flag) {
					this.ref.style.color = "";
					
				} else {
					this.ref.style.color = "#333333";
				}
				break;
				
			case "text_other" :
				if (flag) {
					this.ref.style.color = "";
					
				} else {
					this.ref.style.color = "#333333";
				}
				break;
				
			case "text_strict" :
				if (this.parent.strict) {
					if (flag) {
						this.ref.style.color = "";
					
					} else {
						this.ref.style.color = "#333333";
					}
				}
				
			case "input_man" :
				if (flag) {
					this.ref.className = "input_box_man";
					this.input.disabled = false;
				} else {
					this.ref.className = "input_box_man input_box_man_disabled";
					this.input.disabled = true;
				}
				break;
				
			case "input_normal" :
				if (flag) {
					this.ref.className = "input_box_normal";
					this.input.disabled = false;
				} else {
					this.ref.className = "input_box_normal input_box_normal_disabled";
					this.input.disabled = true;
				}
				break;
				
			case "input_other" :
				if (flag) {
					this.input.disabled = false;
				} else {
					this.input.disabled = true;
				}
				break;
		}
	}

	// class ic_disable_class

	function ic_disable_class(container, strict, hide_table) {
		this.container = container;
		this.items = new Array();
		this.status = true;
		this.type = null;
		this.strict = strict;
		this.hide_table = hide_table;
		this.elms = new Array();
		
		this.construct();
	}
	
	ic_disable_class.prototype.append = function(ref) {
		var item = new ic_disable_class_item(this, ref);
		this.items[this.items.length] = item;
	}
	
	ic_disable_class.prototype.get_sub = function(ref, name) {
		var founded = null;
		var pos = 0;
		
		while (founded == null && pos < ref.childNodes.length)
			if (ref.childNodes[pos].nodeType == 1 && ref.childNodes[pos].tagName.toUpperCase() == name) founded = ref.childNodes[pos];
			else pos++;
			
		return founded;
	}
	
	ic_disable_class.prototype.construct = function() {
		var cl, tbody;
		
		var loop, pos, stack = new Array();
		stack[0] = this.container;
		
		while (stack.length > 0) {
			loop = stack.pop();
			
			switch (loop.tagName.toUpperCase()) {
				case "TABLE" :
				case "P" :
				case "H4" :
					this.elms[this.elms.length] = loop;
					break;
			}
			
			if (loop.childNodes.length > 0) {
				pos = loop.childNodes.length - 1;
				while (pos >= 0) {
					if (loop.childNodes[pos].nodeType == 1) stack[stack.length] = loop.childNodes[pos];
					pos--;
				}
			}
		}
		
		var f;
		for (f = 0; f < this.elms.length; f++) {
			if ((tbody = this.get_sub(this.elms[f], "TBODY")) != null) {
				
				pos = 0;
				stack = new Array();
				stack[0] = tbody;
				
				while (stack.length > 0) {
					loop = stack.pop();
					
					if (loop.tagName.toUpperCase() == "TD" || loop.tagName.toUpperCase() == "DIV") {
						this.append(loop);
					}
					
					if (loop.childNodes.length > 0) {
						pos = loop.childNodes.length - 1;
						while (pos >= 0) {
							if (loop.childNodes[pos].nodeType == 1) stack[stack.length] = loop.childNodes[pos];
							pos--;
						}
					}
				}
				
			}
		}
	}
	
	ic_disable_class.prototype.toggle = function() {
		this.toggle_force(!this.status);
	}
	
	ic_disable_class.prototype.toggle_force = function(flag) {
		this.status = flag;
		
		if (this.type == "DIV") {
			if (this.status) {
				this.container.style.backgroundColor = "";
				this.container.style.border = "";
				
			} else {
				//this.container.style.backgroundColor = "#dcdcdc";
				//this.container.style.border = "1px solid #919191";
			}
		}
	
		var f;
		for (f = 0; f < this.items.length; f++)
			this.items[f].toggle(flag);
			
		if (this.hide_table) {
			for (f = 0; f < this.elms.length; f++) {
				if (!this.status) this.elms[f].style.display = "none";
				else this.elms[f].style.display = "";
			}
		}
	}
	
