function isText(f){
	//return f.type == 'radio' || f.type == 'checkbox' || f.type == 'file'
	return f.type != 'checkbox' || f.type != 'file'
}

function validateRadioGroup(btn) {
    var cnt = -1;
    for (var i=btn.length-1; i > -1; i--) {
        if (btn[i].checked) {cnt = i; i = -1;}
    }
    if (cnt > -1) return btn[cnt].value;
    else return null;
}

function filledRadioGroup(f){
	return f.type=='radio' && validateRadioGroup(f) != null
}


function emptyRadio(btn){
	return validateRadioGroup(btn)
}

	
function Validator(theForm){
a = new Array()
a = Validator.arguments;

if(theForm.url!="undefined" && theForm.url.value!=""){
	alert("ERROR!");
	return false;
}

for(i=1; i<a.length; i++){
	f = theForm[a[i]]

	if (f != "undefined" && f != null){
if(f.type=='checkbox' && f.checked!=true){
	alert("Please fill all required fields. ("+f.name+")")
	f.focus();
	return false;
}
if (f.length>0 && f[0].type=='radio'){
	alerttxt = "Please fill all required fields. ("+f[0].name+")"
	with (f){
	 if (validateRadioGroup(f) == null){
	  alert(alerttxt);
	  f[0].focus();
	  return false;
	 }
	}
}

if (f.length>0 && f[0].type=='checkbox'){
	alerttxt = "Please fill all required fields. ("+f[0].name+")"
	with (f){
	 if (validateRadioGroup(f) == null){
	  alert(alerttxt);
	  f[0].focus();
	  return false;
	 }
	}
}
		field_name = f.name
		
		if (f.value == ""){
			f.className += " missing_field"
			alert("Please fill all required fields. ("+field_name+")");
			f.focus();
			return (false);
		}}
}
//if (jcap() == false) {
	//return (false);
//}
 return (true);
}

function cln(f){
	f.className = ''
}