﻿//this is for single resort bookings that use worldHotels
//it sets the textboxes to use the jquery calendar and to also set
//the URL for world hotels booking.

// I have replaced the default document "$" by "other" to avoid conflict. Luiz

// the dateformat function is "yy-mm-dd" and not "yyyy-mm-dd". Luiz

var other = jQuery.noConflict();

other(function() {
if (other("#datepicker-in")) {
    other("#datepicker-in").datepicker();
    other("#datepicker-in").datepicker("option", "dateFormat", 'yy-mm-dd');
    other("#wh").hide();
    };
});


other(function () {
    if (other("#datepicker-out")) {
        other("#datepicker-out").datepicker();
        other("#datepicker-out").datepicker("option", "dateFormat", 'yy-mm-dd');
    };
});


other(function() {
if (other("#datepicker-in2")) {
    other("#datepicker-in2").datepicker();
    other("#datepicker-in2").datepicker("option", "dateFormat", 'yy-mm-dd');
    other("#wh").hide();
    };
});


other(function () {
    if (other("#datepicker-out2")) {
        other("#datepicker-out2").datepicker();
        other("#datepicker-out2").datepicker("option", "dateFormat", 'yy-mm-dd');
    };
});


other(document).ready(function() {
other("#imgBtnBookNow").click(function() {

if (other("#datepicker-in") == "") {

            alert("please select a check-in date");

        };

        var newURL = "https://www.yourreservation.net/ibe/22_bluegreen/main.html?"
        newURL += "calArrivalDateField=" + other("#datepicker-in").val();
        newURL += "&calDepartureDateField=" + other("#datepicker-out").val();
        newURL += other("#queryString").val();
        newURL += "&occupancy=" + other("#Select1").val();
        newURL += "&prsRoomCount=" + other("#Select2").val();
        newURL += "&quick=quick";

        other("#wh").attr("src", newURL);
        other("#resortImages").hide();
        other("#description").hide();
        other("#columnThree").hide();
        other("#wh").show();
//        document.write(newURL);
//        alert("iframe src = " + newURL);


    });
});

other(document).ready(function() {
other("#imgBtnBookNow2").click(function() {




        var newURL = "https://www.yourreservation.net/ibe/22_bluegreen/main.html?"
        newURL += "calArrivalDateField=" + other("#datepicker-in2").val();
        newURL += "&calDepartureDateField=" + other("#datepicker-out2").val();
        newURL += other("#queryString").val();
        newURL += "&occupancy=" + other("#Select1").val();
        newURL += "&prsRoomCount=" + other("#Select2").val();
        newURL += "quick=quick";

        other("#wh").attr("src", newURL);
        other("#resortImages").hide();
        other("#description").hide();
        other("#columnThree").hide();
        other("#wh").show();
//        document.write(newURL);
//         alert("iframe src = " + newURL);



    });
});