function resetQ12CheckBox(box)
{
	box.checked=false;
}

function resetQ12Unfamiliar(radio, box)
{
	
	if(radio[1].checked)
		box.checked=false;
}


function resetSpecify(){
	document.getElementById("q24_2").value="";

}

function resetKids(){
	document.getElementById("q7").value=0;
	activate_message('q7', '3', 'message');
}


function changeDropDown(dropdown){
	if(dropdown.name=="q3_1"){
		document.getElementById("q3_2").selectedIndex=0;
	}
		
	if(dropdown.name=="q3_2"){
		document.getElementById("q3_1").selectedIndex=0;
	}
		
}


function process_value(field, type) 
{
	if(document.getElementById("q6_2").checked==false){
		var fieldvalue = document.getElementById(field).value;
		
		// Check if the value is 0. If it is, leave it at 0.
		if (fieldvalue < 0) {
		
		fieldvalue = 0;
		
		} else {
		
		
		if (type == 'up') {
		
		fieldvalue++;
		
		} else if (type == 'down') {
		
			if (fieldvalue == 0) {
			
			} else {
			
			fieldvalue--;
			
			}
		
		}
	
		} // End 0 IF Statement
		
		document.getElementById(field).value = fieldvalue;
	}
	/*
	//Check if number of children > 3
	if (fieldvalue > 3) {
		toggleLayer('commentForm')
	} else {
	
	}
	*/

}

/***********************************/
/************************************
 FUNCTION TO CHECK IF A VALUE IS
 LESS THAN 0. IF IT IS, RESET TO 0.
************************************/

function activate_message(dependantfield, requiredvalue, itemtodisplay) {

	// Get the value of the field we're watching.
	var dependantfieldvalue = document.getElementById(dependantfield).value;
	
	// If the value is equal to the required value, perform our action.
	if (dependantfieldvalue >= requiredvalue) {
	
	var itemname = document.getElementById(itemtodisplay);
	
	itemname.style.display = "block";
	
	} else {
	
	var itemname = document.getElementById(itemtodisplay);
	
	itemname.style.display = "none";
	
	}

}

function toggleLayer( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}
