function getMousePos(capEvent) {
	if (document.layers) {
		xPos=capEvent.screenX +30
		yPos=capEvent.screenY +10
	} else if (window.event) {
		xPos=window.event.clientX +30
		yPos=window.event.clientY +10
	} else {
		xPos=0
		yPos=0
	}
}

function openCalWindow(thisPage, strType, CalLocation) {
	document.thisForm.inout.value = strType;

	// Switch to JSP, this is a catch-all for old code.  Should be removed eventually
	if (thisPage=='popcal.html') { thisPage = 'popcal.jsp'; }
																		
	thisPage = thisPage + '?' + new String(document.thisForm.month1.selectedIndex) + ',' + new String(20+document.thisForm.year1[document.thisForm.year1.selectedIndex].value)+ ',' + document.thisForm.day1[document.thisForm.day1.selectedIndex].value

	if ( strType == 'out') {
		thisPage = thisPage + '?' + new String(document.thisForm.month2.selectedIndex) + ',' + new String(20+document.thisForm.year2[document.thisForm.year2.selectedIndex].value)+ ',' + document.thisForm.day2[document.thisForm.day2.selectedIndex].value
	}
	winStats='toolbar=no,location=no,directories=no,menubar=no,'

	//IE/NS
	if (navigator.appName.indexOf("Microsoft")>=0) {winStats+='scrollbars=no,width=200,height=170'}
	else {winStats+='scrollbars=no,width=210,height=170'}

	//IE leftnav area
	if (navigator.appName.indexOf("Microsoft")>=0) {
			if(CalLocation == 'leftNavArea')
				{winStats+=',left=' + (xPos-120) + ',top=' + (yPos)
				 }//IE content area
			else if (CalLocation == 'contentArea')
				{winStats+=',left=' + (xPos-120) + ',top=' + (yPos)
				}
	   } else {
		//Netscape leftnav area
		if(CalLocation == 'leftNavArea')
				{winStats+=',screenX='+ (xPos) + ',screenY=' + (yPos)
				 }//Netscape content area
			else if (CalLocation == 'contentArea')
				{winStats+=',screenX='+ (-150 + xPos) + ',screenY=' + (-230 + yPos)
				}
    }
	floater=window.open(thisPage,"thisForm",winStats)
	if (floater!=null) { if (floater.focus) { floater.focus() } };
}

function initializeDates()
{
	var thisdate = new Date();
	var thismonth = thisdate.getMonth();
	var thisday = thisdate.getDate();
	var thisyear = thisdate.getFullYear();

	document.thisForm.month1.value = thismonth+1;
	document.thisForm.year1.value = thisyear;
	document.thisForm.day1.value = thisday+7;

	document.thisForm.month2.value = thismonth+1
	document.thisForm.year2.value = thisyear;
	document.thisForm.day2.value = thisday+7+1;
}

function doSelectOptions(theValue,theField) {

	var objForm = document.thisForm;
	for (i=0; i< objForm[theField].options.length; i++)
		if (objForm[theField].options[i].value == theValue) {
			objForm[theField].options[i].selected = true;
		}
}