// JavaScript Document
function valForm(formobj,formval)	{
	var msg = '';
	fval = new String(formval);
	formval = fval.replace(/^\s+|\s+$/g,"");	
	if(formval == '')	{
		msg = formobj;
	}
	return msg;
}function valNumber(formobj,formval)	{
	var msg = '';
	formval = formval.replace(/^\s+|\s+$/g,"");	
	if(formval == '' || isNaN(formval))	{
		msg = formobj;
	}
	return msg;
}function fieldParams(formname)	{
	var field_names = "";
	for(i=0; i<formname.elements.length; i++){
	  if(formname.elements[i].type == "button"){
      		field_names = field_names + ""
      }
      else if(formname.elements[i].type == "checkbox" || formname.elements[i].type == "radio"){
			if(i == 0)	{
				if(formname.elements[i].checked == true)	{	
   					field_names = formname.elements[i].name + "=Yes"
				}	else	{
					field_names = formname.elements[i].name + "=No"
				}
			}	else	{
				if(formname.elements[i].checked == true)	{
   					field_names = field_names + "&" + formname.elements[i].name + "=Yes"
				}	else	{
		   			field_names = field_names + "&" + formname.elements[i].name + "=No"					
				}
			}	  
      }
      else if(formname.elements[i].type == "SELECT-one" || formname.elements[i].type == "SELECT-multiple"){      
			if(i == 0)	{
   			field_names = formname.elements[i].name + "=" + escape(formname.elements[i].options[formname.elements[i].SELECTedIndex].value)
			}	else	{
   			field_names = field_names + "&" + formname.elements[i].name + "=" + escape(formname.elements[i].options[formname.elements[i].SELECTedIndex].value)
			}	  
      }
	  else	{
			if(i == 0)	{
   			field_names = formname.elements[i].name + "=" + escape(formname.elements[i].value)		
			}	else	{
   			field_names = field_names + "&" + formname.elements[i].name + "=" + escape(formname.elements[i].value)
			}		  
	  }
   }
   return field_names;
}function resetFields(formname)	{	
for(i=0; i<formname.elements.length; i++){
	  if(formname.elements[i].type == "checkbox"){
			formname.elements[i].checked  = false;
      }    else if(formname.elements[i].type == "SELECT-one" || formname.elements[i].type == "SELECT-multiple"){
	      	formname.elements[i].SELECTedIndex = 0;
      }	  else if(formname.elements[i].type == "text" || formname.elements[i].type == "textarea")	{
			formname.elements[i].value = '';
	  }		else	{}
   }
   formname.elements[0].focus();
}
