// General.js
// By: John Oatis
// For: Critical Mix, inc.
// Copyright: 2007
// Date: June 1, 2007
// General Javascript functions
// Functions:
// cell_click
// cell_input

// cell_click, called by table cells containing input elements
// calls cell_input().
function cell_click(cell){
	var children = cell.childNodes;
	for (var i = 0; i < children.length; i++){
		cell_input(children[i]);
	}
}

// cell_input, called by cell_click, checks radios
// or focuses on an input contained in a cell 
// cannot check checkboxes because the clicks cancel each other out
function cell_input(node){
    switch(node.type){
    	case "radio" :
        	var inputs = document.getElementsByName(node.name);
    		for (i = 0; i < inputs.length; i++){
				inputs[i].checked = false;
			}
			node.checked = true;
        	break;
        default :
        	break;
    }
}