////// Inquiry.aspx functions


           function checkDate(sender, args) {
               if (sender._selectedDate < new Date()) {
                   sender._selectedDate = new Date();
                   sender._textbox.set_Value(sender._selectedDate.localeFormat(sender._format))
               }
           }

           function ValidateDate(sender, dateStr) {
               var selDate = Date.parseLocale(dateStr, sender._format);
               if (selDate == null) {
                   checkDate(sender, null);
               } else {
                  sender._selectedDate = selDate;
                  checkDate(sender, null);
              }
          }

          function getCalendarTo() {
              return Sys.Application.findComponent("edTo_CalendarExtender");
          }
          function getCalendarFrom() {
              return Sys.Application.findComponent("edFrom_CalendarExtender");
          }
          

           function ValidateFromDate(validateOnly) {
               ValidateDate(getCalendarFrom(), document.getElementById("edFrom").value);
               CompareDates();
               if (!validateOnly) {
                   setDaysCombo();
               }
               PageMethods.getTickerByDate(document.getElementById("edFrom").value, onTickerSearchComplete);
           }

           function onTickerSearchComplete(results) {
               var fill = document.getElementById("myhtmlticker");
               fill.innerHTML = results;
               richhtmlticker.defineDefaults();
           }
 
           function addDays(myDate, days) {
               return new Date(myDate.getTime() + days * 24 * 60 * 60 * 1000);
           }

           function CompareDates() {
               toCalendar = getCalendarTo();
               toDate = toCalendar._selectedDate;
               fromDate = getCalendarFrom()._selectedDate;
               if (fromDate >= toDate) {
                   toDate = addDays(fromDate, 1);
                   toCalendar._selectedDate = toDate;
                   toCalendar._textbox.set_Value(toDate.localeFormat(toCalendar._format))
               }                          
           }
           
           
           function ValidateToDate() {
               ValidateDate(getCalendarFrom(), document.getElementById("edFrom").value);
               ValidateDate(getCalendarTo(), document.getElementById("edTo").value);
               CompareDates();
               setDaysCombo();
           }

           function AdjustDeparture() {
               ValidateFromDate(true);
               d = document.getElementById("cbDays").value;
               toDate = addDays(fromDate, d);
               toCalendar._selectedDate = toDate;
               toCalendar._textbox.set_Value(toDate.localeFormat(toCalendar._format))
           }

           function removeTime(srcDate) {
               //result = Date.parse(
               var dt = srcDate.getDate();
               var mm = srcDate.getMonth();
               var yy = srcDate.getFullYear();
               var result = new Date(0);
               result.setFullYear(yy, mm, dt);
               return result;
           }
           
           function setDaysCombo() {
               var d1 = Math.floor(removeTime(getCalendarTo()._selectedDate) / (24 * 60 * 60 * 1000));
               var d2 = Math.floor(removeTime(getCalendarFrom()._selectedDate) / (24 * 60 * 60 * 1000));
               document.getElementById("cbDays").selectedIndex = d1 - d2 - 1;
           }

           function callPopup() {

               window.open("ShowBriefPrices.aspx", "_blank", "");

          }


////// End Inquiry.aspx /////

////// ShowBriefPrices.aspx /////

           var image, name;
           function pop(image, name) {
               var win = window.open("", "", "width=600, height=500");
               win.document.write("<html><body><head><title>"+name+"</title>");
               win.document.write("<link href=\"css/screen.css\" rel=\"stylesheet\" >");
               win.document.write("</head>");
               win.document.write("<body class=\"pop\" >");
               win.document.write("</div><img src=\"Img/Rooms/Screens/" + image + ".jpg\" width=\"500\" height=\"350\" >");
               win.document.write("<input type=\"button\" onclick=\"window.close();\" value=\"Close Window\">");
               win.document.write("</body>");
               win.document.write("</html>");
               win.document.close();
           }
		  
			var d = document;
		    var prev = 'all';
			function tab(id) {
				d.getElementById(prev).style.backgroundColor = '#DDD';
				d.getElementById(id).style.backgroundColor = '#BBB';

				d.getElementById('_'+prev).style.display = 'none';
				d.getElementById('_'+id).style.display = 'block';
				d.getElementById('_'+id).blur;
				prev = id;

				d.getElementById(id).blur();

				return false;
			}


		   
////// End ShowBriefPrices.aspx /////		  
		  
		  
		  