/* 	*****************************************************************************************************	DHTML Calendar		*****************************************************************************************************	Changed 4/1/2004 		allow for compatibility with Netscape fromName variable added	Changed May 2005 		eliminate form tag causing document.form[0] errors with other Javascript used		graphic references (up.gif and down.gif) changed to avoid problems		table formatting added classes to avoid style conflicts	Changed April 2007		added th getpath function so variations of DbPath field can be used	Changed April 27, 2007		Moved the getPath function so variations of DbPath could be used.  		Fixed typo in Left arrow (calendardown.gif) src path	Changed NOV 2007		Added code to handle Select boxes Show/Hide	Changed May 2008			Added line in calendarTimeout to prevent error onMouseout if calendar object not yet created	Changed July 2008		Changed parameters in calendarShow and g_Calendar.show to include dateFrom and dateTo which had been in previous versions	Changed October 2008 		Added functions to change set array of months, abbreviated month names and week days to deal with foreign language browser choice			Computed text added to the subform to capture the language*/	var calendarHasBeenCreated = false;	var a_oSelectBoxes;	var oExistingValues = new Array();	var timeoutDelay = 2000; // milliseconds, change this if you like, set to 0 for the calendar to never auto disappear	//var timeoutDelay = 0; // milliseconds, change this if you like, set to 0 for the calendar to never auto disappear	var g_startDay = 0// 0=sunday, 1=monday	// preload images		var imgUp = new Image(8,12);			var imgDown = new Image(8,12);		var imgUpsrc ;		var imgDownsrc ;	// used by timeout auto hide functions	var timeoutId = false;		// the now standard browser sniffer class	function Browser(){	  this.dom = document.getElementById?1:0;	  this.ie4 = (document.all && !this.dom)?1:0;	  this.ns4 = (document.layers && !this.dom)?1:0;	  this.ns6 = (this.dom && !document.all)?1:0;	  this.ie5 = (this.dom && document.all)?1:0;	  this.ok = this.dom || this.ie4 || this.ns4;	  this.platform = navigator.platform;	}	var browser = new Browser();	// dom browsers require this written to the HEAD section		if (browser.dom || browser.ie4){	    document.writeln('<style>');		document.writeln('#container {');		document.writeln('z-index : 2147480000;');		document.writeln('position : absolute;');		document.writeln('left : 100px;');		document.writeln('top : 100px;');		document.writeln('width : 124px;');;		browser.platform=='Win32'?height=140:height=145;		document.writeln('height : ' + height +'px;');		document.writeln('clip:rect(0px 200px ' + height + 'px 0px);');		document.writeln('visibility : hidden;');		document.writeln('background-color : #C0C0C0');		document.writeln('}');		document.writeln('</style>')		document.write('<div id="container"');		if (timeoutDelay) document.write(' onmouseout="calendarTimeout();" onmouseover="if (timeoutId) clearTimeout(timeoutId);"');		document.write('></div>');	}	var g_Calendar;  // global to hold the calendar reference, set by constructor		function calendarTimeout(){		if (g_Calendar) {	  		if (browser.ie4 || browser.ie5){	    			if (window.event.srcElement && window.event.srcElement.name!='month') timeoutId=setTimeout('g_Calendar.hide();',timeoutDelay);	  		}	  	if (browser.ns6 || browser.ns4){	    		timeoutId=setTimeout('g_Calendar.hide();',timeoutDelay);	  	}	  }	}	//reset array of months, abbreviate month names and day abbreviation constants if language detected other than Englishfunction transMonths(lang) {		lang = lang.toLowerCase()		switch (lang) {			case "dutch": trMonths = new Array("Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"); break;			case "french": trMonths = new Array("Janvier","F\u00E9vrier","Mars","Avril","Mai","Juin","Juillet","Ao\u00FBt","Septembre","Octobre","Novembre","D\u00E9cembre");break;			case "german": trMonths = new Array("Januar","Februar","M\u00E4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember");break;			case "italian" :trMonths = new Array("Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre");break;			case "portuguese": trMonths = new Array("Janeiro","Fevereiro","Mar\u00E7o"," Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro");break;			case "spanish": trMonths = new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");break;			case "swedish": trMonths = new Array("Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December");break;			default: trMonths = new Array("January","February","March","April","May","June","July","August","September","October","November","December");		}			return trMonths	}	function transMonAbbr(lang) {		lang = lang.toLowerCase()		switch (lang) {			case "dutch": trMAbbr = new Array("Jan","Feb","Mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"); break;			case "french": trMAbbr = new Array("janv.","f\u00E9vr.","mars","avr.","mai","juin","juil.","ao\u00FBt","sept.","oct.","nov.","d\u00E9c.");break;			case "german": trMAbbr = new Array("Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez");break;			case "italian" : trMAbbr = new Array("Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic");break;			case "portuguese": trMAbbr = new Array("Jan","Fev","Mar"," Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez");break;			case "spanish": trMAbbr = new Array("Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic");break;				case "swedish": trMAbbr = new Array("Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec");break;			default: trMAbbr = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");		}			return trMAbbr	}	function transDays(lang) {		lang = lang.toLowerCase()		switch (lang) {			case "french": trDays = new Array("D","L","M","M","J","V","S");break;			case "spanish": trDays = new Array("D","L","M","M","J","V","S");break;			default: trDays = new Array("Su","Mo","Tu","We","Th","Fr","Sa");		}			return trDays	}				// constructor for calendar class	function Calendar(){	  g_Calendar = this;		  	  // some constants needed throughout the program	    this.daysInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);	    //If language detected, translate month and abbreviated month arrays; otherwise use English	    if (document.getElementById("ccBrowserLang")) {			var lang = document.getElementById("ccBrowserLang").innerHTML.split(",")[0]			this.months = transMonths(lang);			this.abbrMonths = transMonAbbr(lang);			this.daysOfWeek = transDays(lang);		} else {			this.months = new Array("January","February","March","April","May","June","July","August","September","October","November","December");			this.abbrMonths = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");			this.daysOfWeek = new Array("Su","Mo","Tu","We","Th","Fr","Sa");		}		  if (browser.ns4){	    var tmpLayer = new Layer(127);		if (timeoutDelay){		  tmpLayer.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT);		  tmpLayer.onmouseover = function(event) { if (timeoutId) clearTimeout(timeoutId); };		  tmpLayer.onmouseout = function(event) { timeoutId=setTimeout('g_Calendar.hide()',timeoutDelay);};		}	    tmpLayer.x = 100;	    tmpLayer.y = 100;	    tmpLayer.bgColor = "#ffffff";	  }	  if (browser.dom || browser.ie4){		var tmpLayer = browser.dom?document.getElementById('container'):document.all.container;	  }	  this.containerLayer = tmpLayer;	  if (browser.ns4 && browser.platform=='Win32') {	    this.containerLayer.clip.height=134;	    this.containerLayer.clip.width=127;	  }	}	 	Calendar.prototype.getFirstDOM = function() {		var thedate = new Date();		thedate.setDate(1);		thedate.setMonth(this.month);		thedate.setFullYear(this.year);		return thedate.getDay();	}	Calendar.prototype.getDaysInMonth = function (){	   if (this.month!=1) {	   return this.daysInMonth[this.month]	   }	   else {	     // is it a leap year		    if (Date.isLeapYear(this.year)) {			  return 29;			}		    else {			  return 28;			}	   }	}	 	Calendar.prototype.buildString = function(){		// used to find db path		var curdbname=getpath();			//var imgUpsrc =  "/"+ document.forms[0].DBPath.value + "/CalendarUp.gif";		var imgUpsrc = "/" + curdbname + "/CalendarUp.gif";		//var imgDownsrc = "/"+document.forms[0].DBPath.value + "/CalendarDown.gif";		var imgDownsrc = "/" + curdbname + "/CalendarDown.gif";	  var tmpStr = ""	//  tmpStr += '<form onSubmit="this.year.blur();return false;">'	  tmpStr += '<table width="100%" border="0" cellspacing="0" cellpadding="2" class="calBorderColor"><tr><td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="1" class="calBgColor">';	  tmpStr += '<tr>';	  tmpStr += '<td width="60%" class="cal" align="left">';	  if (this.hasDropDown) {	    tmpStr += '<select class="month" name="month" onchange="g_Calendar.selectChange();">';		for (var i=0;i<this.months.length;i++){	      tmpStr += '<option value="' + i + '"' 		  if (i == this.month) tmpStr += ' selected';		  tmpStr += '>' + this.months[i] + '</option>';	    }	    tmpStr += '</select>';	  } else {	    tmpStr += '<table border="0" cellspacing="0" cellpadding="0" class="calBgColor"><tr><td><a href="javascript: g_Calendar.changeMonth(-1);"><img name="calendar" src="'+imgDownsrc+'" width="8" height="12" border="0" alt=""></a></td><td class="cal" width="100%" align="center">' + this.months[this.month] + '</td><td class="cal"><a href="javascript: g_Calendar.changeMonth(+1);"><img name="calendar" src="'+imgUpsrc+'" width="8" height="12" border="0" alt=""></a></td></tr></table>';	  }	  tmpStr += '</td>';	  /* observation : for some reason if the below event is changed to 'onChange' rather than 'onBlur' it  crashes IE (4 and 5)!	  */	  tmpStr += '<td width="40%" align="right" class="cal">';	  	  if (this.hasDropDown) { 	    tmpStr += '<input class="year" type="text" size="';	    // get round NS4 win32 lenght of year input problem	    (browser.ns4 && browser.platform=='Win32')?tmpStr += 1:tmpStr += 4;	  tmpStr += '" name="year" maxlength="4" onBlur="g_Calendar.inputChange();" onKeyPress="checkForSubmit();" value="' + this.year + '">';	  } else {	  tmpStr += '<table border="0" cellspacing="0" cellpadding="0" class="calBgColor"><tr><td class="cal"><a href="javascript: g_Calendar.changeYear(-1);"><img name="calendar" src="'+imgDownsrc+'" width="8" height="12" border="0" alt=""></a></td><td class="cal" width="100%" align="center">' + this.year + '</td><td class="cal"><a href="javascript: g_Calendar.changeYear(+1);"><img name="calendar" src="'+imgUpsrc+'" width="8" height="12" border="0" alt=""></a></td></tr></table>'	  }	  tmpStr += '</td>';	  tmpStr += '</tr>';	  tmpStr += '</table>';	  var iCount = 1;	  var iFirstDOM = (7+this.getFirstDOM()-g_startDay)%7; // to prevent calling it in a loop	  var iDaysInMonth = this.getDaysInMonth(); // to prevent calling it in a loop	  	  tmpStr += '<table width="100%" border="0" cellspacing="0" cellpadding="1" class="calBgColor">';	  tmpStr += '<tr>';	    for (var i=0;i<7;i++){		  tmpStr += '<td align="center" class="calDaysColor">' + this.daysOfWeek[(g_startDay+i)%7] + '</td>';		}	  tmpStr += '</tr>';	  var tmpFrom = parseInt('' + this.dateFromYear + this.dateFromMonth + this.dateFromDay,10);	  var tmpTo = parseInt('' + this.dateToYear + this.dateToMonth + this.dateToDay,10);	  var tmpCompare;	  for (var j=1;j<=6;j++){	     tmpStr += '<tr>';	     for (var i=1;i<=7;i++){		   tmpStr += '<td width="16" align="center" '		   if ( (7*(j-1) + i)>=iFirstDOM+1  && iCount <= iDaysInMonth){		     if (iCount==this.day && this.year==this.oYear && this.month==this.oMonth) tmpStr += 'class="calHighlightColor"';			 else {			    if (i==7-g_startDay || i==((7-g_startDay)%7)+1) tmpStr += 'class="calWeekend"';				else tmpStr += 'class="cal"';			 }		     tmpStr += '>';			 /* could create a date object here and compare that but probably more efficient to convert to a number			   and compare number as numbers are primitives */			 tmpCompare = parseInt('' + this.year + padZero(this.month) + padZero(iCount),10);			 if (tmpCompare >= tmpFrom && tmpCompare <= tmpTo) {			   tmpStr += '<a class="cal" href="javascript: g_Calendar.clickDay(' + iCount + ');">' + iCount + '</a>';			 			 } else {			   tmpStr += '<span class="disabled">' + iCount + '</span>';			 }			 iCount++;		   } else {		     if  (i==7-g_startDay || i==((7-g_startDay)%7)+1) tmpStr += 'class="calWeekend"'; else tmpStr +='class="cal"';			 tmpStr += '>&nbsp;';		   }		   tmpStr += '</td>'		 }		 tmpStr += '</tr>'	  }	  tmpStr += '</table></td></tr></table>'	//  tmpStr += '</form>'	  return tmpStr;	}		Calendar.prototype.selectChange = function(){	  this.month = browser.ns6?this.containerLayer.ownerDocument.forms[0].month.selectedIndex:this.containerLayer.document.all.month.selectedIndex;	  this.writeString(this.buildString());	}		Calendar.prototype.inputChange = function(){	  var tmp = browser.ns6?this.containerLayer.ownerDocument.forms[0].year:this.containerLayer.document.all.year;	  if (tmp.value >=1900 || tmp.value <=2100){	    this.year = tmp.value;	    this.writeString(this.buildString());	  } else {	    tmp.value = this.year;	  }	}	Calendar.prototype.changeYear = function(incr){	   (incr==1)?this.year++:this.year--;	   this.writeString(this.buildString());	}	Calendar.prototype.changeMonth = function(incr){	    if (this.month==11 && incr==1){	      this.month = 0;	  	  this.year++;	    } else {	      if (this.month==0 && incr==-1){	        this.month = 11;		    this.year--;	      } else {		    (incr==1)?this.month++:this.month--;		  }		}		this.writeString(this.buildString());	}		Calendar.prototype.clickDay = function(day){	  	var oTarget = document.getElementById(new String(this.target));	  	sDateToSet = this.formatDateAsString(day,this.month,this.year);	  	// Check to see if the custom validation function exists on the document.	  	if (typeof calendarCustomValidate == 'function')	  	{			// Fire the custom validation function, passing the proposed Field and the proposed Value.			validateDate = calendarCustomValidate(this.target, sDateToSet);					}		else		{			validateDate = "";		}		if (validateDate != "")		{			alert (validateDate);		}		else		{	 		var tmp = oTarget;	 		tmp.value= sDateToSet;	 	}	 	// hide the calendar control	 	if (browser.ns4) this.containerLayer.hidden=true;		    if (browser.dom || browser.ie4){	  		      this.containerLayer.style.visibility='hidden';		    }		   // Reshow any select boxes	the developer specified they wanted hidden. 	    for (ix = 0; ix < oExistingValues.length; ix++)		{			if (oExistingValues[ix].originalObject!=null)			{				oExistingValues[ix].originalObject.style.visibility = oExistingValues[ix].originalVisibility;			}		}	}	Calendar.prototype.formatDateAsString = function(day, month, year){	var sDelim = new String(this.dateDelim)	 var delim = eval('/\\' + sDelim + '/g');	 switch (this.dateFormat.replace(delim,"")){	     case 'ddmmmyyyy': return padZero(day) + this.dateDelim + this.abbrMonths[month] + this.dateDelim + year;  //20 OCT 2008 translation of month		case 'ddmmyyyy': return padZero(day) + this.dateDelim + padZero(month+1) + this.dateDelim + year;		case 'mmddyyyy': return padZero((month+1)) + this.dateDelim + padZero(day) + this.dateDelim + year;	     case 'yyyymmdd': return year + this.dateDelim + padZero(month+1) + this.dateDelim + padZero(day);		 default: alert('unsupported date format');	   }	}		Calendar.prototype.writeString = function(str){	  if (browser.ns4){	    this.containerLayer.document.open();	    this.containerLayer.document.write(str);	    this.containerLayer.document.close();	  } 	  if (browser.dom || browser.ie4){	    this.containerLayer.innerHTML = str;	  }	}		Calendar.prototype.show = function(event, target, bHasDropDown, dateFormat, dateFrom, dateTo){// calendar can restrict choices between 2 dates, if however no restrictions	// are made, let them choose any date between 1900 and 3000		this.dateFrom = dateFrom || new Date(1900,0,1);	this.dateFromDay = padZero(this.dateFrom.getDate());	this.dateFromMonth = padZero(this.dateFrom.getMonth());	this.dateFromYear = this.dateFrom.getFullYear();	this.dateTo = dateTo || new Date(3000,0,1);	this.dateToDay = padZero(this.dateTo.getDate());	this.dateToMonth = padZero(this.dateTo.getMonth());	this.dateToYear = this.dateTo.getFullYear();	this.hasDropDown = bHasDropDown;	this.dateFormat = dateFormat || 'dd-mmm-yyyy';	switch (this.dateFormat){	  case 'dd-mmm-yyyy':	  case 'dd-mm-yyyy':	  case 'yyyy-mm-dd':	    this.dateDelim = '-';		break;	  case 'dd/mm/yyyy':	  case 'mm/dd/yyyy':	  case 'dd/mmm/yyyy':	    this.dateDelim = '/';		break;	}		  if (browser.ns4) {	    if (!this.containerLayer.hidden) {		  this.containerLayer.hidden=true;		  return;		}	   }	  if (browser.dom || browser.ie4){	    if (this.containerLayer.style.visibility=='visible') {		  this.containerLayer.style.visibility='hidden';		  return;		}  	  }	  if (browser.ie5 || browser.ie4){	    var event = window.event;	  }	  if (browser.ns4){	    this.containerLayer.x = event.x+10;	    this.containerLayer.y = event.y-5;	  }	  if (browser.ie5 || browser.ie4){	    var obj = event.srcElement; 	    x = 0;  		while (obj.offsetParent != null) {    		  x += obj.offsetLeft;    		   obj = obj.offsetParent;  		}  		x += obj.offsetLeft;	    y = 0;		var obj = event.srcElement;	    while (obj.offsetParent != null) {    		//  y += obj.offsetTop;           Changed 09 OCT 2007 due to SetDIV properties.               		 y += obj.offsetTop-obj.scrollTop;    		  obj = obj.offsetParent;  		}  		y += obj.offsetTop;		        this.containerLayer.style.left = x+35;		if (event.y>0)this.containerLayer.style.top = y;	  }	  if (browser.ns6){	    this.containerLayer.style.left = event.pageX+10;		this.containerLayer.style.top = event.pageY-5;	  }	  	this.target = target;	  var oTarget = document.getElementById(new String(this.target));	  var tmp = oTarget;	  if (tmp && tmp.value && tmp.value.split(this.dateDelim).length==3 && tmp.value.indexOf('d')==-1){    	  //Removing period added in some languages if month is abbreviated 20 OCT 2008//	  var re = /\.///	  tmp.value=tmp.value.replace(re,"")		var atmp = tmp.value.split(this.dateDelim)		switch (this.dateFormat){		 case 'dd-mmm-yyyy':		 case 'dd/mmm/yyyy':		   for (var i=0;i<this.months.length;i++){		     if (atmp[1].toLowerCase()==this.abbrMonths[i].toLowerCase()){      //Using translated array		       this.month = this.oMonth = i;			   break;		     }		   }		   this.day = parseInt(atmp[0],10);		   this.year = this.oYear = parseInt(atmp[2],10);		   break;		 case 'dd/mm/yyyy':		 case 'dd-mm-yyyy':		   this.month = this.oMonth = parseInt(atmp[1]-1,10); 		   this.day = parseInt(atmp[0],10);		   this.year = this.oYear = parseInt(atmp[2],10);		   break;		 case 'mm/dd/yyyy':		 case 'mm-dd-yyyy':		   this.month = this.oMonth = parseInt(atmp[0]-1,10);		   this.day = parseInt(atmp[1],10);		   this.year = this.oYear = parseInt(atmp[2],10);		   break;		 case 'yyyy-mm-dd':		   this.month = this.oMonth = parseInt(atmp[1]-1,10);		   this.day = parseInt(atmp[2],10);		   this.year = this.oYear = parseInt(atmp[0],10);		   break;		}	  } else { // no date set, default to either the field's current date or today's date	  oTarget = document.getElementById(new String(this.target));	 	var curDateSet=oTarget;	  if (curDateSet.value==""){	  		   	var theDate = new Date();}	   	else{	   		   		  	var theDate = new Date(curDateSet.value);}	  	this.year = this.oYear = theDate.getFullYear();	     this.month = this.oMonth = theDate.getMonth();	     this.day = this.oDay = theDate.getDate();	  }	  this.writeString(this.buildString());	  	  // and then show the full calendar control.	   if (browser.ns4) {	   this.containerLayer.hidden=false;	   }	  if (browser.dom || browser.ie4){	      this.containerLayer.style.visibility='visible';	  }	}		Calendar.prototype.hide = function(){	  if (browser.ns4) this.containerLayer.hidden = true;	  if (browser.dom || browser.ie4){	    this.containerLayer.style.visibility='hidden';	  }	    // Reshow any select boxes	the developer specified they wanted hidden. 	    for (ix = 0; ix < oExistingValues.length; ix++)		{			if (oExistingValues[ix].originalObject!=null)			{				oExistingValues[ix].originalObject.style.visibility = oExistingValues[ix].originalVisibility;			}		}	}	function handleDocumentClick(e){	  if (browser.ie4 || browser.ie5) e = window.event;	  if (browser.ns6){	    var bTest = (e.pageX > parseInt(g_Calendar.containerLayer.style.left,10) && e.pageX <  (parseInt(g_Calendar.containerLayer.style.left,10)+125) && e.pageY < (parseInt(g_Calendar.containerLayer.style.top,10)+125) && e.pageY > parseInt(g_Calendar.containerLayer.style.top,10));	    if (e.target.name!='imgCalendar' && e.target.name!='month'  && e.target.name!='year' && e.target.name!='calendar' && !bTest){		  g_Calendar.hide(); 		}	  }	  if (browser.ie4 || browser.ie5){		// extra test to see if user clicked inside the calendar but not on a valid date, we don't want it to disappear in this case	   var bTest = (e.x > parseInt(g_Calendar.containerLayer.style.left,10) && e.x <  (parseInt(g_Calendar.containerLayer.style.left,10)+125) && e.y < (parseInt(g_Calendar.containerLayer.style.top,10)+125) && e.y > parseInt(g_Calendar.containerLayer.style.top,10));	    if (e.srcElement.name!='imgCalendar' && e.srcElement.name!='month' && e.srcElement.name!='year' && !bTest & typeof(e.srcElement)!='object'){		  g_Calendar.hide(); 		}	  }	  if (browser.ns4) g_Calendar.hide();	}		// utility function	function padZero(num) {	return ((num <= 9) ? ("0" + num) : num);	}	  // Finally extended the native date object;	  Date.isLeapYear = function(year){ if (year%4==0 && ((year%100!=0) || (year%400==0))) return true; else return false; }	  Date.daysInYear = function(year){ if (Date.isLeapYear(year)) return 366; else return 365;}	  var DAY = 1000*60*60*24;	  Date.prototype.addDays = function(num){		return new Date((num*DAY)+this.valueOf());	  }			 function createTheCalendar() {	new Calendar(new Date());	  if (browser.ns4){	    if (typeof document.NSfix == 'undefined'){		  document.NSfix = new Object();	      document.NSfix.initWidth=window.innerWidth;		  document.NSfix.initHeight=window.innerHeight;		}	  }	  calendarHasBeenCreated = true;	}  	if (browser.ns4) window.onresize = function(){	  if (document.NSfix.initWidth!=window.innerWidth || document.NSfix.initHeight!=window.innerHeight) window.location.reload(false);	} // ns4 resize bug workaround	//window.document.onclick=handleDocumentClick;   ///////////////////////////////////function getpath(){	var mydbarray=new Array();	mydbarray[0]="DbPath";	mydbarray[1]="pathName";	mydbarray[2]="dbName";	mydbarray[3]="PathName";	mydbarray[4]="pathname";	mydbarray[5]="DbName";	mydbarray[6]="Pathname";	mydbarray[7]="Dbpath";	mydbarray[8]="dbPath";	mydbarray[9]="Dbname";	mydbarray[10]="DBPath";	var objdbpath;	objdbpath=null;	var i=0;	while (!objdbpath && i<mydbarray.length)	{		objdbpath=document.getElementById(mydbarray[i]);		i++	}	if (!objdbpath)	{			i=0;			while (!objdbpath && i<mydbarray.length)			{				objdbpath=document.getElementsByName(mydbarray[i])[0];				i++			}			if (!objdbpath)			{				return false			}			else			{					return objdbpath.value;			}	}	else	{		return objdbpath.value;	}}// Added for new functionality 01/17/2008//Adjusted parametes to include dateFrom and dateTo that were in previous versionfunction calendarShow(event, dateField, boolMonthYearDisplay, strDateFormat, dateFrom, dateTo, a_objObjectsToHide){	if (calendarHasBeenCreated != true)	{		//Create/Initialize the calendar		createTheCalendar();	}	//clicking this button displays a calendar the user can click on to select a date.	g_Calendar.show(event,dateField,boolMonthYearDisplay, strDateFormat,dateFrom, dateTo)    // Reset the Existing Values Array. 	    	    	for (ix = 0; ix < oExistingValues.length; ix++)		{			if (oExistingValues[ix].originalObject!=null)			{				oExistingValues[ix].originalObject.style.visibility = oExistingValues[ix].originalVisibility;			}		}			// Reset the Existing Values array	oExistingValues = new Array();	// Now hide the required select boxes. 	for (x = 0; x < a_objObjectsToHide.length; x++)	{		oExistingValues[x] = new oCalendarHiddenValue(a_objObjectsToHide[x], a_objObjectsToHide[x].style.visibility);		// There is one version of the calendar control that uses a MONTH select box.		// This code ensures that we do not inadvertly hide that dropdown as we show the calendar.		if (a_objObjectsToHide[x].name != "month"){			a_objObjectsToHide[x].style.visibility="hidden"		}	}	return false;}function oCalendarHiddenValue(objOriginal, sVisibilityProperty){	this.originalObject = objOriginal;	this.originalVisibility = sVisibilityProperty;}function checkForSubmit() //Added June 2009 BDL (used in the onKeyPress event of the year field){if (event.keyCode==13) g_Calendar.inputChange();}