﻿
jQuery(document).ready(function($) {
    //Calendar
    $("#From").datepicker({
        showOn: 'button',
        buttonImage: 'http://www.erakorislandresort.com/wp-content/themes/erakor/images/btn-calendar.png',
        buttonImageOnly: true,
        changeMonth: true,
        changeYear: true,
        dateFormat: 'dd/mm/yy',
        showButtonPanel: true,
        buttonText: 'Show Calendar',
        minDate: '0d', 
        defaultDate: +1
    });   
    
     $("#From").datepicker( "setDate" , +1 );

    //Quick launch
	
    $("input.check").click(function() {
               
        var checkIn = $("#From").datepicker( 'getDate' ); 
        var checkInDay = checkIn.getDate(); 
        var checkInMonth = checkIn.getMonth()+1;
				var checkInYear = checkIn.getFullYear(); 
				if (checkInMonth < 10)
						checkInMonth = "0" + checkInMonth;
				if (checkInDay < 10)
						checkInDay = "0" + checkInDay;
        var formattedDate = checkInYear + "" + checkInMonth + "" + checkInDay; 
   
        var url = 'http://www.globekey.com/reserve.php?hid=VLI8992&fymd=' + formattedDate
         
        window.open(url);
    });	
});


