function persInfo(data)
{
  newWindow = window.open('/cgi-bin/Addons/mparty.cgi?' + data, 'InfoWin', 'width=250,height=125')
  newWindow.focus()
}

function showImage(check,ext)
{
  imageWindow = window.open('/cgi-bin/imageret.cgi?check=' + check + '&imgext=' + ext, 'imgWin', 'toolbar=no,location=no,scrollbars=yes,resizable=yes,width=800,height=600')
}

function hearList(pre,num,sub)
{
  hearWindow = window.open('/cgi-bin/Addons/mhearlst.cgi?pre=' + pre + '&num=' + num + '&sub=' + sub, 'hearWin', 'toolbar=no,location=no,scrollbars=yes,resizable=yes,width=500,height=300')
}

function submitForm(formID)
{
	/* This function validates a form before submitting it.  If any required fields are blank, an error
	   is displayed, the missing fields are highlighted in yellow, and the form is not submitted.
		 To use:
		   - The form must have a uniqued ID
			 - The form must have a hidden field with the id 'reqfields' the value of which is
			   a list of the id's of the form's required fields seperated by semicolons (;)
				 ex. <input type="hidden" name="reqfields" value="fname;lname;address;city">
			 - The form's submit button must be replaced by a button that call this function:
			   ex. <input type="button" ... onClick="javascrit:submitForm('UNIQUE_FORM_ID');">
	*/
	var reqString = document.getElementById('reqfields').value;
	var reqFields = reqString.split(";");
	var errCount = 0;
	var fString;
	
	for (var i=0; i<reqFields.length; i++)
	{
		var thisField = document.getElementById(reqFields[i]);
		
		thisField.style.backgroundColor = "#FFFFFF";
		
		if (thisField.value == "")
		{			
		  thisField.style.backgroundColor = "#FFFF00";
			
			errCount++;
		}
	}
	
	if (errCount > 0)
	{
		if (errCount == 1)
		{
			fString = "field is";
		}
		else
		{
			fString = "fields are";
		}
		
		alert("Sorry: The highlighted " + fString + " required to continue.");
	}
	else	
	{
	  document.getElementById(formID).submit();
	}
}
