         function setArrivalDate(value, type){
                 var currDay = window.document.frmQuickFind.SrchFromDay.value;
                 var currMonth = window.document.frmQuickFind.SrchFromMonth.value;
                 var currYear = window.document.frmQuickFind.SrchFromYear.value;

                 if(currDay.length==1){
                         currDay = '0'+currDay;
                 }
                 if(currMonth.length==1){
                         currMonth = '0'+currMonth;
                 }
                 if((type==1 || type==2) && value.length==1){
                         value = '0'+value;
                 }

                 if(type==0) { //called if date does not change or on automatic date reset
                         currDateString = new String(currYear+''+currMonth+''+currDay);
                         window.document.frmQuickFind.pkgArrivalDate.value = currDateString;
                 }
                 else{
                         if(type==1) { //day to change
                                 currDateString = new String(currYear+''+currMonth+''+value);
                         }
                         if(type==2) { //month to change
                                 currDateString = new String(currYear+''+value+''+currDay);
                         }
                         if(type==3) { //year to change
                                 currDateString = new String(value+''+currMonth+''+currDay);
                         }
                 }
         } //setArrivalDate


                                 /*Function to check whether the search date is in the past*/
         function checkSearchDate(searchDate) {
                  var currDate = new Date();
                  if(searchDate.getYear() < currDate.getYear()){
                         alert("Das Jahr liegt in der Vergangenheit. Bitte nehmen Sie eine Korrektur vor!");
                         return false;
                  }
                  if(searchDate.getYear() == currDate.getYear() && searchDate.getMonth() < currDate.getMonth()){
                         alert("Der Monat liegt in der Vergangenheit. Bitte nehmen Sie eine Korrektur vor!");
                         return false;
                  }
                  if(searchDate.getYear() == currDate.getYear() && searchDate.getMonth() == currDate.getMonth() &&
                         searchDate.getDate() < currDate.getDate()){
                         alert("Der Tag liegt in der Vergangenheit. Bitte nehmen Sie eine Korrektur vor!");
                         return false;
                  }
                  return true;
         } //checkSearchDate

         /*Helper function to check the query string passed to the system*/
         function displayQueryString(form){
                 var sfDay = form.SrchFromDay.value;
                 var sfMonth = form.SrchFromMonth.value;
                 var sfYear = form.SrchFromYear.value;
                 var pkgToleranceDays = form.pkgToleranceDays.value;
                 var pkgArrivalDate = form.pkgArrivalDate.value;
                 var pkgHolidayThemes = form.pkgHolidayThemes.value;
                 var baseUrl = form.action;
                 var url = baseUrl+'?'+'pkgArrivalDate='+pkgArrivalDate+
                         '&SrchFromDay='+sfDay+'&SrchFromMonth='+sfMonth+'&SrchFromYear='+sfYear+
                       '&pkgToleranceDays='+pkgToleranceDays+'&pkgHolidayThemes='+pkgHolidayThemes;
                 alert(url);
         } //displayQueryString

