// proxy_set is used for the purpose of display error messages in a better position 
function proxy_set(from, to) {
	var innerHTML = document.getElementById(from).innerHTML;
	document.getElementById(to).innerHTML = innerHTML;
	document.getElementById(from).innerHTML = '';
}

// proxy_clear is used for clearing the error message created by the benefactor 
function proxy_clear(to) {
	document.getElementById(to).innerHTML = '';
}

function PDF16_print_name() {
	var name = document.getElementById('input_PDF16_NAME').value;
	document.getElementById('input_PDF16_PRINT_NAME').value = name;
}	

var forms;
var form;
var elem;
function validate_PDF16() {
	//confirm('validate_PDF16')
	forms = document.forms;
	for (var i = 0; i < forms.length; i++) { 
		form = document.getElementById(forms[i].id)
		form.length
		for(var e = 0; e < form.length; e++) {
			elem = form.elements[e];
			if(elem.type == 'text') {
				//confirm(elem.value);	
				if(elem.value == '') {
					// FF hack: title='optional' prevents hidden fields from getting focus 
					if(elem.title != 'optional') {
						elem.focus();	// go to element 
						return false;
					}
				}
			}
			var en;
			var enc;
			var fe;
			if(elem.type == 'radio') {
				// ARGH!  This won't catch the last set
				//confirm(elem.name+'; '+elem.checked);
				if(!en) {
					//confirm('en empty first time');
					fe = elem;
					en = elem.name;
					enc = elem.checked;
				}
				if(en == elem.name) {
					//confirm('en == elem.name');
					enc = (enc || elem.checked);
				} else {
					//confirm('en != elem.name');
					if(!enc) {
						fe.focus(); 
						return false;	// nothing selected
					}
				}
			}
			if(elem.type == 'select-one') {
				//confirm(elem.id);	
				//confirm(elem.selectedIndex);	
				if(elem.selectedIndex == 0) {
					elem.focus();	// go to element 
					return false;
				}
			}
		}
	}
}

// PDF16_NAME
var input_PDF16_NAME;
input_PDF16_NAME = function() {
	tabbing = false;
} 
var input_PDF16_NAME_error; 
input_PDF16_NAME_error = function() {
	document.getElementById('input_PDF16_NAME').focus();
}

// PDF16_STREET
var input_PDF16_STREET;
input_PDF16_STREET = function() {
	tabbing = false;
} 
var input_PDF16_STREET_error; 
input_PDF16_STREET_error = function() {
	document.getElementById('input_PDF16_STREET').focus();
}

// PDF16_CITY
var input_PDF16_CITY;
input_PDF16_CITY = function() {
	proxy_clear('input_PDF16_STREET_error');
	tabbing = false;
} 
var input_PDF16_CITY_error; 
input_PDF16_CITY_error = function() {
	proxy_set('input_PDF16_CITY_error','input_PDF16_STREET_error');
	document.getElementById('input_PDF16_CITY').focus();
}

// PDF16_STATE
var select_PDF16_STATE;
select_PDF16_STATE = function() {
	proxy_clear('input_PDF16_STREET_error');
	tabbing = false;
	if(document.getElementById('select_PDF16_STATE').selectedIndex == 33) {
		document.getElementById('input_PDF16_NY_BROKER_NAME').title = '';	
		document.getElementById('input_PDF16_NY_BROKER_STREET').title = '';	
		document.getElementById('input_PDF16_NY_BROKER_CITY').title = '';	
		document.getElementById('input_PDF16_NY_BROKER_STATE').title = '';	
		document.getElementById('input_PDF16_NY_BROKER_ZIP').title = '';	
	} else {
		document.getElementById('input_PDF16_NY_BROKER_NAME').title = 'optional';	
		document.getElementById('input_PDF16_NY_BROKER_STREET').title = 'optional';	
		document.getElementById('input_PDF16_NY_BROKER_CITY').title = 'optional';	
		document.getElementById('input_PDF16_NY_BROKER_STATE').title = 'optional';	
		document.getElementById('input_PDF16_NY_BROKER_ZIP').title = 'optional';	
		document.getElementById('input_PDF16_NY_BROKER_NAME_error').innerHTML = '';	
		document.getElementById('input_PDF16_NY_BROKER_STREET_error').innerHTML = '';	
		document.getElementById('input_PDF16_NY_BROKER_CITY_error').innerHTML = '';
		document.getElementById('input_PDF16_NY_BROKER_STATE_error').innerHTML = '';	
		document.getElementById('input_PDF16_NY_BROKER_ZIP_error').innerHTML = '';
	}
} 

var select_PDF16_STATE_error; 
select_PDF16_STATE_error = function() {
	proxy_set('select_PDF16_STATE_error','input_PDF16_STREET_error');
	document.getElementById('select_PDF16_STATE').focus();
}

// PDF16_NY_BROKER_NAME
var input_PDF16_NY_BROKER_NAME;
input_PDF16_NY_BROKER_NAME = function() {
	tabbing = false;
} 
var input_PDF16_NY_BROKER_NAME_error; 
input_PDF16_NY_BROKER_NAME_error = function() {
	document.getElementById('input_PDF16_NY_BROKER_NAME').focus();
}

// PDF16_NY_BROKER_STREET
var input_PDF16_NY_BROKER_STREET;
input_PDF16_NY_BROKER_STREET = function() {
	tabbing = false;
} 
var input_PDF16_NY_BROKER_STREET_error; 
input_PDF16_NY_BROKER_STREET_error = function() {
	document.getElementById('input_PDF16_NY_BROKER_STREET').focus();
}

// PDF16_NY_BROKER_CITY
var input_PDF16_NY_BROKER_CITY;
input_PDF16_NY_BROKER_CITY = function() {
	tabbing = false;
} 
var input_PDF16_NY_BROKER_CITY_error; 
input_PDF16_NY_BROKER_CITY_error = function() {
	document.getElementById('input_PDF16_NY_BROKER_CITY').focus();
}

// PDF16_NY_BROKER_ZIP
var input_PDF16_NY_BROKER_ZIP;
input_PDF16_NY_BROKER_ZIP = function() {
	tabbing = false;
} 
var input_PDF16_NY_BROKER_ZIP_error; 
input_PDF16_NY_BROKER_ZIP_error = function() {
	document.getElementById('input_PDF16_NY_BROKER_ZIP').focus();
}

// PDF16_ZIP
var input_PDF16_ZIP;
input_PDF16_ZIP = function() {
	proxy_clear('input_PDF16_STREET_error');
	tabbing = false;
} 
var input_PDF16_ZIP_error; 
input_PDF16_ZIP_error = function() {
	proxy_set('input_PDF16_ZIP_error','input_PDF16_STREET_error');
	document.getElementById('input_PDF16_ZIP').focus();
}

// PDF16_POSITION
var input_PDF16_POSITION;
input_PDF16_POSITION = function() {
	tabbing = false;
} 
var input_PDF16_POSITION_error; 
input_PDF16_POSITION_error = function() {
	document.getElementById('input_PDF16_POSITION').focus();
}

// PDF16_POSITION
var input_PDF16_POSITION;
input_PDF16_POSITION = function() {
	tabbing = false;
} 
var input_PDF16_POSITION_error; 
input_PDF16_POSITION_error = function() {
	document.getElementById('input_PDF16_POSITION').focus();
}


// PDF16_ADDITIONAL_INSURED_NAME
var input_PDF16_ADDITIONAL_INSURED_NAME;
input_PDF16_ADDITIONAL_INSURED_NAME = function() {
	tabbing = false;
} 
var input_PDF16_ADDITIONAL_INSURED_NAME_error; 
input_PDF16_ADDITIONAL_INSURED_NAME_error = function() {
	document.getElementById('input_PDF16_ADDITIONAL_INSURED_NAME').focus();
}

// PDF16_ADDITIONAL_INSURED_STREET
var input_PDF16_ADDITIONAL_INSURED_STREET;
input_PDF16_ADDITIONAL_INSURED_STREET = function() {
	tabbing = false;
} 
var input_PDF16_ADDITIONAL_INSURED_STREET_error; 
input_PDF16_STREET_error = function() {
	document.getElementById('input_PDF16_ADDITIONAL_INSURED_STREET').focus();
}

// PDF16_ADDITIONAL_INSURED_CITY
var input_PDF16_ADDITIONAL_INSURED_CITY;
input_PDF16_ADDITIONAL_INSURED_CITY = function() {
	proxy_clear('input_PDF16_ADDITIONAL_INSURED_STREET_error');
	tabbing = false;
} 
var input_PDF16_ADDITIONAL_INSURED_CITY_error; 
input_PDF16_ADDITIONAL_INSURED_CITY_error = function() {
	proxy_set('input_PDF16_ADDITIONAL_INSURED_CITY_error','input_PDF16_ADDITIONAL_INSURED_STREET_error');
	document.getElementById('input_PDF16_ADDITIONAL_INSURED_CITY').focus();
}

// PDF16_ADDITIONAL_INSURED_STATE
var select_PDF16_ADDITIONAL_INSURED_STATE;
select_PDF16_ADDITIONAL_INSURED_STATE = function() {
	proxy_clear('input_PDF16_ADDITIONAL_INSURED_STREET_error');
	tabbing = false;
} 
var select_PDF16_ADDITIONAL_INSURED_STATE_error; 
select_PDF16_ADDITIONAL_INSURED_STATE_error = function() {
	proxy_set('select_PDF16_ADDITIONAL_INSURED_STATE_error','input_PDF16_ADDITIONAL_INSURED_STREET_error');
	document.getElementById('select_PDF16_ADDITIONAL_INSURED_STATE').focus();
}

// PDF16_ADDITIONAL_INSURED_ZIP
var input_PDF16_ADDITIONAL_INSURED_ZIP;
input_PDF16_ADDITIONAL_INSURED_ZIP = function() {
	proxy_clear('input_PDF16_ADDITIONAL_INSURED_STREET_error');
	tabbing = false;
} 
var input_PDF16_ADDITIONAL_INSURED_ZIP_error; 
input_PDF16_ADDITIONAL_INSURED_ZIP_error = function() {
	proxy_set('input_PDF16_ADDITIONAL_INSURED_ZIP_error','input_PDF16_ADDITIONAL_INSURED_STREET_error');
	document.getElementById('input_PDF16_ADDITIONAL_INSURED_ZIP').focus();
}

// PDF16_EVENT_NAME
var input_PDF16_EVENT_NAME;
input_PDF16_EVENT_NAME = function() {
	tabbing = false;
} 
var input_PDF16_EVENT_NAME_error; 
input_PDF16_EVENT_NAME_error = function() {
	document.getElementById('input_PDF16_EVENT_NAME').focus();
}

// PDF16_EVENT_STREET
var input_PDF16_EVENT_STREET;
input_PDF16_EVENT_STREET = function() {
	tabbing = false;
} 
var input_PDF16_EVENT_STREET_error; 
input_PDF16_STREET_error = function() {
	document.getElementById('input_PDF16_EVENT_STREET').focus();
}

// PDF16_EVENT_CITY
var input_PDF16_EVENT_CITY;
input_PDF16_EVENT_CITY = function() {
	proxy_clear('input_PDF16_EVENT_STREET_error');
	tabbing = false;
} 
var input_PDF16_EVENT_CITY_error; 
input_PDF16_EVENT_CITY_error = function() {
	proxy_set('input_PDF16_EVENT_CITY_error','input_PDF16_EVENT_STREET_error');
	document.getElementById('input_PDF16_EVENT_CITY').focus();
}

// PDF16_EVENT_STATE
var select_PDF16_EVENT_STATE;
select_PDF16_EVENT_STATE = function() {
	proxy_clear('input_PDF16_EVENT_STREET_error');
	tabbing = false;
} 
var select_PDF16_EVENT_STATE_error; 
select_PDF16_EVENT_STATE_error = function() {
	proxy_set('select_PDF16_EVENT_STATE_error','input_PDF16_EVENT_STREET_error');
	document.getElementById('select_PDF16_EVENT_STATE').focus();
}

// PDF16_EVENT_ZIP
var input_PDF16_EVENT_ZIP;
input_PDF16_EVENT_ZIP = function() {
	proxy_clear('input_PDF16_EVENT_STREET_error');
	tabbing = false;
} 
var input_PDF16_EVENT_ZIP_error; 
input_PDF16_EVENT_ZIP_error = function() {
	proxy_set('input_PDF16_EVENT_ZIP_error','input_PDF16_EVENT_STREET_error');
	document.getElementById('input_PDF16_EVENT_ZIP').focus();
}

var month; 
var day;
var year;
var days;
var tabindex;

var input_PDF16_EVENT_DAYS;
input_PDF16_EVENT_DAYS = function() {
	// calculate calendar date from to
	//month = parseInt(document.getElementById('select_PDF16_DATE_FROM_MONTH').value);
	month = document.getElementById('select_PDF16_DATE_FROM_MONTH').value;
	day = document.getElementById('select_PDF16_DATE_FROM_DAY').value;
	//year = parseInt(document.getElementById('select_PDF16_DATE_FROM_YEAR').value);
	year = document.getElementById('select_PDF16_DATE_FROM_YEAR').value;
	days = document.getElementById('input_PDF16_EVENT_DAYS').value;
	setSessionVar('month',month);
	setSessionVar('day',day);
	setSessionVar('year',year);
	setSessionVar('days',days);
	//confirm(month+':'+day+':'+year+'plus'+days);
	if((month != 0) && (day != 0) && (year != 'default')) {
		var to_date = PDF16_get_to_date('get_to_date','days','tag');
		proxy_clear('label_PDF16_DATE_FROM_TO_error');
	}
	tabbing = false;
}	

function PDF16_get_to_date(id, name, tag) {
	//mywindow = window.open("","_blank", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=800");
	var xmlHttp = newXmlHttp();
	var post_pairs = 'sid='+Math.random()+
		'&id='+id+
		'&name='+name+
		'&tag='+tag
	xmlHttp.onreadystatechange = function() {
		if(xmlHttp.readyState == 4) {
			if(mywindow) mywindow.document.write(xmlHttp.responseText);
			var to_date = xmlHttp.responseText.split(",");
			//confirm(to_date);
			document.getElementById('select_PDF16_DATE_TO_MONTH').value = to_date[0];
			document.getElementById('select_PDF16_DATE_TO_DAY').value = to_date[1];
			document.getElementById('select_PDF16_DATE_TO_YEAR').value = to_date[2];
			// insures values are available since disabled lists are not returned by Submit
			month = document.getElementById('select_PDF16_DATE_TO_MONTH').value;
			day = document.getElementById('select_PDF16_DATE_TO_DAY').value;
			year = document.getElementById('select_PDF16_DATE_TO_YEAR').value;
			setSessionVar('PDF16_DATE_TO_MONTH',month);
			setSessionVar('PDF16_DATE_TO_DAY',day);
			setSessionVar('PDF16_DATE_TO_YEAR',year);
		}
	}
	//confirm(post_pairs);	
	xmlHttp.open("POST", "Ajax/text.php", true); 
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");	
	xmlHttp.send(post_pairs);  	
}

var input_PDF16_EVENT_DAYS_error
input_PDF16_EVENT_DAYS_error = function() {
	proxy_set('input_PDF16_EVENT_DAYS_error','label_PDF16_DATE_FROM_TO_error');
	document.getElementById('input_PDF16_EVENT_DAYS').focus();
}	

var select_PDF16_DATE_FROM_MONTH
select_PDF16_DATE_FROM_MONTH = function() {
	// make sure year has been set first
	if(document.getElementById('select_PDF16_DATE_FROM_YEAR').value == 'default') {
		document.getElementById('select_PDF16_DATE_FROM_YEAR').focus();
		document.getElementById('select_PDF16_DATE_FROM_YEAR_error').innerHTML = "Please, select a year prior to selecting a month.";
		tabbing = false;
	}
	id = 'select_PDF16_DATE_FROM_MONTH';
	name = 'PDF16_DATE_FROM_MONTH';
	tag = 'select';
	//month = document.getElementById('select_PDF16_DATE_FROM_MONTH').selectedIndex;
	month = document.getElementById('select_PDF16_DATE_FROM_MONTH').value;
	setSessionVar('month',month);
	tabindex = document.getElementById('select_PDF16_DATE_FROM_DAY').tabIndex;
	setSessionVar('tabindex',tabindex);
	//year = document.getElementById('select_PDF16_DATE_FROM_YEAR').selectedIndex;
	year = document.getElementById('select_PDF16_DATE_FROM_YEAR').value;
	setSessionVar('year',year);
	setSessionVar('table_id','PDF16');
	//mywindow = window.open("","_blank", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=800");
	var xmlHttp = newXmlHttp();
	var post_pairs = 'sid='+Math.random()+
		'&id='+id+
		'&name='+name+
		'&tag='+tag
	xmlHttp.onreadystatechange = function() {
		if(xmlHttp.readyState == 4) {
			if(mywindow) mywindow.document.write(xmlHttp.responseText);
			if(xmlHttp.responseText.indexOf("ERROR:") == 0)	{
				document.getElementById(id+'_error').innerHTML = xmlHttp.responseText.replace(/ERROR:/, "");
				eval(id+'_error()');
			} else {
				proxy_clear('label_PDF16_DATE_FROM_TO_error');
				document.getElementById('span_PDF16_DATE_FROM_DAY').innerHTML = xmlHttp.responseText;	
				document.getElementById(id+'_error').innerHTML = '';	
			}
		}
	}
	//confirm(post_pairs);	
	xmlHttp.open("POST", "Ajax/select_one.php", true); 
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");	
	xmlHttp.send(post_pairs);  	
	tabbing = false;
}
var select_PDF16_DATE_FROM_MONTH_error
select_PDF16_DATE_FROM_MONTH_error = function() {
	proxy_set('select_PDF16_DATE_FROM_MONTH_error','label_PDF16_DATE_FROM_TO_error');
	document.getElementById('select_PDF16_DATE_FROM_MONTH').focus();
}

// PDF16_DATE_FROM_DAY
var select_PDF16_DATE_FROM_DAY
select_PDF16_DATE_FROM_DAY = function() {
	// make sure month has been set first
	if(document.getElementById('select_PDF16_DATE_FROM_MONTH').value == 'default') {
		document.getElementById('select_PDF16_DATE_FROM_MONTH').focus();
		document.getElementById('select_PDF16_DATE_FROM_MONTH_error').innerHTML = "Please, select a month prior to selecting a day.";
	}
	proxy_clear('label_PDF16_DATE_FROM_TO_error');
	tabbing = false;
}
var select_PDF16_DATE_FROM_DAY_error
select_PDF16_DATE_FROM_DAY_error = function() {
	proxy_set('select_PDF16_DATE_FROM_DAY_error','label_PDF16_DATE_FROM_TO_error');
	document.getElementById('select_PDF16_DATE_FROM_DAY').focus();
}

var select_PDF16_DATE_FROM_YEAR
select_PDF16_DATE_FROM_YEAR = function() {
	//year = document.getElementById('select_PDF16_DATE_FROM_YEAR').selectedIndex;
	year = document.getElementById('select_PDF16_DATE_FROM_YEAR').value;
	setSessionVar('year',year);
	next_name = 'PDF16_DATE_FROM_MONTH';
	setSessionVar('next_name',next_name);
	document.getElementById('select_PDF16_DATE_FROM_YEAR_error').innerHTML = '';

	tabindex = document.getElementById('select_PDF16_DATE_FROM_MONTH').tabIndex;
	setSessionVar('tabindex',tabindex);
	setSessionVar('table_id','PDF16');
	var id = 'select_PDF16_DATE_FROM_YEAR';
	var name = 'PDF16_DATE_FROM_YEAR';
	var tag = 'select';
	
	var xmlHttp = newXmlHttp();
	var post_pairs = 'sid='+Math.random()+
		'&id='+id+
		'&name='+name+
		'&tag='+tag
	xmlHttp.onreadystatechange = function() {
		if(xmlHttp.readyState == 4) {
			if(mywindow) mywindow.document.write(xmlHttp.responseText);
			if(xmlHttp.responseText.indexOf("ERROR:") == 0)	{
				document.getElementById(id+'_error').innerHTML = xmlHttp.responseText.replace(/ERROR:/, "");
				eval(id+'_error()');
			} else {
				proxy_clear('label_PDF16_DATE_FROM_TO_error');
				document.getElementById('span_PDF16_DATE_FROM_MONTH').innerHTML = xmlHttp.responseText;	
				document.getElementById(id+'_error').innerHTML = '';	
			}
		}
	}
	//confirm(post_pairs);	
	xmlHttp.open("POST", "Ajax/select_one.php", true); 
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");	
	xmlHttp.send(post_pairs);  	
	tabbing = false;

}

var select_PDF16_DATE_FROM_YEAR_error
select_PDF16_DATE_FROM_YEAR_error = function() {
	// HARDWIRED 
	// ATIonblur looks up the hierarchy for the closest div value.  In this case the closest div
	// has a top value of 0
	document.getElementById('select_one_error').style.top = 625;
	proxy_set('select_PDF16_DATE_FROM_YEAR_error','label_PDF16_DATE_FROM_TO_error');
	document.getElementById('select_PDF16_DATE_FROM_YEAR').focus();
}

var select_PDF16_DATE_TO_MONTH
select_PDF16_DATE_TO_MONTH = function() {
	tabbing = false;
}
var select_PDF16_DATE_TO_MONTH_error
select_PDF16_DATE_TO_MONTH_error = function() {
	//document.getElementById('select_PDF16_DATE_FROM_MONTH').focus();
}

var select_PDF16_DATE_TO_DAY
select_PDF16_DATE_TO_DAY = function() {
	tabbing = false;
}
var select_PDF16_DATE_TO_DAY_error
select_PDF16_DATE_TO_DAY_error = function() {
	//document.getElementById('select_PDF16_DATE_TO_DAY_error').focus();
}

var select_PDF16_DATE_TO_YEAR
select_PDF16_DATE_TO_YEAR = function() {
	tabbing = false;
}

var select_PDF16_DATE_TO_YEAR_error
select_PDF16_DATE_TO_YEAR_error = function() {
	//document.getElementById('select_PDF16_DATE_TO_MONTH').focus();
}

// 

//
var input_PDF16_DESIRED_EVENT_DAYS;
input_PDF16_DESIRED_EVENT_DAYS = function() {
	// calculate calendar date from to
	//month = parseInt(document.getElementById('select_PDF16_DATE_FROM_MONTH').value);
	month = document.getElementById('select_PDF16_DESIRED_DATE_FROM_MONTH').value;
	day = document.getElementById('select_PDF16_DESIRED_DATE_FROM_DAY').value;
	//year = parseInt(document.getElementById('select_PDF16_DATE_FROM_YEAR').value);
	year = document.getElementById('select_PDF16_DESIRED_DATE_FROM_YEAR').value;
	days = document.getElementById('input_PDF16_DESIRED_EVENT_DAYS').value;
	setSessionVar('month',month);
	setSessionVar('day',day);
	setSessionVar('year',year);
	setSessionVar('days',days);
	//confirm(month+':'+day+':'+year+'plus'+days);
	if((month != 0) && (day != 0) && (year != 'default')) {
		var to_date = PDF16_DESIRED_get_to_date('get_to_date','days','tag');
		proxy_clear('label_PDF16_DESIRED_DATE_FROM_TO_error');
	}
	tabbing = false;
}	

function PDF16_DESIRED_get_to_date(id, name, tag) {
	//mywindow = window.open("","_blank", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=800");
	var xmlHttp = newXmlHttp();
	var post_pairs = 'sid='+Math.random()+
		'&id='+id+
		'&name='+name+
		'&tag='+tag
	xmlHttp.onreadystatechange = function() {
		if(xmlHttp.readyState == 4) {
			if(mywindow) mywindow.document.write(xmlHttp.responseText);
			var to_date = xmlHttp.responseText.split(",");
			//confirm(to_date);
			document.getElementById('select_PDF16_DESIRED_DATE_TO_MONTH').value = to_date[0];
			document.getElementById('select_PDF16_DESIRED_DATE_TO_DAY').value = to_date[1];
			document.getElementById('select_PDF16_DESIRED_DATE_TO_YEAR').value = to_date[2];
			// insures values are available since disabled lists are not returned by Submit
			month = document.getElementById('select_PDF16_DESIRED_DATE_TO_MONTH').value;
			day = document.getElementById('select_PDF16_DESIRED_DATE_TO_DAY').value;
			year = document.getElementById('select_PDF16_DESIRED_DATE_TO_YEAR').value;
			setSessionVar('PDF16_DESIRED_DATE_TO_MONTH',month);
			setSessionVar('PDF16_DESIRED_DATE_TO_DAY',day);
			setSessionVar('PDF16_DESIRED_DATE_TO_YEAR',year);
		}
	}
	//confirm(post_pairs);	
	xmlHttp.open("POST", "Ajax/text.php", true); 
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");	
	xmlHttp.send(post_pairs);  	
}

var input_PDF16_DESIRED_EVENT_DAYS_error
input_PDF16_DESIRED_EVENT_DAYS_error = function() {
	proxy_set('input_PDF16_DESIRED_EVENT_DAYS_error','label_PDF16_DESIRED_DATE_FROM_TO_error');
	document.getElementById('input_PDF16_DESIRED_EVENT_DAYS').focus();
}	

var select_PDF16_DESIRED_DATE_FROM_MONTH
select_PDF16_DESIRED_DATE_FROM_MONTH = function() {
	// make sure year has been set first
	if(document.getElementById('select_PDF16_DESIRED_DATE_FROM_YEAR').value == 'default') {
		document.getElementById('select_PDF16_DESIRED_DATE_FROM_YEAR').focus();
		document.getElementById('select_PDF16_DESIRED_DATE_FROM_YEAR_error').innerHTML = "Please, select a year prior to selecting a month.";
		tabbing = false;
	}
	id = 'select_PDF16_DESIRED_DATE_FROM_MONTH';
	name = 'PDF16_DESIRED_DATE_FROM_MONTH';
	tag = 'select';
	//month = document.getElementById('select_PDF16_DESIRED_DATE_FROM_MONTH').selectedIndex;
	month = document.getElementById('select_PDF16_DESIRED_DATE_FROM_MONTH').value;
	setSessionVar('month',month);
	tabindex = document.getElementById('select_PDF16_DESIRED_DATE_FROM_DAY').tabIndex;
	setSessionVar('tabindex',tabindex);
	//year = document.getElementById('select_PDF16_DESIRED_DATE_FROM_YEAR').selectedIndex;
	year = document.getElementById('select_PDF16_DESIRED_DATE_FROM_YEAR').value;
	setSessionVar('year',year);
	setSessionVar('table_id','PDF16');
	//mywindow = window.open("","_blank", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=800");
	var xmlHttp = newXmlHttp();
	var post_pairs = 'sid='+Math.random()+
		'&id='+id+
		'&name='+name+
		'&tag='+tag
	xmlHttp.onreadystatechange = function() {
		if(xmlHttp.readyState == 4) {
			if(mywindow) mywindow.document.write(xmlHttp.responseText);
			if(xmlHttp.responseText.indexOf("ERROR:") == 0)	{
				document.getElementById(id+'_error').innerHTML = xmlHttp.responseText.replace(/ERROR:/, "");
				eval(id+'_error()');
			} else {
				proxy_clear('label_PDF16_DESIRED_DATE_FROM_TO_error');
				document.getElementById('span_PDF16_DESIRED_DATE_FROM_DAY').innerHTML = xmlHttp.responseText;	
				document.getElementById(id+'_error').innerHTML = '';	
			}
		}
	}
	//confirm(post_pairs);	
	xmlHttp.open("POST", "Ajax/select_one.php", true); 
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");	
	xmlHttp.send(post_pairs);  	
	tabbing = false;
}
var select_PDF16_DESIRED_DATE_FROM_MONTH_error
select_PDF16_DESIRED_DATE_FROM_MONTH_error = function() {
	proxy_set('select_PDF16_DESIRED_DATE_FROM_MONTH_error','label_PDF16_DESIRED_DATE_FROM_TO_error');
	document.getElementById('select_PDF16_DESIRED_DATE_FROM_MONTH').focus();
}

// PDF16_DESIRED_DATE_FROM_DAY
var select_PDF16_DESIRED_DATE_FROM_DAY
select_PDF16_DESIRED_DATE_FROM_DAY = function() {
	// make sure month has been set first
	if(document.getElementById('select_PDF16_DESIRED_DATE_FROM_MONTH').value == 'default') {
		document.getElementById('select_PDF16_DESIRED_DATE_FROM_MONTH').focus();
		document.getElementById('select_PDF16_DESIRED_DATE_FROM_MONTH_error').innerHTML = "Please, select a month prior to selecting a day.";
	}
	proxy_clear('label_PDF16_DESIRED_DATE_FROM_TO_error');
	tabbing = false;
}
var select_PDF16_DESIRED_DATE_FROM_DAY_error
select_PDF16_DESIRED_DATE_FROM_DAY_error = function() {
	proxy_set('select_PDF16_DESIRED_DATE_FROM_DAY_error','label_PDF16_DESIRED_DATE_FROM_TO_error');
	document.getElementById('select_PDF16_DESIRED_DATE_FROM_DAY').focus();
}

var select_PDF16_DESIRED_DATE_FROM_YEAR
select_PDF16_DESIRED_DATE_FROM_YEAR = function() {
	//year = document.getElementById('select_PDF16_DESIRED_DATE_FROM_YEAR').selectedIndex;
	year = document.getElementById('select_PDF16_DESIRED_DATE_FROM_YEAR').value;
	setSessionVar('year',year);
	next_name = 'PDF16_DESIRED_DATE_FROM_MONTH';
	setSessionVar('next_name',next_name);
	document.getElementById('select_PDF16_DESIRED_DATE_FROM_YEAR_error').innerHTML = '';

	tabindex = document.getElementById('select_PDF16_DESIRED_DATE_FROM_MONTH').tabIndex;
	setSessionVar('tabindex',tabindex);
	setSessionVar('table_id','PDF16');
	var id = 'select_PDF16_DESIRED_DATE_FROM_YEAR';
	var name = 'PDF16_DESIRED_DATE_FROM_YEAR';
	var tag = 'select';
	
	var xmlHttp = newXmlHttp();
	var post_pairs = 'sid='+Math.random()+
		'&id='+id+
		'&name='+name+
		'&tag='+tag
	xmlHttp.onreadystatechange = function() {
		if(xmlHttp.readyState == 4) {
			if(mywindow) mywindow.document.write(xmlHttp.responseText);
			if(xmlHttp.responseText.indexOf("ERROR:") == 0)	{
				document.getElementById(id+'_error').innerHTML = xmlHttp.responseText.replace(/ERROR:/, "");
				eval(id+'_error()');
			} else {
				proxy_clear('label_PDF16_DESIRED_DATE_FROM_TO_error');
				document.getElementById('span_PDF16_DESIRED_DATE_FROM_MONTH').innerHTML = xmlHttp.responseText;	
				document.getElementById(id+'_error').innerHTML = '';	
			}
		}
	}
	//confirm(post_pairs);	
	xmlHttp.open("POST", "Ajax/select_one.php", true); 
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");	
	xmlHttp.send(post_pairs);  	
	tabbing = false;

}

var select_PDF16_DESIRED_DATE_FROM_YEAR_error
select_PDF16_DESIRED_DATE_FROM_YEAR_error = function() {
	// HARDWIRED 
	// ATIonblur looks up the hierarchy for the closest div value.  In this case the closest div
	// has a top value of 0
	document.getElementById('select_one_error').style.top = 625;
	proxy_set('select_PDF16_DESIRED_DATE_FROM_YEAR_error','label_PDF16_DESIRED_DATE_FROM_TO_error');
	document.getElementById('select_PDF16_DESIRED_DATE_FROM_YEAR').focus();
}

var select_PDF16_DESIRED_DATE_TO_MONTH
select_PDF16_DESIRED_DATE_TO_MONTH = function() {
	tabbing = false;
}
var select_PDF16_DESIRED_DATE_TO_MONTH_error
select_PDF16_DESIRED_DATE_TO_MONTH_error = function() {
	//document.getElementById('select_PDF16_DESIRED_DATE_FROM_MONTH').focus();
}

var select_PDF16_DESIRED_DATE_TO_DAY
select_PDF16_DESIRED_DATE_TO_DAY = function() {
	tabbing = false;
}
var select_PDF16_DESIRED_DATE_TO_DAY_error
select_PDF16_DESIRED_DATE_TO_DAY_error = function() {
	//document.getElementById('select_PDF16_DESIRED_DATE_TO_DAY_error').focus();
}

var select_PDF16_DESIRED_DATE_TO_YEAR
select_PDF16_DESIRED_DATE_TO_YEAR = function() {
	tabbing = false;
}

var select_PDF16_DESIRED_DATE_TO_YEAR_error
select_PDF16_DESIRED_DATE_TO_YEAR_error = function() {
	//document.getElementById('select_PDF16_DESIRED_DATE_TO_MONTH').focus();
}

// PDF16_EVENT_ADDITIONAL_DATES_EFFECT
var input_PDF16_EVENT_ADDITIONAL_DATES_EFFECT;
input_PDF16_EVENT_ADDITIONAL_DATES_EFFECT = function() {
	tabbing = false;
} 
var input_PDF16_EVENT_ADDITIONAL_DATES_EFFECT_error; 
input_PDF16_EVENT_ADDITIONAL_DATES_EFFECT_error = function() {
	document.getElementById('input_PDF16_EVENT_ADDITIONAL_DATES_EFFECT').focus();
}

// PDF16_RAIN_DATE_EFFECT
var input_PDF16_RAIN_DATE_EFFECT;
input_PDF16_RAIN_DATE_EFFECT = function() {
	tabbing = false;
} 
var input_PDF16_RAIN_DATE_EFFECT_error; 
input_PDF16_RAIN_DATE_EFFECT_error = function() {
	document.getElementById('input_PDF16_RAIN_DATE_EFFECT').focus();
}

// PDF16_TIME_FROM
var select_PDF16_TIME_FROM;
select_PDF16_TIME_FROM = function() {
	proxy_clear('select_PDF16_TIME_TO_error');
	tabbing = false;
} 
var select_PDF16_TIME_FROM_error; 
select_PDF16_TIME_FROM_error = function() {
	proxy_set('select_PDF16_TIME_FROM_error','select_PDF16_TIME_TO_error');
	document.getElementById('select_PDF16_TIME_FROM').focus();
}

// PDF16_TIME_FROM_AMPM
var select_PDF16_TIME_FROM_AMPM;
select_PDF16_TIME_FROM_AMPM = function() {
	proxy_clear('select_PDF16_TIME_TO_error');
	tabbing = false;
} 
var select_PDF16_TIME_FROM_AMPM_error; 
select_PDF16_TIME_FROM_AMPM_error = function() {
	proxy_set('select_PDF16_TIME_FROM_AMPM_error','select_PDF16_TIME_TO_error');
	document.getElementById('select_PDF16_TIME_FROM_AMPM').focus();
}

// PDF16_TIME_TO
var select_PDF16_TIME_TO;
select_PDF16_TIME_TO = function() {
	tabbing = false;
} 
var select_PDF16_TIME_TO_error; 
select_PDF16_TIME_TO_error = function() {
	document.getElementById('select_PDF16_TIME_TO').focus();
}

// PDF16_TIME_TO_AMPM
var select_PDF16_TIME_TO_AMPM;
select_PDF16_TIME_TO_AMPM = function() {
	tabbing = false;
} 
var select_PDF16_TIME_TO_AMPM_error; 
select_PDF16_TIME_TO_AMPM_error = function() {
	document.getElementById('select_PDF16_TIME_TO_AMPM').focus();
}


// PDF16_ENTERTAINMENT_EFFECT
var input_PDF16_ENTERTAINMENT_EFFECT;
input_PDF16_ENTERTAINMENT_EFFECT = function() {
	tabbing = false;
} 
var input_PDF16_ENTERTAINMENT_EFFECT_error; 
input_PDF16_ENTERTAINMENT_EFFECT_error = function() {
	document.getElementById('input_PDF16_ENTERTAINMENT_EFFECT').focus();
}

// PDF16_ATTENDEES
var input_PDF16_ATTENDEES;
input_PDF16_ATTENDEES = function() {
	tabbing = false;
} 
var input_PDF16_ATTENDEES_error; 
input_PDF16_ATTENDEES_error = function() {
	document.getElementById('input_PDF16_ATTENDEES').focus();
}

// PDF16_ATTENDEES_AVERAGE_AGE
var input_PDF16_ATTENDEES_AVERAGE_AGE;
input_PDF16_ATTENDEES_AVERAGE_AGE = function() {
	tabbing = false;
} 
var input_PDF16_ATTENDEES_AVERAGE_AGE_error; 
input_PDF16_ATTENDEES_AVERAGE_AGE_error = function() {
	document.getElementById('input_PDF16_ATTENDEES_AVERAGE_AGE').focus();
}

// PDF16_ATTENDEES_PER_DAY
var input_PDF16_ATTENDEES_PER_DAY;
input_PDF16_ATTENDEES_PER_DAY = function() {
	proxy_clear('input_PDF16_ATTENDEES_AVERAGE_AGE_error');
	tabbing = false;
} 
var input_PDF16_ATTENDEES_PER_DAY_error; 
input_PDF16_ATTENDEES_PER_DAY_error = function() {
	proxy_set('input_PDF16_ATTENDEES_PER_DAY_error','input_PDF16_ATTENDEES_AVERAGE_AGE_error');
	document.getElementById('input_PDF16_ATTENDEES_PER_DAY').focus();
}

// PDF16_MAXIMUM_ATTENDEES
var input_PDF16_MAXIMUM_ATTENDEES;
input_PDF16_MAXIMUM_ATTENDEES = function() {
	tabbing = false;
} 
var input_PDF16_MAXIMUM_ATTENDEES_error; 
input_PDF16_MAXIMUM_ATTENDEES_error = function() {
	document.getElementById('input_PDF16_MAXIMUM_ATTENDEES').focus();
}

// PDF16_COVERAGE_LIMITS
var input_PDF16_COVERAGE_LIMITS;
input_PDF16_COVERAGE_LIMITS = function() {
	proxy_clear('select_PDF16_COVERAGE_error');
	tabbing = false;
} 
var input_PDF16_COVERAGE_LIMITS_error; 
input_PDF16_COVERAGE_LIMITS_error = function() {
	proxy_set('input_PDF16_COVERAGE_LIMITS_error','select_PDF16_COVERAGE_error');
	document.getElementById('input_PDF16_COVERAGE_LIMITS').focus();
}

// PDF16_EVENT_YEARS
var input_PDF16_EVENT_YEARS;
input_PDF16_EVENT_YEARS = function() {
	tabbing = false;
} 
var input_PDF16_EVENT_YEARS_error; 
input_PDF16_EVENT_YEARS_error = function() {
	document.getElementById('input_PDF16_EVENT_YEARS').focus();
}

// PDF16_ATTENDEES_PREVIOUS_YEAR
var input_PDF16_ATTENDEES_PREVIOUS_YEAR;
input_PDF16_ATTENDEES_PREVIOUS_YEAR = function() {
	tabbing = false;
} 
var input_PDF16_ATTENDEES_PREVIOUS_YEAR_error; 
input_PDF16_ATTENDEES_PREVIOUS_YEAR_error = function() {
	document.getElementById('input_PDF16_ATTENDEES_PREVIOUS_YEAR').focus();
}

// PDF16_COVERAGE
var select_PDF16_COVERAGE;
select_PDF16_COVERAGE = function() {
	tabbing = false;
} 
var select_PDF16_COVERAGE_error; 
select_PDF16_COVERAGE_error = function() {
	document.getElementById('select_PDF16_COVERAGE').focus();
}

// PDF16_PREVIOUS_CARRIER
var input_PDF16_PREVIOUS_CARRIER;
input_PDF16_PREVIOUS_CARRIER = function() {
	proxy_clear('input_PDF16_ATTENDEES_PREVIOUS_YEAR_error');
	tabbing = false;
} 
var input_PDF16_PREVIOUS_CARRIER_error; 
input_PDF16_PREVIOUS_CARRIER_error = function() {
	proxy_set('input_PDF16_PREVIOUS_CARRIER_error','input_PDF16_ATTENDEES_PREVIOUS_YEAR_error');
	document.getElementById('input_PDF16_PREVIOUS_CARRIER').focus();
}

// PDF16_POLICY_NUMBER
var input_PDF16_POLICY_NUMBER;
input_PDF16_POLICY_NUMBER = function() {
	proxy_clear('input_PDF16_ATTENDEES_PREVIOUS_YEAR_error');
	tabbing = false;
} 
var input_PDF16_POLICY_NUMBER_error; 
input_PDF16_POLICY_NUMBER_error = function() {
	proxy_set('input_PDF16_POLICY_NUMBER_error','input_PDF16_ATTENDEES_PREVIOUS_YEAR_error');
	document.getElementById('input_PDF16_POLICY_NUMBER').focus();
}

// PDF16_POLICY_PREMIUM
var input_PDF16_POLICY_PREMIUM;
input_PDF16_POLICY_PREMIUM = function() {
	proxy_clear('input_PDF16_ATTENDEES_PREVIOUS_YEAR_error');
	tabbing = false;
} 
var input_PDF16_POLICY_PREMIUM_error; 
input_PDF16_POLICY_PREMIUM_error = function() {
	proxy_set('input_PDF16_POLICY_PREMIUM_error','input_PDF16_ATTENDEES_PREVIOUS_YEAR_error');
	document.getElementById('input_PDF16_POLICY_PREMIUM').focus();
}


// PDF16_CLAIMS
var input_PDF16_CLAIMS;
input_PDF16_CLAIMS = function() {
	tabbing = false;
} 
var input_PDF16_CLAIMS_error; 
input_PDF16_CLAIMS_error = function() {
	document.getElementById('input_PDF16_CLAIMS').focus();
}

// PDF16_LIQUOR_CONSUMERS
var input_PDF16_LIQUOR_CONSUMERS;
input_PDF16_LIQUOR_CONSUMERS = function() {
	tabbing = false;
} 
var input_PDF16_LIQUOR_CONSUMERS_error; 
input_PDF16_LIQUOR_CONSUMERS_error = function() {
	document.getElementById('input_PDF16_LIQUOR_CONSUMERS').focus();
}

// PDF16_SOLE_LIQUOR_VENDOR_EFFECT
var input_PDF16_SOLE_LIQUOR_VENDOR_EFFECT;
input_PDF16_SOLE_LIQUOR_VENDOR_EFFECT = function() {
	tabbing = false;
} 
var input_PDF16_SOLE_LIQUOR_VENDOR_EFFECT_error; 
input_PDF16_SOLE_LIQUOR_VENDOR_EFFECT_error = function() {
	document.getElementById('input_PDF16_SOLE_LIQUOR_VENDOR_EFFECT').focus();
}

// PDF16_OTHER_LIQUOR_VENDOR_REQUIREMENT
var input_PDF16_OTHER_LIQUOR_VENDOR_REQUIREMENT;
input_PDF16_OTHER_LIQUOR_VENDOR_REQUIREMENT = function() {
	tabbing = false;
} 
var input_PDF16_OTHER_LIQUOR_VENDOR_REQUIREMENT_error; 
input_PDF16_OTHER_LIQUOR_VENDOR_REQUIREMENT_error = function() {
	document.getElementById('input_PDF16_OTHER_LIQUOR_VENDOR_REQUIREMENT').focus();
}

// PDF16_PROFESSIONAL_BARTENDER_EFFECT
var input_PDF16_PROFESSIONAL_BARTENDER_EFFECT;
input_PDF16_PROFESSIONAL_BARTENDER_EFFECT = function() {
	tabbing = false;
} 
var input_PDF16_PROFESSIONAL_BARTENDER_EFFECT_error; 
input_PDF16_PROFESSIONAL_BARTENDER_EFFECT_error = function() {
	document.getElementById('input_PDF16_PROFESSIONAL_BARTENDER_EFFECT').focus();
}

// PDF16_PROFESSIONAL_BARTENDER_TRAINING
var input_PDF16_PROFESSIONAL_BARTENDER_TRAINING;
input_PDF16_PROFESSIONAL_BARTENDER_TRAINING = function() {
	tabbing = false;
} 
var input_PDF16_PROFESSIONAL_BARTENDER_TRAINING_error; 
input_PDF16_PROFESSIONAL_BARTENDER_TRAINING_error = function() {
	document.getElementById('input_PDF16_PROFESSIONAL_BARTENDER_TRAINING').focus();
}

// PDF16_PREVENTIVE_MEASURES
var input_PDF16_PREVENTIVE_MEASURES;
input_PDF16_PREVENTIVE_MEASURES = function() {
	tabbing = false;
} 
var input_PDF16_PREVENTIVE_MEASURES_error; 
input_PDF16_PREVENTIVE_MEASURES_error = function() {
	document.getElementById('input_PDF16_PREVENTIVE_MEASURES').focus();
}

// PDF16_ALCOHOL_EFFECT
var input_PDF16_ALCOHOL_EFFECT;
input_PDF16_ALCOHOL_EFFECT = function() {
	tabbing = false;
} 
var input_PDF16_ALCOHOL_EFFECT_error; 
input_PDF16_ALCOHOL_EFFECT_error = function() {
	document.getElementById('input_PDF16_ALCOHOL_EFFECT').focus();
}

// PDF16_LIQUOR_LICENSE
var select_PDF16_LIQUOR_LICENSE;
select_PDF16_LIQUOR_LICENSE = function() {
	tabbing = false;
} 
var select_PDF16_LIQUOR_LICENSE_error; 
select_PDF16_LIQUOR_LICENSE_error = function() {
	document.getElementById('select_PDF16_LIQUOR_LICENSE').focus();
}

// PDF16_REBOUNDING_DEVICES_EFFECT
var input_PDF16_REBOUNDING_DEVICES_EFFECT;
input_PDF16_REBOUNDING_DEVICES_EFFECT = function() {
	tabbing = false;
} 
var input_PDF16_REBOUNDING_DEVICES_EFFECT_error; 
input_PDF16_REBOUNDING_DEVICES_EFFECT_error = function() {
	document.getElementById('input_PDF16_REBOUNDING_DEVICES_EFFECT').focus();
}

// PDF16_WATER_HAZARD_EFFECT
var input_PDF16_WATER_HAZARD_EFFECT;
input_PDF16_WATER_HAZARD_EFFECT = function() {
	tabbing = false;
} 
var input_PDF16_WATER_HAZARD_EFFECT_error; 
input_PDF16_WATER_HAZARD_EFFECT_error = function() {
	document.getElementById('input_PDF16_WATER_HAZARD_EFFECT').focus();
}

// PDF16_SWIM_BOAT_SKI_FISH_EFFECT
var input_PDF16_SWIM_BOAT_SKI_FISH_EFFECT;
input_PDF16_SWIM_BOAT_SKI_FISH_EFFECT = function() {
	tabbing = false;
} 
var input_PDF16_SWIM_BOAT_SKI_FISH_EFFECT_error; 
input_PDF16_SWIM_BOAT_SKI_FISH_EFFECT_error = function() {
	document.getElementById('input_PDF16_SWIM_BOAT_SKI_FISH_EFFECT').focus();
}

// PDF16_INDEPENDENT_CONTRACTORS_EFFECT
var input_PDF16_INDEPENDENT_CONTRACTORS_EFFECT;
input_PDF16_INDEPENDENT_CONTRACTORS_EFFECT = function() {
	tabbing = false;
} 
var input_PDF16_INDEPENDENT_CONTRACTORS_EFFECT_error; 
input_PDF16_INDEPENDENT_CONTRACTORS_EFFECT_error = function() {
	document.getElementById('input_PDF16_INDEPENDENT_CONTRACTORS_EFFECT').focus();
}

// PDF16_INDEPENDENT_CONTRACTORS_INSURANCE_EFFECT
var input_PDF16_INDEPENDENT_CONTRACTORS_INSURANCE_EFFECT;
input_PDF16_INDEPENDENT_CONTRACTORS_INSURANCE_EFFECT = function() {
	tabbing = false;
} 
var input_PDF16_INDEPENDENT_CONTRACTORS_INSURANCE_EFFECT_error; 
input_PDF16_INDEPENDENT_CONTRACTORS_INSURANCE_EFFECT_error = function() {
	document.getElementById('input_PDF16_INDEPENDENT_CONTRACTORS_INSURANCE_EFFECT').focus();
}

// PDF16_SECURITY_MEASURES
var input_PDF16_SECURITY_MEASURES;
input_PDF16_SECURITY_MEASURES = function() {
	tabbing = false;
} 
var input_PDF16_SECURITY_MEASURES_error; 
input_PDF16_SECURITY_MEASURES_error = function() {
	document.getElementById('input_PDF16_SECURITY_MEASURES').focus();
}

// PDF16_SECURITY_BY
var select_PDF16_SECURITY_BY;
select_PDF16_SECURITY_BY = function() {
	tabbing = false;
} 
var select_PDF16_SECURITY_BY_error; 
select_PDF16_SECURITY_BY_error = function() {
	document.getElementById('select_PDF16_SECURITY_BY').focus();
}

// PDF16_NAME_PERFORMERS
var input_PDF16_NAME_PERFORMERS;
input_PDF16_NAME_PERFORMERS = function() {
	tabbing = false;
} 
var input_PDF16_NAME_PERFORMERS_error; 
input_PDF16_NAME_PERFORMERS_error = function() {
	document.getElementById('input_PDF16_NAME_PERFORMERS').focus();
}

// PDF16_MUSIC_TYPE
var input_PDF16_MUSIC_TYPE;
input_PDF16_MUSIC_TYPE = function() {
	tabbing = false;
} 
var input_PDF16_MUSIC_TYPE_error; 
input_PDF16_MUSIC_TYPE_error = function() {
	document.getElementById('input_PDF16_MUSIC_TYPE').focus();
}

// PDF16_PERFORMERS_LOCAL
var select_PDF16_PERFORMERS_LOCAL;
select_PDF16_PERFORMERS_LOCAL = function() {
	tabbing = false;
} 
var select_PDF16_PERFORMERS_LOCAL_error; 
select_PDF16_PERFORMERS_LOCAL_error = function() {
	document.getElementById('select_PDF16_PERFORMERS_LOCAL').focus();
}

// PDF16_ROUTE_APPROVED_EFFECT
var input_PDF16_ROUTE_APPROVED_EFFECT;
input_PDF16_ROUTE_APPROVED_EFFECT = function() {
	tabbing = false;
} 
var input_PDF16_ROUTE_APPROVED_EFFECT_error; 
input_PDF16_ROUTE_APPROVED_EFFECT_error = function() {
	document.getElementById('input_PDF16_ROUTE_APPROVED_EFFECT').focus();
}

// PDF16_PARADE_ROUTE
var input_PDF16_PARADE_ROUTE;
input_PDF16_PARADE_ROUTE = function() {
	tabbing = false;
} 
var input_PPDF16_ARADE_ROUTE_error; 
input_PDF16_PARADE_ROUTE_error = function() {
	document.getElementById('input_PDF16_PARADE_ROUTE').focus();
}

// PDF16_ATHLETIC_EVENT
var input_PDF16_ATHLETIC_EVENT;
input_PDF16_ATHLETIC_EVENT = function() {
	tabbing = false;
} 
var input_PDF16_ATHLETIC_EVENT_error; 
input_PDF16_ATHLETIC_EVENT_error = function() {
	document.getElementById('input_PDF16_ATHLETIC_EVENT').focus();
}

// PDF16_ATHLETIC_PROFICIENCY
var select_PDF16_ATHLETIC_PROFICIENCY;
select_PDF16_ATHLETIC_PROFICIENCY = function() {
	tabbing = false;
} 
var select_PDF16_ATHLETIC_PROFICIENCY_error; 
select_PDF16_ATHLETIC_PROFICIENCY_error = function() {
	document.getElementById('select_PDF16_ATHLETIC_PROFICIENCY').focus();
}

// PDF16_BARRIERS_EFFECT
var input_PDF16_BARRIERS_EFFECT;
input_PDF16_BARRIERS_EFFECT = function() {
	tabbing = false;
} 
var input_PDF16_BARRIERS_EFFECT_error; 
input_PDF16_BARRIERS_EFFECT_error = function() {
	document.getElementById('input_PDF16_BARRIERS_EFFECT').focus();
}

// BARRIERS_HEIGHT
var input_PDF16_BARRIERS_HEIGHT;
input_PDF16_BARRIERS_HEIGHT = function() {
	tabbing = false;
} 
var input_PDF16_BARRIERS_HEIGHT_error; 
input_PDF16_BARRIERS_HEIGHT_error = function() {
	document.getElementById('input_PDF16_BARRIERS_HEIGHT').focus();
}

// PDF16_BARRIERS_DISTANCE
var input_PDF16_BARRIERS_DISTANCE;
input_PDF16_BARRIERS_DISTANCE = function() {
	tabbing = false;
} 
var input_PDF16_BARRIERS_DISTANCE_error; 
input_PDF16_BARRIERS_DISTANCE_error = function() {
	document.getElementById('input_PDF16_BARRIERS_DISTANCE').focus();
}

function PDF16_clicked_signature (id) {
	if(document.getElementById(id).checked) 
	{ 
		setSessionVar(id, "yes");	// not yes; need to circumvent post values
		document.getElementById(id).value ="yes"; 
		document.getElementById('label_PDF16_SIGNATURE').innerHTML ="I approve of this transaction."; 
	} else {
		setSessionVar(id, "no");	// not yes; need to circumvent post values
		document.getElementById(id).value ="no"; 
		document.getElementById('label_PDF16_SIGNATURE').innerHTML ="By checking this box, in lieu of my signature, I approve of this transaction."; 
	}
}

/*
function PDF16_checkbox_with_effect (id) {
	document.getElementById('content').style.height = document.getElementById('content_height').innerHTML;
	var name = document.getElementById(id).name;
	if(document.getElementById(id).checked) 
	{ 
		getSessionVar(name+'_yes', 'label_'+name+'_effect')	// performs innerHTML on arg 2
		setSessionVar(id, "yes");	// not yes; need to circumvent post values
		document.getElementById(id).value ="yes";
		//document.getElementById(id+'_EFFECT').focus();	// i.e. input_PDF16_LARGER_FUNCTION_EFFECT
	} else {
		getSessionVar(name+'_no', 'label_'+name+'_effect')	
		setSessionVar(id, "no");	// not yes; need to circumvent post values
		document.getElementById(id).value ="no"; 
	}
}
*/

var error;
function PDF16_checkbox_with_effect (id) {
	document.getElementById('content').style.height = document.getElementById('content_height').innerHTML;
	var name = document.getElementById(id).name;
	var id_effect = id+'_EFFECT';
	if(document.getElementById(id).checked) 
	{ 
		getSessionVar(name+'_yes', 'label_'+name+'_effect')	// performs innerHTML on arg 2
		setSessionVar(id, "yes");	// not yes; need to circumvent post values
		document.getElementById(id).value ="yes"; 
		document.getElementById(id_effect).focus();	// i.e. input_PDF16_LARGER_FUNCTION_EFFECT
		document.getElementById(id_effect).title = '';	
		error = true;
	} else {
		getSessionVar(name+'_no', 'label_'+name+'_effect')	
		setSessionVar(id, "no");	// not yes; need to circumvent post values
		document.getElementById(id).value ="no"; 
		document.getElementById(id).focus();
		document.getElementById(id_effect).title = 'optional';	
		tabbing = false;
		error = false;
	}
}

// PDF16_WEBSITE_EFFECT
var input_PDF16_WEBSITE_EFFECT;
input_PDF16_WEBSITE_EFFECT = function() {
	tabbing = false;
	error = false;
} 
var input_PDF16_WEBSITE_EFFECT_error; 
input_PDF16_WEBSITE_EFFECT_error = function() {
	if(error) {
		document.getElementById('input_PDF16_WEBSITE_EFFECT').focus();
	} else {
		document.getElementById('input_PDF16_WEBSITE_EFFECT_error').innerHTML = '';	// turn off the error
		document.getElementById('text_error').style.visibility = 'hidden';
		tabbing = false;
	}
}

// PDF16_OTHER_EVENT_LOCATION_EFFECT
var input_PDF16_OTHER_EVENT_LOCATION_EFFECT;
input_PDF16_OTHER_EVENT_LOCATION_EFFECT = function() {
	tabbing = false;
	error = false;
} 
var input_PDF16_OTHER_EVENT_LOCATION_EFFECT_error; 
input_PDF16_OTHER_EVENT_LOCATION_EFFECT_error = function() {
	if(error) {
		document.getElementById('input_PDF16_OTHER_EVENT_LOCATION_EFFECT').focus();
	} else {
		document.getElementById('input_PDF16_OTHER_EVENT_LOCATION_EFFECT_error').innerHTML = '';	// turn off the error
		document.getElementById('text_error').style.visibility = 'hidden';
		tabbing = false;
	}
}

// PDF16_EVENT_ADDITIONAL_DATES_EFFECT
var input_PDF16_EVENT_ADDITIONAL_DATES_EFFECT;
input_PDF16_EVENT_ADDITIONAL_DATES_EFFECT = function() {
	tabbing = false;
	error = false;
} 
var input_PDF16_EVENT_ADDITIONAL_DATES_EFFECT_error; 
input_PDF16_EVENT_ADDITIONAL_DATES_EFFECT_error = function() {
	if(error) {
		document.getElementById('input_PDF16_EVENT_ADDITIONAL_DATES_EFFECT').focus();
	} else {
		document.getElementById('input_PDF16_EVENT_ADDITIONAL_DATES_EFFECT_error').innerHTML = '';	// turn off the error
		document.getElementById('text_error').style.visibility = 'hidden';
		tabbing = false;
	}
}

// PDF16_ENTERTAINMENT_EFFECT
var input_PDF16_ENTERTAINMENT_EFFECT;
input_PDF16_EVENT_ADDITIONAL_DATES_EFFECT = function() {
	tabbing = false;
	error = false;
} 
var input_PDF16_ENTERTAINMENT_EFFECT_error; 
input_PDF16_ENTERTAINMENT_EFFECT_error = function() {
	if(error) {
		document.getElementById('input_PDF16_ENTERTAINMENT_EFFECT').focus();
	} else {
		document.getElementById('input_PDF16_ENTERTAINMENT_EFFECT_error').innerHTML = '';	// turn off the error
		document.getElementById('text_error').style.visibility = 'hidden';
		tabbing = false;
	}
}

// PDF16_RAIN_DATE_EFFECT
var input_PDF16_RAIN_DATE_EFFECT;
input_PDF16_RAIN_DATE_EFFECT = function() {
	tabbing = false;
	error = false;
} 
var input_PDF16_RAIN_DATE_EFFECT_error; 
input_PDF16_RAIN_DATE_EFFECT_error = function() {
	if(error) {
		document.getElementById('input_PDF16_RAIN_DATE_EFFECT').focus();
	} else {
		document.getElementById('input_PDF16_RAIN_DATE_EFFECT_error').innerHTML = '';	// turn off the error
		document.getElementById('text_error').style.visibility = 'hidden';
		tabbing = false;
	}
}

// PDF16_OTHER_EVENT_EFFECT
var input_PDF16_OTHER_EVENT_EFFECT;
input_PDF16_OTHER_EVENT_EFFECT = function() {
	tabbing = false;
	error = false;
} 
var input_PDF16_OTHER_EVENT_EFFECT_error; 
input_PDF16_OTHER_EVENT_EFFECT_error = function() {
	if(error) {
		document.getElementById('input_PDF16_OTHER_EVENT_EFFECT').focus();
	} else {
		document.getElementById('input_PDF16_OTHER_EVENT_EFFECT_error').innerHTML = '';	// turn off the error
		document.getElementById('text_error').style.visibility = 'hidden';
		tabbing = false;
	}
}

// PDF16_SOLE_LIQUOR_VENDOR_EFFECT
var input_PDF16_SOLE_LIQUOR_VENDOR_EFFECT;
input_PDF16_SOLE_LIQUOR_VENDOR_EFFECT = function() {
	tabbing = false;
	error = false;
} 
var input_PDF16_SOLE_LIQUOR_VENDOR_EFFECT_error; 
input_PDF16_SOLE_LIQUOR_VENDOR_EFFECT_error = function() {
	if(error) {
		document.getElementById('input_PDF16_SOLE_LIQUOR_VENDOR_EFFECT').focus();
	} else {
		document.getElementById('input_PDF16_SOLE_LIQUOR_VENDOR_EFFECT_error').innerHTML = '';	// turn off the error
		document.getElementById('text_error').style.visibility = 'hidden';
		tabbing = false;
	}
}

// PDF16_OTHER_LIQUOR_VENDOR_EFFECT
var input_PDF16_OTHER_LIQUOR_VENDOR_EFFECT;
input_PDF16_OTHER_LIQUOR_VENDOR_EFFECT = function() {
	tabbing = false;
	error = false;
} 
var input_PDF16_OTHER_LIQUOR_VENDOR_EFFECT_error; 
input_PDF16_OTHER_LIQUOR_VENDOR_EFFECT_error = function() {
	if(error) {
		document.getElementById('input_PDF16_OTHER_LIQUOR_VENDOR_EFFECT').focus();
	} else {
		document.getElementById('input_PDF16_OTHER_LIQUOR_VENDOR_EFFECT_error').innerHTML = '';	// turn off the error
		document.getElementById('text_error').style.visibility = 'hidden';
		tabbing = false;
	}
}

// PDF16_PROFESSIONAL_BARTENDER_EFFECT
var input_PDF16_PROFESSIONAL_BARTENDER_EFFECT;
input_PDF16_PROFESSIONAL_BARTENDER_EFFECT = function() {
	tabbing = false;
	error = false;
} 
var input_PDF16_PROFESSIONAL_BARTENDER_EFFECT_error; 
input_PDF16_PROFESSIONAL_BARTENDER_EFFECT_error = function() {
	if(error) {
		document.getElementById('input_PDF16_PROFESSIONAL_BARTENDER_EFFECT').focus();
	} else {
		document.getElementById('input_PDF16_PROFESSIONAL_BARTENDER_EFFECT_error').innerHTML = '';	// turn off the error
		document.getElementById('text_error').style.visibility = 'hidden';
		tabbing = false;
	}
}

// PDF16_ALCOHOL_SOLD_EFFECT
var input_PDF16_ALCOHOL_SOLD_EFFECT;
input_PDF16_ALCOHOL_SOLD_EFFECT = function() {
	tabbing = false;
	error = false;
} 
var input_PDF16_ALCOHOL_SOLD_EFFECT_error; 
input_PDF16_ALCOHOL_SOLD_EFFECT_error = function() {
	if(error) {
		document.getElementById('input_PDF16_ALCOHOL_SOLD_EFFECT').focus();
	} else {
		document.getElementById('input_PDF16_ALCOHOL_SOLD_EFFECT_error').innerHTML = '';	// turn off the error
		document.getElementById('text_error').style.visibility = 'hidden';
		tabbing = false;
	}
}

// PDF16_REBOUNDING_DEVICES_EFFECT
var input_PDF16_REBOUNDING_DEVICES_EFFECT;
input_PDF16_REBOUNDING_DEVICES_EFFECT = function() {
	tabbing = false;
	error = false;
} 
var input_PDF16_REBOUNDING_DEVICES_EFFECT_error; 
input_PDF16_REBOUNDING_DEVICES_EFFECT_error = function() {
	if(error) {
		document.getElementById('input_PDF16_REBOUNDING_DEVICES_EFFECT').focus();
	} else {
		document.getElementById('input_PDF16_REBOUNDING_DEVICES_EFFECT_error').innerHTML = '';	// turn off the error
		document.getElementById('text_error').style.visibility = 'hidden';
		tabbing = false;
	}
}

// PDF16_WATER_HAZARD_EFFECT
var input_PDF16_WATER_HAZARD_EFFECT;
input_PDF16_WATER_HAZARD_EFFECT = function() {
	tabbing = false;
	error = false;
} 
var input_PDF16_WATER_HAZARD_EFFECT_error; 
input_PDF16_WATER_HAZARD_EFFECT_error = function() {
	if(error) {
		document.getElementById('input_PDF16_WATER_HAZARD_EFFECT').focus();
	} else {
		document.getElementById('input_PDF16_WATER_HAZARD_EFFECT_error').innerHTML = '';	// turn off the error
		document.getElementById('text_error').style.visibility = 'hidden';
		tabbing = false;
	}
}

// PDF16_SWIM_BOAT_SKI_FISH_EFFECT
var input_PDF16_SWIM_BOAT_SKI_FISH_EFFECT;
input_PDF16_SWIM_BOAT_SKI_FISH_EFFECT = function() {
	tabbing = false;
	error = false;
} 
var input_PDF16_SWIM_BOAT_SKI_FISH_EFFECT_error; 
input_PDF16_SWIM_BOAT_SKI_FISH_EFFECT_error = function() {
	if(error) {
		document.getElementById('input_PDF16_SWIM_BOAT_SKI_FISH_EFFECT').focus();
	} else {
		document.getElementById('input_PDF16_SWIM_BOAT_SKI_FISH_EFFECT_error').innerHTML = '';	// turn off the error
		document.getElementById('text_error').style.visibility = 'hidden';
		tabbing = false;
	}
}

// PDF16_INDEPENDENT_CONTRACTORS_EFFECT
var input_PDF16_INDEPENDENT_CONTRACTORS_EFFECT;
input_PDF16_INDEPENDENT_CONTRACTORS_EFFECT = function() {
	tabbing = false;
	error = false;
} 
var input_PDF16_INDEPENDENT_CONTRACTORS_EFFECT_error; 
input_PDF16_INDEPENDENT_CONTRACTORS_EFFECT_error = function() {
	if(error) {
		document.getElementById('input_PDF16_INDEPENDENT_CONTRACTORS_EFFECT').focus();
	} else {
		document.getElementById('input_PDF16_INDEPENDENT_CONTRACTORS_EFFECT_error').innerHTML = '';	// turn off the error
		document.getElementById('text_error').style.visibility = 'hidden';
		tabbing = false;
	}
}

// PDF16_INDEPENDENT_CONTRACTORS_INSURANCE_EFFECT
var input_PDF16_INDEPENDENT_CONTRACTORS_INSURANCE_EFFECT;
input_PDF16_INDEPENDENT_CONTRACTORS_INSURANCE_EFFECT = function() {
	tabbing = false;
	error = false;
} 
var input_PDF16_INDEPENDENT_CONTRACTORS_INSURANCE_EFFECT_error; 
input_PDF16_INDEPENDENT_CONTRACTORS_INSURANCE_EFFECT_error = function() {
	if(error) {
		document.getElementById('input_PDF16_INDEPENDENT_CONTRACTORS_INSURANCE_EFFECT').focus();
	} else {
		document.getElementById('input_PDF16_INDEPENDENT_CONTRACTORS_INSURANCE_EFFECT_error').innerHTML = '';	// turn off the error
		document.getElementById('text_error').style.visibility = 'hidden';
		tabbing = false;
	}
}

// PDF16_SPECIAL_EFFECTS_EFFECT
var input_PDF16_SPECIAL_EFFECTS_EFFECT;
input_PDF16_SPECIAL_EFFECTS_EFFECT = function() {
	tabbing = false;
	error = false;
} 
var input_PDF16_SPECIAL_EFFECTS_EFFECT_error; 
input_PDF16_SPECIAL_EFFECTS_EFFECT_error = function() {
	if(error) {
		document.getElementById('input_PDF16_SPECIAL_EFFECTS_EFFECT').focus();
	} else {
		document.getElementById('input_PDF16_SPECIAL_EFFECTS_EFFECT_error').innerHTML = '';	// turn off the error
		document.getElementById('text_error').style.visibility = 'hidden';
		tabbing = false;
	}
}

// PDF16_BARRIERS_EFFECT
var input_PDF16_BARRIERS_EFFECT;
input_PDF16_BARRIERS_EFFECT = function() {
	tabbing = false;
	error = false;
} 
var input_PDF16_BARRIERS_EFFECT_error; 
input_PDF16_BARRIERS_EFFECT_error = function() {
	if(error) {
		document.getElementById('input_PDF16_BARRIERS_EFFECT').focus();
	} else {
		document.getElementById('input_PDF16_BARRIERS_EFFECT_error').innerHTML = '';	// turn off the error
		document.getElementById('text_error').style.visibility = 'hidden';
		tabbing = false;
	}
}

input_PDF16_ROUTE_APPROVED_EFFECT
function PDF16_checkbox (id) {
	var name = document.getElementById(id).name;
	var label = document.getElementById('label_'+name).innerHTML;
	setSessionVar('label_'+name, label);	
	if(document.getElementById(id).checked) 
	{ 
		setSessionVar(id, "yes");	// not yes; need to circumvent post values
		document.getElementById(id).value ="yes"; 
	} else {
		setSessionVar(id, "no");	// not yes; need to circumvent post values
		document.getElementById(id).value ="no"; 
	}
}