		bw = new checkBrowser();
		
		function checkBrowser(){
			this.ver=navigator.appVersion;
			this.dom= (document.getElementById)? 1 : 0;
			this.ie5=((this.ver.indexOf("MSIE 5") >= 0) && this.dom)? 1 : 0;
			this.ie4=(document.all && !this.dom)? 1 : 0;
			this.ns6=(this.dom && parseInt(this.ver) >= 6)? 1 : 0;
			this.ns5=(this.dom && parseInt(this.ver) >= 5)? 1 : 0;
			this.ns4=(document.layers && !this.dom)? 1 : 0;
			this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5);
			
			this.editBody = function(rootName, code) {
				if (this.dom) {
					ref = document.getElementById(rootName).innerHTML = code;
				} else if (this.ie4) {
					document.all[rootName].innerHTML = code;
				} else if (this.ns4) {
					document.layers[rootName].document.open();
					document.layers[rootName].document.write(code);
					document.layers[rootName].document.close();
				} 
			}
			this.editStyle = function(rootName, style, code) {
				ref = (this.dom)? document.getElementById(rootName).style : this.ie4 ? document.all[rootName].style : this.ns4 ?  document[rootName] : 0; 
				
				ref[style] = code;
			}
			
		}

		
		function setVisible(bool) {
			bw.editStyle("calLayer", "visibility", (bool)? "visible" : "hidden");
		}
		
		function buildTD(contents, attr)	{
			attr = (typeof (attr) == "undefined")? '' : attr;
			return ("<td " + attr + ">" + contents + "</td>");
		}
		
		function calRollover() {
			//window.status = '';
			return true; 
		}
		
		function pickDay(dType, date, monthName) {
			d = new Date(date);
			
			window.calObject[dType].year = d.getFullYear();
			window.calObject[dType].month = d.getMonth() + 1;
			window.calObject[dType].day = d.getDate();
			window.calObject[dType].monthName = monthName;
			
			window.calObject.setField(dType);
			setVisible(false);
			
			return false;
		}

		//event functions
		function CalInfoObject() {
			this.year = null;
			this.month = null;
			this.monthName = "";
			this.day = null;
			this.hours = null;
			this.minutes = null;
		}
	
		calObject = new Object();
		calObject.s = new CalInfoObject();
		calObject.e = new CalInfoObject();
		
		calObject.setField = function(dType) {
			document.calendar[dType].value = this[dType].monthName + " " + this[dType].day + ", " + this[dType].year;
			
			if ((dType == "s") && (document.calendar["e"].value == document.calendar["e"].defaultValue)) {
				with (calObject) {
					this.e.year = this.s.year;
					this.e.month = this.s.month;
					this.e.monthName = this.s.monthName;
					this.e.day = this.s.day;
					this.e.hours = this.s.hours;
					this.e.minutes = this.s.minutes;
				}
				this.setField("e");
			}
		}
		
		function spawnCalSelect(dType) {
			buildCalendar(dType);
		}
