function MakeDependency(){
	/*
	INTRUCTIONS
		USE 1 - revealing
			handle elements has the class 'dependency-XXX' where XXX is the id of the dependency
			dependency element needs the class 'js-hidden' 
		EXAMPLE
			<label class="dependency-flip-options" for="my-checkbox">Agree to the simian demands</label>
			<input id="my-checkbox" type="checkbox" name="simian-demands" />
			<div id="options" class="js-hidden">
				You now owe a bunch of bananas 
			</div>
		
		USE 2 - hiding
			handle elements has the class 'dependency-flip-XXX' where XXX is the id of the dependency
			dependency element needs the class
		EXAMPLE
			<label class="dependency-flip-more-options" for="my-second-checkbox">Turn off options</label>
			<input id="my-second-checkbox" type="checkbox" name="turn-off" />
			<div id="more-options">
				
			</div>
	*/
	var all_tags = document.getElementsByTagName('*')
	var num_tags = all_tags.length
	
	for (var i=0; i<num_tags; i++){
		var handle = all_tags[i]
		var class_name = handle.className.split('dependency-')
		
		if (class_name.length == 2){ // limitation - can only have one dependency
			
			class_name =  class_name[1].split(' ')[0]
			var dependency = class_name.replace('flip-','') // remove flip parameter
			
			var on = 'block'
			var off = ''
			
			if (dependency.length != class_name.length){ // flip parameter was passed
				on = 'none'
			}
			
			dependency = document.getElementById(dependency)
			handle.dependency = dependency
			handle.on = on
			handle.off = off
			
			if (handle.nodeName == 'SELECT'){ // DROPDOWN
				
				handle.onchange = function(){
					this.dependency.style.display = (this.value) ? this.on : this.off
				}
				handle.onchange() // set default
				
			} else if (handle.nodeName == 'LABEL'){ // CHECKBOX
				
				if (handle.htmlFor){ // checkbox that has a for label
					handle.checky = document.getElementById(handle.htmlFor)
					handle.checky.dependency = handle.dependency
					handle.checky.on = on
					handle.checky.off = off
					
					handle.checky.onchange = function(){
						var state = this.checked
						this.dependency.style.display = (state) ? this.on : this.off
					}
					handle.checky.onchange() // set default
					
				} else { // checkbox that is child of label
					handle.onclick = function(){
						var state = this.firstChild.checked // assumes no whitespace between label and input 
						this.dependency.style.display = (state) ? this.on : this.off
					}
					handle.onclick() // set default
				}
				
			} else { // ANY OTHER ELEMENT
				handle.on = false // default is always off
				
				handle.onclick = function(){
					if (this.on){
						this.dependency.style.display = this.off
						this.on = false
					} else {
						this.dependency.style.display = this.on
						this.on = true
					}
				}
			}
		}
	}
}
MakeDependency()