﻿function datepicker_checkin_init(img_src) {
    btn_img = img_src ? img_src : "/images/cal_icon.jpg";
    $j(".check-in-date").datepicker({
        showOn: 'button', 
        buttonImage: btn_img,
        buttonImageOnly: true, 
       // clickInput: true,
        minDate: new Date()//,
//        beforeShow: function() {
//            datepicker_before_show();
//            var check_out_date = $j(".check-out-date").val();
//            if (check_out_date != "") {
//                var max_date = new Date(check_out_date);
//                max_date.setDate(max_date.getDate() - 1);
//                $j(".check-in-date").datepicker('option','maxDate', max_date);
////                $j(".check-in-date").datepicker({clickInput:true});                
////	            $j("#bl").dpSetPosition($j.dpConst.POS_BOTTOM, $j.dpConst.POS_LEFT);
//            }
//        },
//        onClose: function() {
//            datepicker_on_close();
//        }
    });
//	$j(".check-in-date").datePicker({clickInput: true});

}

function datepicker_checkout_init(img_src) {
    btn_img = img_src ? img_src : "/images/cal_icon.jpg";
    var min = new Date();
    min.setDate(min.getDate() + 1);
    $j(".check-out-date").datepicker({
        showOn: 'button', 
        buttonImage: btn_img,
        buttonImageOnly: true, 
        minDate: min//,
    //    clickInput: true,
//        beforeShow: function() {
//            datepicker_before_show();
//            var check_in_date = $j(".check-in-date").val();
//            if (check_in_date != "") {
//                var min_date = new Date(check_in_date);
//                min_date.setDate(min_date.getDate() + 1);
//                $j(".check-out-date").datepicker('option','minDate', min_date);
////                $j(".check-out-date").datepicker({clickInput:true});
//            }
//            
//        },
//        onClose: function() {
//            datepicker_on_close();
//        }
    });
}

function datepicker_before_show() {
//    $j("ul.res").parent().addClass("active");
//    $j("ul.active, .menu li").unbind();
}

function datepicker_on_close() {
//    $j("ul.active, .menu li").hover(function() {
//        $j("ul.active").removeClass("active");
//     },
//     function() {});
//     
//     $j("ul.active").click(function() {
//        $j(this).removeClass("active");
//     });
}
