function openWindow(url, name) {
  popupWin = window.open(url, name, 'menubar,scrollbars,resizable,width=325,height=460,left=0,top=0')
}

function checklocs() {
	if	(document.carform.pulocinfo & document.carform.dolocinfo) {
		if (typeof(document.carform.pulocinfo.length) == "undefined") document.carform.pulocinfo.click(); // length attributed doesn't work if only 1 item in radio group
		if (typeof(document.carform.dolocinfo.length) == "undefined") document.carform.dolocinfo.click();
	}
}

function check(field) {
	field[0].checked = false;
		}
function checkall(field) {
	if (field[0].checked == true) {
		for (i = 1; i < field.length; i++){
			field[i].checked = true;
			}
		}
	else {
		for (i = 1; i < field.length; i++){
			field[i].checked = false;
			}
		}

	}
function defaultDate()
{
	todayDate = new Date();
	twoDate = new Date(todayDate.getTime()+2*24*60*60*1000);
	twoMonth = twoDate.getMonth();
	twoDay = twoDate.getDate();
	twoYear = twoDate.getYear();
	weekDay = (parseInt(twoDay) + 7);
	weekYear = twoYear;
	leapCheck = twoYear/4;
	var daysInMonth = new Array(12);
	daysInMonth[0] = 31;
	daysInMonth[1] = 28; 
	daysInMonth[2] = 31; 
	daysInMonth[3] = 30; 
	daysInMonth[4] = 31; 
	daysInMonth[5] = 30; 
	daysInMonth[6] = 31; 
	daysInMonth[7] = 31; 
	daysInMonth[8] = 30; 
	daysInMonth[9] = 31; 
	daysInMonth[10] = 30; 
	daysInMonth[11] = 31;
	if (leapCheck == parseInt(leapCheck))
		daysInMonth[1] = 29;

	if (weekDay > daysInMonth[(twoMonth)]) 
	{
		weekMonth = (twoMonth + 1);
		if (weekMonth == 12) 
		{
			weekMonth = 0; weekYear = twoYear + 1;
		}// catch december/january switch
		
		weekDay = (weekDay - daysInMonth[(twoMonth)]);
	}
	else 
	{	
		weekMonth = twoMonth;
	}

	twoDay = twoDay - 1;// subtract 1 to match index values
	weekDay = weekDay - 1;
	weekYear = weekYear - twoYear; // make sure year rollover is caught before modifying today year
	twoYear = twoYear - twoYear; 
	document.carform.puday.options[twoDay].selected=true;// adjust form values
	document.carform.pumonth.options[twoMonth].selected=true;
	document.carform.puyear.options[twoYear].selected=true;
	document.carform.doday.options[weekDay].selected=true;
	document.carform.domonth.options[weekMonth].selected=true;
	document.carform.doyear.options[weekYear].selected=true;
}