function checkme(w,x,y,z,a,d )
	{
	// determine whether or not the a and d are valid data for the radio button. 
	if(w == "radio"){ 
	var radioIndex = parseInt(a,10);
	var radioTotal = parseInt(d,10);
	}
	// determine whether or not the a and d are valid data for the checkbox.
	if(w == "checkbox"){ 
	var intCheckBoxIndex = parseInt(a,10);
	var intCheckBoxTotal = parseInt(d,10);
	}
	// pass the variables to the script fields
	var fieldType  = w;
	var displayName = x;
	var formName = y;
	var fieldName = z;
	// create the constants to be used in concatenating the strings
	var strDocument = "document.";
	var strValue = ".value";
	var strFocus = ".focus();";
	var strChecked = ".checked";
	var strTrue = "True";
	// build the strings to place the curson back in the last field tested using the focus() method 
	var strGoToField = strDocument + formName + "." + fieldName + strFocus;
	// build the string to be tested in text or text area boxes.
	var b = strDocument + formName + "." + fieldName + strValue;
	//build the string to be tested for a radio box
	var c = strDocument + formName + "." + fieldName + "[" + radioIndex + "]" + strChecked;
	//create a switch that send the script to different legs depending on the field type.
	switch (fieldType)
	{
	case "radio":
	  var strButtonChecked = "false";
		for(var i = 0; i < radioTotal; i++)
		  {
 	 		//create the string to evaluate for a radio button when there are more than one.
			var e = strDocument + formName + "." + fieldName + "[" + i + "]" + strChecked;
			/* if the string created above evaluates to true we change the value of 
			strButtonChecked to True, and then change the value of i so we exit the loop */
			if(eval(e))
				{
			  strButtonChecked = "true";	
				i = (radioTotal + 1);
				}
		}
		//if the variable is not true we let the user know he needs to make a selection. 
		if(!eval(strButtonChecked))
			{
			//alert(strButtonChecked +"Checking strButtonChecked"); 
			// Commented this out it was for testing.
		  alert("You did not make a selection for "+displayName+".");
		  }
	break;
	case "checkbox":
	  var strBoxChecked = "false";
		for(var i = 0; i < intCheckBoxTotal; i++)
			{
			var e = strDocument + formName + "." + fieldName + "[" + i + "]" + strChecked;
 			//alert(e);
			if(eval(e))
			  {
				strBoxChecked = "true";	
				i = (intCheckBoxTotal + 1);
				}
	  }
		//if the variable is not true we let the user know he needs to make a selection. 
		if(!eval(strBoxChecked))
			{
  		alert("You did not make a selection for "+displayName+".");
		  }
	break;	
	case "text":
  // basic textbox vaildation
	if(eval(b) == "")
		{
		alert("You must enter your "+displayName);
		var g = strDocument + formName + "." + fieldName + ".style.backgroundColor ='yellow'";
		alert (g)
		//eval(strDocument + formName + "." + fieldName + strFocus);
		eval(g)
		return false;
		}
	break;	 
	default:
	alert("How did you get here?")
	break;
	}
}
function showMeTheForm()
	{
	var intNumberOfFormFields = document.form1.elements.length;
	//alert(intNumberOfFormFields);
	for(var i = 1; i < intNumberOfFormFields; i++){
	changeMeUp(i);
	}
	
}
function changeMeUp(b)
{ i = b;
	{ 
	//alert (i);
	//alert(intNumberOfFormFields);
	var id = document.form1.elements[i].name;
	var FldType = document.form1.elements[i].type;
	var FldValue = document.form1.elements[i].value;
	var FldChecked = document.form1.elements[i].checked;
	document.form1.elements[i].style.backgroundColor ='yellow';
	document.form1.elements[i].style.color ='blue';
	document.form1.elements[i].style.borderTopColor ='red';
	document.form1.elements[i].style.borderBottomColor ='red';
	document.form1.elements[i].style.textTransform ='none';
	document.form1.elements[i].style.textDecorationLineThrough ='true';
	document.form1.elements[i].style.textDecorationOverline ='true';
	document.form1.elements[i].style.textDecorationUnderline ='true';
	// actual data 
 alert("Field Number: "+i +" Field Name: "+id +" Element type: "+FldType+" Value in field: "+FldValue);
	document.form1.fnames.value = id;
	document.form1.fvalues1.value = FldType;
	document.form1.fvalues2.value = FldValue;
	document.form1.fvalues3.value = FldChecked;
	}
}

