// 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 PDF15_print_name() {
	var name = document.getElementById('input_PDF15_NAME').value;
	document.getElementById('input_PDF15_PRINT_NAME').value = name;
}	

var forms;
var form;
var elem;
function validate_PDF15() {
	//confirm('validate_PDF15')
	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;
				}
			}
		}
	}
}

// PDF15_EVENT_FLYER
var input_PDF15_EVENT_FLYER;
input_PDF15_EVENT_FLYER = function() {
	tabbing = false;
} 
var input_PDF15_EVENT_FLYER_error; 
input_PDF15_EVENT_FLYER_error = function() {
	document.getElementById('input_PDF15_EVENT_FLYER').focus();
}

// PDF15_NAME
var input_PDF15_NAME;
input_PDF15_NAME = function() {
	var name = document.getElementById('input_PDF15_NAME').value;
	// the printed name is empty fill
	if(document.getElementById('input_PDF15_PRINT_NAME').value == '') {
		document.getElementById('input_PDF15_PRINT_NAME').value = name;
	}
} 
var input_PDF15_NAME_error; 
input_PDF15_NAME_error = function() {
	document.getElementById('input_PDF15_NAME').focus();
}

// PDF15_POSITON
var select_PDF15_POSITON
select_PDF15_POSITON = function() {
	tabbing = false;
}
var select_PDF15_POSITON_error
select_PDF15_POSITON_error = function() {
	document.getElementById('select_PDF15_POSITON').focus();
}

// PDF15_ORGANIZATION
var input_PDF15_ORGANIZATION;
input_PDF15_ORGANIZATION = function() {
	tabbing = false;
} 
var input_PDF15_ORGANIZATION_error; 
input_PDF15_ORGANIZATION_error = function() {
	document.getElementById('input_PDF15_ORGANIZATION').focus();
}

// PDF15_NUMBER_EVENTS
var input_PDF15_NUMBER_EVENTS;
input_PDF15_NUMBER_EVENTS = function() {
	tabbing = false;
} 
var input_PDF15_NUMBER_EVENTS_error; 
input_PDF15_NUMBER_EVENTS_error = function() {
	document.getElementById('input_PDF15_NUMBER_EVENTS').focus();
}

// PDF15_OTHER_EVENT_DESCRIBE
var input_PDF15_OTHER_EVENT_DESCRIBE;
input_PDF15_OTHER_EVENT_DESCRIBE = function() {
	tabbing = false;
} 
var input_PDF15_OTHER_EVENT_DESCRIBE_error; 
input_PDF15_OTHER_EVENT_DESCRIBE_error = function() {
	document.getElementById('input_PDF15_OTHER_EVENT_DESCRIBE').focus();
}

// PDF15_EVENT_VENUE_NAME
var input_PDF15_EVENT_VENUE_NAME;
input_PDF15_EVENT_VENUE_NAME = function() {
	tabbing = false;
} 
var input_PDF15_EVENT_VENUE_NAME_error; 
input_PDF15_EVENT_VENUE_NAME_error = function() {
	document.getElementById('input_PDF15_EVENT_VENUE_NAME').focus();
}

// PDF15_EVENT_VENUE_STREET
var input_PDF15_EVENT_VENUE_STREET;
input_PDF15_EVENT_VENUE_STREET = function() {
	tabbing = false;
} 
var input_PDF15_EVENT_VENUE_STREET_error; 
input_PDF15_EVENT_VENUE_STREET_error = function() {
	document.getElementById('input_PDF15_EVENT_VENUE_STREET').focus();
}

// PDF15_EVENT_VENUE_CITY
var input_PDF15_EVENT_VENUE_CITY;
input_PDF15_EVENT_VENUE_CITY = function() {
	proxy_clear('input_PDF15_EVENT_VENUE_STREET_error');
	tabbing = false;
} 
var input_PDF15_EVENT_VENUE_CITY_error; 
input_PDF15_EVENT_VENUE_CITY_error = function() {
	proxy_set('input_PDF15_EVENT_VENUE_CITY_error','input_PDF15_EVENT_VENUE_STREET_error');
	document.getElementById('input_PDF15_EVENT_VENUE_CITY').focus();
}

// PDF15_EVENT_VENUE_STATE
var select_PDF15_EVENT_VENUE_STATE;
select_PDF15_EVENT_VENUE_STATE = function() {
	proxy_clear('input_PDF15_EVENT_VENUE_STREET_error');
	tabbing = false;
} 
var select_PDF15_EVENT_VENUE_STATE_error; 
select_PDF15_EVENT_VENUE_STATE_error = function() {
	proxy_set('select_PDF15_EVENT_VENUE_STATE_error','input_PDF15_EVENT_VENUE_STREET_error');
	document.getElementById('select_PDF15_EVENT_VENUE_STATE').focus();
}

// PDF15_EVENT_VENUE_ZIP
var input_PDF15_EVENT_VENUE_ZIP;
input_PDF15_EVENT_VENUE_ZIP = function() {
	proxy_clear('input_PDF15_EVENT_VENUE_STREET_error');
	tabbing = false;
} 
var input_PDF15_EVENT_VENUE_ZIP_error; 
input_PDF15_EVENT_VENUE_ZIP_error = function() {
	proxy_set('input_PDF15_EVENT_VENUE_ZIP_error','input_PDF15_EVENT_VENUE_STREET_error');
	document.getElementById('input_PDF15_EVENT_VENUE_ZIP').focus();
}

// PDF15_OTHER_VENUE_TYPE
var input_PDF15_OTHER_VENUE_TYPE;
input_PDF15_OTHER_VENUE_TYPE = function() {
	tabbing = false;
} 
var input_PDF15_OTHER_VENUE_TYPE_error; 
input_PDF15_OTHER_VENUE_TYPE_error = function() {
	document.getElementById('input_PDF15_OTHER_VENUE_TYPE').focus();
}

// PDF15_OTHER_VENUE_TYPE_DESCRIBE
var input_PDF15_OTHER_VENUE_TYPE_DESCRIBE;
input_PDF15_OTHER_VENUE_TYPE_DESCRIBE = function() {
	tabbing = false;
} 
var input_PDF15_OTHER_VENUE_TYPE_DESCRIBE_error; 
input_PDF15_OTHER_VENUE_TYPE_DESCRIBE_error = function() {
	document.getElementById('input_PDF15_OTHER_VENUE_TYPE_DESCRIBE').focus();
}

/*
// PDF15_DATE_FROM_YEAR
var select_PDF15_DATE_FROM_YEAR;
select_PDF15_DATE_FROM_YEAR = function() {
	proxy_clear('label_PDF15_DATE_FROM_TO_error');
	tabbing = false;
} 
var select_PDF15_DATE_FROM_YEAR_error; 
select_PDF15_DATE_FROM_YEAR_error = function() {
	proxy_set('select_PDF15_DATE_FROM_YEAR_error','label_PDF15_DATE_FROM_TO_error');
	// 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;
	document.getElementById('select_PDF15_DATE_FROM_YEAR').focus();
}
*/

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

var input_PDF15_EVENT_DAYS;
input_PDF15_EVENT_DAYS = function() {
	// calculate calendar date from to
	//month = parseInt(document.getElementById('select_PDF15_DATE_FROM_MONTH').value);
	month = document.getElementById('select_PDF15_DATE_FROM_MONTH').value;
	day = document.getElementById('select_PDF15_DATE_FROM_DAY').value;
	//year = parseInt(document.getElementById('select_PDF15_DATE_FROM_YEAR').value);
	year = document.getElementById('select_PDF15_DATE_FROM_YEAR').value;
	days = document.getElementById('input_PDF15_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 = PDF15_get_to_date('get_to_date','days','tag');
		proxy_clear('label_PDF15_DATE_FROM_TO_error');
	}
	tabbing = false;
}	

function PDF15_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_PDF15_DATE_TO_MONTH').value = to_date[0];
			document.getElementById('select_PDF15_DATE_TO_DAY').value = to_date[1];
			document.getElementById('select_PDF15_DATE_TO_YEAR').value = to_date[2];
			// insures values are available since disabled lists are not returned by Submit
			month = document.getElementById('select_PDF15_DATE_TO_MONTH').value;
			day = document.getElementById('select_PDF15_DATE_TO_DAY').value;
			year = document.getElementById('select_PDF15_DATE_TO_YEAR').value;
			setSessionVar('PDF15_DATE_TO_MONTH',month);
			setSessionVar('PDF15_DATE_TO_DAY',day);
			setSessionVar('PDF15_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_PDF15_EVENT_DAYS_error
input_PDF15_EVENT_DAYS_error = function() {
	proxy_set('input_PDF15_EVENT_DAYS_error','label_PDF15_DATE_FROM_TO_error');
	document.getElementById('input_PDF15_EVENT_DAYS').focus();
}	

var select_PDF15_DATE_FROM_MONTH
select_PDF15_DATE_FROM_MONTH = function() {
	// make sure year has been set first
	if(document.getElementById('select_PDF15_DATE_FROM_YEAR').value == 'default') {
		document.getElementById('select_PDF15_DATE_FROM_YEAR').focus();
		document.getElementById('select_PDF15_DATE_FROM_YEAR_error').innerHTML = "Please, select a year prior to selecting a month.";
		tabbing = false;
	}
	id = 'select_PDF15_DATE_FROM_MONTH';
	name = 'PDF15_DATE_FROM_MONTH';
	tag = 'select';
	//month = document.getElementById('select_PDF15_DATE_FROM_MONTH').selectedIndex;
	month = document.getElementById('select_PDF15_DATE_FROM_MONTH').value;
	setSessionVar('month',month);
	tabindex = document.getElementById('select_PDF15_DATE_FROM_DAY').tabIndex;
	setSessionVar('tabindex',tabindex);
	//year = document.getElementById('select_PDF15_DATE_FROM_YEAR').selectedIndex;
	year = document.getElementById('select_PDF15_DATE_FROM_YEAR').value;
	setSessionVar('year',year);
	setSessionVar('table_id','PDF15');
	//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_PDF15_DATE_FROM_TO_error');
				document.getElementById('span_PDF15_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_PDF15_DATE_FROM_MONTH_error
select_PDF15_DATE_FROM_MONTH_error = function() {
	proxy_set('select_PDF15_DATE_FROM_MONTH_error','label_PDF15_DATE_FROM_TO_error');
	document.getElementById('select_PDF15_DATE_FROM_MONTH').focus();
}

// PDF15_DATE_FROM_DAY
var select_PDF15_DATE_FROM_DAY
select_PDF15_DATE_FROM_DAY = function() {
	// make sure month has been set first
	if(document.getElementById('select_PDF15_DATE_FROM_MONTH').value == 'default') {
		document.getElementById('select_PDF15_DATE_FROM_MONTH').focus();
		document.getElementById('select_PDF15_DATE_FROM_MONTH_error').innerHTML = "Please, select a month prior to selecting a day.";
	}
	proxy_clear('label_PDF15_DATE_FROM_TO_error');
	tabbing = false;
}
var select_PDF15_DATE_FROM_DAY_error
select_PDF15_DATE_FROM_DAY_error = function() {
	proxy_set('select_PDF15_DATE_FROM_DAY_error','label_PDF15_DATE_FROM_TO_error');
	document.getElementById('select_PDF15_DATE_FROM_DAY').focus();
}

var select_PDF15_DATE_FROM_YEAR
select_PDF15_DATE_FROM_YEAR = function() {
	//year = document.getElementById('select_PDF15_DATE_FROM_YEAR').selectedIndex;
	year = document.getElementById('select_PDF15_DATE_FROM_YEAR').value;
	setSessionVar('year',year);
	next_name = 'PDF15_DATE_FROM_MONTH';
	setSessionVar('next_name',next_name);
	document.getElementById('select_PDF15_DATE_FROM_YEAR_error').innerHTML = '';

	tabindex = document.getElementById('select_PDF15_DATE_FROM_MONTH').tabIndex;
	setSessionVar('tabindex',tabindex);
	setSessionVar('table_id','PDF15');
	var id = 'select_PDF15_DATE_FROM_YEAR';
	var name = 'PDF15_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_PDF15_DATE_FROM_TO_error');
				document.getElementById('span_PDF15_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_PDF15_DATE_FROM_YEAR_error
select_PDF15_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_PDF15_DATE_FROM_YEAR_error','label_PDF15_DATE_FROM_TO_error');
	document.getElementById('select_PDF15_DATE_FROM_YEAR').focus();
}

var select_PDF15_DATE_TO_MONTH
select_PDF15_DATE_TO_MONTH = function() {
	tabbing = false;
}
var select_PDF15_DATE_TO_MONTH_error
select_PDF15_DATE_TO_MONTH_error = function() {
	//document.getElementById('select_PDF15_DATE_FROM_MONTH').focus();
}

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

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

var select_PDF15_DATE_TO_YEAR_error
select_PDF15_DATE_TO_YEAR_error = function() {
	//document.getElementById('select_PDF15_DATE_TO_MONTH').focus();
}

// PDF15_TIME_FROM
var select_PDF15_TIME_FROM
select_PDF15_TIME_FROM = function() {
	proxy_clear('select_PDF15_TIME_TO_AMPM_error');
	tabbing = false;
}
var select_PDF15_TIME_FROM_error
select_PDF15_TIME_FROM_error = function() {
	proxy_set('select_PDF15_TIME_FROM_error','select_PDF15_TIME_TO_AMPM_error');
	document.getElementById('select_PDF15_TIME_FROM').focus();
}

// PDF15_TIME_TO
var select_PDF15_TIME_TO
select_PDF15_TIME_TO = function() {
	proxy_clear('select_PDF15_TIME_TO_AMPM_error');
	tabbing = false;
}
var select_PDF15_TIME_TO_error
select_PDF15_TIME_TO_error = function() {
	proxy_set('select_PDF15_TIME_TO_error','select_PDF15_TIME_TO_AMPM_error');
	document.getElementById('select_PDF15_TIME_TO').focus();
}

// PDF15_TIME_FROM_AMPM
var select_PDF15_TIME_FROM_AMPM
select_PDF15_TIME_FROM_AMPM = function() {
	//tabbing = false;
}
var select_PDF15_TIME_FROM_AMPM_error
select_PDF15_TIME_FROM_AMPM_error = function() {
	//document.getElementById('select_PDF15_TIME_FROM_AMPM').focus();
}

// PDF15_TIME_TO_AMPM
var select_PDF15_TIME_TO_AMPM
select_PDF15_TIME_TO_AMPM = function() {
	//tabbing = false;
}
var select_PDF15_TIME_TO_AMPM_error
select_PDF15_TIME_TO_AMPM_error = function() {
	//document.getElementById('select_PDF15_TIME_FROM_AMPM').focus();
}

var input_PDF15_EVENT_PURPOSE;
input_PDF15_EVENT_PURPOSE = function() {
	tabbing = false;
} 
var input_PDF15_EVENT_PURPOSE_error; 
input_PDF15_EVENT_PURPOSE_error = function() {
	document.getElementById('input_PDF15_EVENT_PURPOSE').focus();
}

// PDF15_LARGER_FUNCTION_EFFECT
var input_PDF15_LARGER_FUNCTION_EFFECT;
input_PDF15_LARGER_FUNCTION_EFFECT = function() {
	tabbing = false;
} 
var input_PDF15_LARGER_FUNCTION_EFFECT_error; 
input_PDF15_LARGER_FUNCTION_EFFECT_error = function() {
	document.getElementById('input_PDF15_LARGER_FUNCTION_EFFECT').focus();
}

// PDF15_ENTERTAINMENT_DETAIL
var input_PDF15_ENTERTAINMENT_DETAIL;
input_PDF15_ENTERTAINMENT_DETAIL = function() {
	tabbing = false;
} 
var input_PDF15_ENTERTAINMENT_DETAIL_error; 
input_PDF15_ENTERTAINMENT_DETAIL_error = function() {
	document.getElementById('input_PDF15_ENTERTAINMENT_DETAIL').focus();
}

// PDF15_RIDES_DETAIL
var input_PDF15_RIDES_DETAIL;
input_PDF15_RIDES_DETAIL = function() {
	tabbing = false;
} 
var input_PDF15_RIDES_DETAIL_error; 
input_PDF15_RIDES_DETAIL_error = function() {
	document.getElementById('input_PDF15_RIDES_DETAIL').focus();
}

var select_PDF15_WATER_HAZARD;
select_PDF15_WATER_HAZARD = function() {
	tabbing = false;
} 
var select_PDF15_WATER_HAZARD_error; 
select_PDF15_WATER_HAZARD_error = function() {
	document.getElementById('select_PDF15_WATER_HAZARD').focus();
}

// PDF15_EXHIBITOR_INSURANCE
var input_PDF15_EXHIBITOR_INSURANCE;
input_PDF15_EXHIBITOR_INSURANCE = function() {
	tabbing = false;
} 
var input_PDF15_EXHIBITOR_INSURANCE_error; 
input_PDF15_EXHIBITOR_INSURANCE_error = function() {
	document.getElementById('input_PDF15_EXHIBITOR_INSURANCE').focus();
}

// PDF15_VENDOR_LIST
var input_PDF15_VENDOR_LIST;
input_PDF15_VENDOR_LIST = function() {
	tabbing = false;
} 
var input_PDF15_VENDOR_LIST_error; 
input_PDF15_VENDOR_LIST_error = function() {
	document.getElementById('input_PDF15_VENDOR_LIST').focus();
}

// PDF15_LIQUOR_LIABILITY_CLAIM_INFO
var input_PDF15_LIQUOR_LIABILITY_CLAIM_INFO;
input_PDF15_LIQUOR_LIABILITY_CLAIM_INFO = function() {
	tabbing = false;
} 
var input_PDF15_LIQUOR_LIABILITY_CLAIM_INFOT_error; 
input_PDF15_LIQUOR_LIABILITY_CLAIM_INFO_error = function() {
	document.getElementById('input_PDF15_LIQUOR_LIABILITY_CLAIM_INFO').focus();
}

// PDF15_NAME
var input_PDF15_NAME;
input_PDF15_NAME = function() {
	var name = document.getElementById('input_PDF15_NAME').value;
	// the printed name is empty fill
	if(document.getElementById('input_PDF15_PRINT_NAME').value == '') {
		document.getElementById('input_PDF15_PRINT_NAME').value = name;
	}
	tabbing = false;
}
var input_PDF15_NAME_error;
input_PDF15_NAME_error = function() {
	document.getElementById('input_PDF15_NAME').focus();
}

var select_PDF15_POSITION;
select_PDF15_POSITION = function() {
	tabbing = false;
} 
var select_PDF15_POSITION_error; 
select_PDF15_POSITION_error = function() {
	document.getElementById('select_PDF15_POSITION').focus();
}

// PDF15_PRINT_NAME
var input_PDF15_PRINT_NAME;
input_PDF15_PRINT_NAME = function() {
	tabbing = false;
} 
var input_PDF15_PRINT_NAME_error; 
input_PDF15_PRINT_NAME_error = function() {
	document.getElementById('input_PDF15_PRINT_NAME').focus();
}

function PDF15_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_PDF15_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_PDF15_SIGNATURE').innerHTML ="By checking this box, in lieu of my signature, I approve of this transaction."; 
	}
}

function PDF15_checkbox_with_effect (id) {
	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_PDF15_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"; 
	}
}

function PDF15_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"; 
	}
}