function payFormCheck(formobj){
	// Enter name of mandatory fields 
	var fieldRequired = Array("purchasedFrom", "description", "itemID", "price", "shipping");
	// Enter field description to appear in the dialog box
	var fieldDescription = Array("Purchased from", "Brief description of item","Item #", "Winning bid or price of item",  "Shipping cost");
	// dialog message
	var alertMsg = "Please provide the following:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
					obj.className= "form_error";
				}
				else {
				obj.className= "";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
					obj.className= "form_error";
				}
				else {
				obj.className= "";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
					obj.className= "form_error";
				}
				else {
				obj.className= "";
				}
				break;
			default:
			}
			if (obj.type == undefined){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
					obj.className= "form_error";
				}
				else {
				obj.className= "";
				}
			}
		}
	}

	if (alertMsg.length == l_Msg){	
		return true;
	}else{
		alert(alertMsg);
		return false;		
	}
}
function changeItemID(){
		var theSelection = document.getElementById("purchasedFrom").value;
		if (theSelection == "Amazon Auctions"){
			var whatToDisplay = "Auction ID"; 
		} else if (theSelection == "Yahoo Auctions") {
			var whatToDisplay = "ID #"; 
		} else if (theSelection == "Overstock Auctions") {
			var whatToDisplay = "Item ID"; 
		} else if (theSelection == "eBay") {
			var whatToDisplay = "Item Number"; 
		}
	itemIDDescription.innerHTML = whatToDisplay;
}
	
function fixMoney(fld,sep)
	{ // monetary field check
	  if(!fld.value.length||fld.disabled) return true; // blank fields are the domain of requireValue 
	  var val= fld.value;
	  if(typeof(sep)!='undefined') val= val.replace(new RegExp(sep,'g'),'');
	  if(val.indexOf('$') == 0)
		val= parseFloat(val.substring(1,40));
	  else
		val= parseFloat(val);
	  if(isNaN(val))
	  { // parse error 
		alert('This field must contain a dollar amount.');
		fld.value = "";
		fld.focus();
		return false;
	  } else if (val <0) {
		 alert('This amount most be a positive number.');
		fld.value = "";
		fld.focus();
		return false; 
	  }
	  var sign= ( val < 0 ? '-': '' );
	  val= Number(Math.round(Math.abs(val)*100)).toString();
	  while(val.length < 2) val= '0'+val;
	  var len= val.length;
	  val= sign + ( len == 2 ? '0' : val.substring(0,len-2) ) + '.' + val.substring(len-2,len+1);
	  fld.value= val;
	  return true;
	}
