// JavaScript Document
<!---*****--->
function newrecord(txtSpecial,txtFields,txtValues) {
	window.location.href="locationui.cfm?FormAction=1&FormSpecial="+txtSpecial+"&PopUpFields="+txtFields+"&PopUpValues="+txtValues;
}
<!---*****--->
function addrecord(txtSpecial,txtFields,txtValues) {
	if (VerifyData()) {
		document.forms["location"].action="sql/locationsql.cfm?FormAction=1&FormSpecial="+txtSpecial+"&PopUpFields="+txtFields+"&PopUpValues="+txtValues;
		document.forms["location"].submit();
		}
}
<!---*****--->
function updaterecord(txtSpecial,txtFields,txtValues) {
	if (VerifyData()) {
		document.forms["location"].action="sql/locationsql.cfm?FormAction=2&FormSpecial="+txtSpecial+"&PopUpFields="+txtFields+"&PopUpValues="+txtValues;
		document.forms["location"].submit();
		}
}
<!---*****--->
function deleterecord(txtSpecial,txtFields,txtValues) {
	document.forms["location"].action="sql/locationsql.cfm?FormAction=3&FormSpecial="+txtSpecial+"&PopUpFields="+txtFields+"&PopUpValues="+txtValues;
	document.forms["location"].submit();
}
<!---*****--->
function cancellist(txtSpecial,txtFields,txtValues) {
	switch (txtSpecial) {
		case 'NONE':
			window.location.href="locationlist.cfm?FormSpecial="+txtSpecial+"&PopUpFields="+txtFields+"&PopUpValues="+txtValues;
			break;
		default:
			window.close();
	}
}
<!---*****--->
function cancelentry(txtSpecial,txtFields,txtValues) {

	switch (txtSpecial) {
		case 'NONE':
			window.location.href="locationui.cfm?FormAction=2&FormID="+document.forms["location"].PLID.value;
			break;
		case 'SUBSCRIBE':
			window.location.href="index.cfm";
			break;
		case 'PROFILE':
			window.location.href="index.cfm";
			break;
		default:
			window.close();
	}
}
<!---*****--->
function editrecord(txtSpecial,txtFields,txtValues,longID) {
	window.location.href="locationui.cfm?FormAction=2&FormID="+longID+"&FormSpecial="+txtSpecial+"&PopUpFields="+txtFields+"&PopUpValues="+txtValues;
}
<!---*****--->
function sortrecord(txtColumn) {
	switch (txtColumn) {
		case 'Name':
			document.forms["location"].ListOrder.value='PLDBA';
			break;
	}
	document.forms["location"].submit();
}
<!---*****--->
function VerifyData() {
	var dataok = true;
	var datamsg = ''
	var pldba = new String(document.forms['location'].PLDBA.value);
	var plmailstreet1 = new String(document.forms['location'].PLMAILSTREET1.value);
	var plmailcity = new String(document.forms['location'].PLMAILCITY.value);
	var plmailstate = new String(document.forms['location'].PLMAILSTATE.value);
	var plmailzip1 = new String(document.forms['location'].PLMAILZIP1.value);
	var plpfnm = new String(document.forms['location'].PLPFNM.value);
	var plplnm = new String(document.forms['location'].PLPLNM.value);
	var plphone1 = new String(document.forms['location'].PLPHONE1.value);
	var plphone2 = new String(document.forms['location'].PLPHONE2.value);
	var plphone3 = new String(document.forms['location'].PLPHONE3.value);
	var plemail1 = new String(document.forms['location'].PLEMAIL1.value);
	var pltype = new String(document.forms['location'].PLTYPE.value);

	if (pldba.length==0)
		{
		datamsg=datamsg+'-Organization Name Is Required\n';
		dataok=false;
		}
	if (plmailstreet1.length==0)
		{
		datamsg=datamsg+'-Mailing Street Address Is Required\n';
		dataok=false;
		}
	if (plmailcity.length==0)
		{
		datamsg=datamsg+'-Mailing City Is Required\n';
		dataok=false;
		}
	if (plmailstate.length!=2)
		{
		datamsg=datamsg+'-Valid Mailing State Is Required\n';
		dataok=false;
		}
	if (plmailzip1.length!=5)
		{
		datamsg=datamsg+'-Valid Mailing Zip Code Is Required\n';
		dataok=false;
		}
	if (plpfnm.length==0)
		{
		datamsg=datamsg+'-Primary Contact First Name Is Required\n';
		dataok=false;
		}
	if (plplnm.length==0)
		{
		datamsg=datamsg+'-Primary Contact Last Name Is Required\n';
		dataok=false;
		}
	if (plphone1.length!=3 || plphone2.length!=3 || plphone3.length!=4)
		{
		datamsg=datamsg+'-Valid Primary Contact Phone Number Is Required\n';
		dataok=false;
		}
	if (plemail1.length==0)
		{
		datamsg=datamsg+'-Primary Contact E-mail Address Is Required\n';
		dataok=false;
		}
	if (pltype.length==0)
		{
		datamsg=datamsg+'-Are You a Medical Provider Is Required\n';
		dataok=false;
		}
		
	if (datamsg!='')
		alert(datamsg);

	return dataok;
}
<!---*****--->
