<!--
// Quick way to test for Nav4 and IE4
version4 = false
if(navigator.appVersion.charAt(0) == "4") version4 = true
function displayPopup(url,name,height,width,evnt) {
 var properties = "toolbar=0,location=0,height="+height
 properties = properties+",width="+width
 if(evnt != null) {
  if(navigator.appName == "Microsoft Internet Explorer") {
   properties = properties+",left="+(evnt.screenX + 15)
   properties = properties+",top="+(evnt.screenY - 100)
  }else { // Navigator coordinates must be adjusted for scrolling
   properties = properties+",left="+(evnt.screenX - pageXOffset + 10)
   properties = properties+",top="+(evnt.screenY - pageYOffset + 10)
  }
 }
 popupHandle = open(url,name,properties)
}
function closePopup() {
 // mouseOut was introduced with JavaScript 1.1, so Navigator 2 users will
 // have to manually close the window
 if(popupHandle != null && !popupHandle.closed) popupHandle.close()
}


// Test Function
function displayPopupHT(url,name,height,width,evnt) {
 var properties = "toolbar=0,location=0,height="+height
 properties = properties+",width="+width
 if(evnt != null) {
  if(navigator.appName == "Microsoft Internet Explorer") {
   properties = properties+",left="+(evnt.screenX + 15)
   properties = properties+",top="+(evnt.screenY - 100)
  }else { // Navigator coordinates must be adjusted for scrolling
   properties = properties+",left="+(evnt.screenX - pageXOffset + 10)
   properties = properties+",top="+(evnt.screenY - pageYOffset + 10)
  }
 }
 if (window.popupHandle !=null && !window.popupHandle.closed){
 popupHandle.close();
 }
 popupHandle = open(url,name,properties)
}

function dateval(date){		
date = date.toUpperCase();
if (date == "JAN"){return 01;}else if (date == "FEB"){return 02;}else if (date == "MAR"){return 03;}else if (date == "APR"){return 04;}
else if (date == "MAY"){return 05;}	else if (date == "JUN"){return 06;}else if (date == "JUL"){return 07;}else if (date == "AUG"){return 08;}
else if (date == "SEP"){return 09;}	else if (date == "OCT"){return 10;}else if (date == "NOV"){return 11;}else if (date == "DEC"){return 12;}}

function dateaction(fn,m,d,y,sd,sm,sy,i){
		//alert(fn + '/' + m + '/' + d + '/' + y + '/' + sd + '/' + sm + '/' + sy + '/' + i);
		//return false;
		if (i != "0" && sd != ""){
			var newone = dateval(m);
			displayPopupHT('inc/php/calendar.php?form=' + fn + '&m=' + m + '&d=' + d + '&y=' + y + '&i=' + i + '&sd=' + sd + '&sm=' + newone + '&sy=' + sy , 'popWin', 250, 215,(version4 ? event : null)) 
		}
		else if (i != "0"){
			displayPopupHT('inc/php/calendar.php?form=' + fn + '&m=' + m + '&d=' + d + '&y=' + y + '&i=' + i, 'popWin', 250, 215,(version4 ? event : null)) 
		}
		else if (sd != ""){ 
			var newone = dateval(sm);
			displayPopupHT('inc/php/calendar.php?form=' + fn + '&m=' + m + '&d=' + d + '&y=' + y + '&sd=' + sd + '&sm=' + newone + '&sy=' + sy , 'popWin', 250, 215,(version4 ? event : null)) 
		} 
		else {
			displayPopupHT('inc/php/calendar.php?form=' + fn + '&m=' + m + '&d=' + d + '&y=' + y , 'popWin', 250, 215,(version4 ? event : null))
		}
		
}
