// JavaScript Document
<!--

      function closeWinNew(){
         if (typeof(winNew) == "object" && winNew != null ){
            winNew.close();
         }
      }
      function setDateS(data,nform){
         var a = data.split("/");
         document.forms[nform].monthsS.options[a[1]-1].selected=true;
         document.forms[nform].daysS.options[a[0]-1].selected=true;
         for(var i=0;i< document.forms[nform].yearS.options.length;i++){
            if(document.forms[nform].yearS.options[i].value==a[2]){
               document.forms[nform].yearS.options[i].selected=true;
            }
         }
      }
      function setDateI(data,nform){
         var a = data.split("/");
         document.forms[nform].monthsI.options[a[1]-1].selected=true;
         document.forms[nform].daysI.options[a[0]-1].selected=true;
         for(var i=0;i< document.forms[nform].yearI.options.length;i++){
            if(document.forms[nform].yearI.options[i].value==a[2]){
               document.forms[nform].yearI.options[i].selected=true;
            }
         }
         resetCheckInOut("checkout");
      }

      function openW(frm,nform, ln) {
         var roomID,i;

         if ((window.document.checka.yearI.options[window.document.checka.yearI.selectedIndex].value == "0" ||
            window.document.checka.monthsI.options[window.document.checka.monthsI.selectedIndex].value == "0" ||
            window.document.checka.daysI.options[window.document.checka.daysI.selectedIndex] == "0") && (frm == "end")){
            alert("<?=$errCheckIn?>");
            return false;
         }


         var checkin = new Date();
         checkin.setDate(checkin.getDate()+1);

         var selectedDay = 1;
         if (window.document.checka.daysI.options[window.document.checka.daysI.selectedIndex].value != "0"){
            selectedDay =  window.document.checka.daysI.options[window.document.checka.daysI.selectedIndex].value;
         }
         var selectedMonth = checkin.getMonth()+1;
         if (window.document.checka.monthsI.options[window.document.checka.monthsI.selectedIndex].value != "0"){
            selectedMonth =  window.document.checka.monthsI.options[window.document.checka.monthsI.selectedIndex].value;
         }
         var selectedYear = checkin.getFullYear();
         if (window.document.checka.yearI.options[window.document.checka.yearI.selectedIndex].value != "0"){
            selectedYear =  window.document.checka.yearI.options[window.document.checka.yearI.selectedIndex].value;
         }
         roomID = window.document.checka.typeRoom.value;
         window.open('http://www.akaza.net/obm22/availabilitycalendarsmall.php?frm=' + frm + '&nform=' + nform + '&ln=' + ln + '&id=1&roomid=' + roomID + '&day=' + selectedDay + '&month=' + selectedMonth + '&year=' + selectedYear,'in','scrollbars=yes,status=no,width=400,height=230,top=200,left=550,menubar=no');
         return false;
      }

     function resetCheckInOut(param){
         if ((param == "checkin") || (param == "both")){
            window.document.checka.daysI.options[0].selected = true;
            window.document.checka.monthsI.options[0].selected = true;
            window.document.checka.yearI.options[0].selected = true;
         }
         if ((param == "checkout") || (param == "both")){
            window.document.checka.daysS.options[0].selected = true;
            window.document.checka.monthsS.options[0].selected = true;
            window.document.checka.yearS.options[0].selected = true;
         }
      }

      function verifica() {
         var data1,data2,d,dat1,dat2;
         data1 = new Date();
         data2 = new Date();
         if (typeof(document.forms['checka'].typeRoom) == "undefined"){
            alert("<?= $msg1?>")
            return false;
         }
         if (window.document.checka.yearI.options[window.document.checka.yearI.selectedIndex].value == "0" ||
            window.document.checka.monthsI.options[window.document.checka.monthsI.selectedIndex].value == "0" ||
            window.document.checka.daysI.options[window.document.checka.daysI.selectedIndex] == "0" ||
            window.document.checka.yearS.options[window.document.checka.yearS.selectedIndex] == "0" ||
            window.document.checka.monthsS.options[window.document.checka.monthsS.selectedIndex] == "0" ||
            window.document.checka.daysS.options[window.document.checka.daysS.selectedIndex] == "0")
            {
            alert ("<?= $msg2?>");
            return false;
         }
         d = new Date();
         dc = new Date(d.getFullYear(),d.getMonth(), d.getDate());
         dataC = Date.parse(dc.toUTCString());
         dat1 = new Date(window.document.checka.yearI.options[window.document.checka.yearI.selectedIndex].value, parseInt(window.document.checka.monthsI.options[window.document.checka.monthsI.selectedIndex].value) -1 ,window.document.checka.daysI.options[window.document.checka.daysI.selectedIndex].value);
         dat2 = new Date(window.document.checka.yearS.options[window.document.checka.yearS.selectedIndex].value, parseInt(window.document.checka.monthsS.options[window.document.checka.monthsS.selectedIndex].value) -1 ,window.document.checka.daysS.options[window.document.checka.daysS.selectedIndex].value);
         data1 = Date.parse(dat1.toUTCString());
         data2 = Date.parse(dat2.toUTCString());

         if(dataC > data1){
            alert("<?= $msg3?>");
            return false;
         }
         if (data1 >= data2){
            alert ("<?= $msg4?>");
            return false;
         }
         window.document.checka.yearI.disabled = false;
         window.document.checka.monthsI.disabled = false;
         window.document.checka.daysI.disabled = false;
         window.document.checka.yearS.disabled = false;
         window.document.checka.monthsS.disabled = false;
         window.document.checka.daysS.disabled = false;
         return true;
      }

      function openmappopup(popurl){
         var winpops=window.open(popurl,"","width=800,height=600")
      }

      function showPhoto(photoName){
         window.document.photogallery.IMG1.src = photoName;
         return false;
      }

//-->