// JavaScript Document

var selectbox = function(input, value, option) {
	
	this.input = input;
	this.value = value;
	this.option = option;
	this.action = '';
	this.form = 'enabled';
	
	this.box = function(method) {
		if(this.form != 'disabled') {
			this.action = method;
		}
	}
	
	this.choice = function(l, v) {
		if(this.form != 'disabled') {
			document.getElementById(this.value).innerHTML = l;
			document.getElementById(this.input).value = v;
			this.action = 'hide';
		}
	}
	
	this.form_action = function(l, v) {
		if(this.form != 'disabled') {
			document.getElementById(this.value).innerHTML = l;
			document.selectform.action = v+'.php';
			this.action = 'hide';
		}
	}
	
	this.show = function() {
		
		if(this.form != 'disabled') {
			if(this.action == 'show') {
				document.getElementById(this.option).style.display = 'block';
				this.action = 'hide';
			}
			else if(this.action == 'hide') {
				document.getElementById(this.option).style.display = 'none';			
			}
		}
		
	}
	
	this.setDisabled = function() {
		this.form = 'disabled';
	}
	
	this.setEnabled = function() {
		this.form = 'enabled';
	}
	
}