// Response Checking Code
function IsReady(form) {
var submission_string=""; // debugging

/*
for (var elems=0; elems < form.length; elems++)
{
submission_string += form.name + "_" +
        form.elements[elems].name + "=" +
        form.elements[elems].value + " " + 
	form.elements[elems].type + "\n";
	type =  form.elements[elems].type  ;
	qname = form.elements[elems].name ;
	qid = form.elements[elems].id ; // radio array have id set
//alert (type + "name=" + qname + "id=" + qid) ;
	}
alert("finished" + submission_string) ;
*/

for (var elems=0; elems < form.length; elems++)
{
	type =  form.elements[elems].type  ;
	if (form.elements[elems].name == "") continue ; // only for named elements
	if (type == "hidden") continue ;// don't need to check hidden items 
	if (type == "checkbox") continue ;// don't need to check 
	qname = form.elements[elems].name ;
	qid = form.elements[elems].id ; // radio array have id set for new php ones
	//check = qid.substring(0, 1); // first char x optional, m=mandatory, q=quest
	//alert(qname) ;
	//alert(type) ;
	//if (check == "x") continue ;	// don't need to check items marked x (optional)
	// how to process depends on type
	if (type == "text") 
	{ 
	if (getInputValue(form.elements[elems]) == "")
        	{
		alert("Your " + qname + " please!") ;
		form.elements[elems].focus() ; 
		return false ;
		} // end of checking text input
	}
	if (type == "radio") 
	{ // see if question id answered
	if (getInputValue(eval('form.' + qname)) == "" || getInputValue(eval('form.' + qname)) == -1)
        	{
		missed = qname.substring(1, 5); // skip first char
		alert("You missed question " + missed + ", please do it.") ;
		eval('form.' + qname + '[0]' + '.focus()')  ; // radios are array
		return false ;
		}
	}
		
} // end of for all elements
	return true ; // all ok
} 

		

