FFbg = '#FFFFFF'
FFbc = '#1E3C78'
oldval = "";

function FieldHi(obj){
	blurred=false;
    if (obj.style.backgroundColor == "")
	{
	   oldval = obj.value;
	   Presets = new Array("email_address")
	   if (obj.value == "email add'" ){
	   		obj.value=''
	   	}
	   obj.style.backgroundColor = FFbg;
	   obj.style.borderColor = FFbc;
	}
    else {
    	if (obj.value == ""){obj.value = oldval}
    	obj.style.backgroundColor = "";
		obj.style.borderColor = "";
	}
}

function FieldHisearch(obj){
	blurred=false;
    if (obj.style.backgroundColor == "")
	{
	   oldval = obj.value;
	   Presets = new Array("search")
	   if (obj.value == "search" ){
	   		obj.value=''
	   	}
	   obj.style.backgroundColor = FFbg;
	   obj.style.borderColor = FFbc;
	}
    else {
    	if (obj.value == ""){obj.value = oldval}
    	obj.style.backgroundColor = "";
		obj.style.borderColor = "";
	}
}

function refresh()
{
	window.location.reload( false );
}

function checkRadios() {
	var level=24; // set to cutoff point in quiz
	var highURL="psycho_high.html"; //set to top score url
	var lowURL="psycho_low.html"; //set to low score url
	var ttl=0;
		ttl=ttl*1;
	var el = document.forms[0].elements;
	for(var i = 0 ; i < el.length ; ++i) {
		if(el[i].type == "radio") {
			var radiogroup = el[el[i].name]; // get the whole set of radio buttons.
   			var itemchecked = false;
   			for(var j = 0 ; j < radiogroup.length ; ++j) {
    			if(radiogroup[j].checked) {
					ttl=(j/radiogroup.length)+ttl
					document.forms[0].elements.result.value=ttl
			 		itemchecked = true;
		 			break;
					}
   				}
  			}
 		}
	ttl=parseInt(ttl+0.001);
	if (ttl < level) {
 		window.location.href = lowURL+"?="+ttl
  		} else {
  		window.location.href = highURL+"?="+ttl
  		}
 		return true;
	} 