var initPicky = function(now3, now4) {
    $("#inout").val(now3 + ' - ' + now4);
    var chInOut = '';
    $('#widgetCalendar').DatePicker({
        current: new Date(now3),
        flat: true,
        format: 'Y/m/d',
        date: [new Date(now3), new Date(now4)],
        calendars: 1,
        mode: 'range',
        starts: 1,
        onRender: function(date) {
            return {
                disabled: (date.valueOf() < new Date(now3).valueOf())
            }
        },
        onChange: function(formated) {
            chInOut = formated.join(' - ');
            $('#widgetField span').get(0).innerHTML = chInOut;
            $('#inout').val(chInOut);
        }
    });
    var state = false;
    $('#widgetField>a').bind('click', function(){
        $('#widgetCalendar').stop().animate({height: state ? 0 : $('#widgetCalendar div.datepicker').get(0).offsetHeight}, 500);
        state = !state;
        return false;
    });
    $('#widgetCalendar div.datepicker').css('position', 'absolute');
};

$(document).ready(function(){

    $('a[rel*=lightbox]').lightBox({
        overlayBgColor: '#FFF',
        overlayOpacity: 0.6,
        containerResizeSpeed: 530,
        txtImage: '',
        txtOf: '/'
    });    

    $('#imagerotator').flash( { 
        src: '/images/header/imagerotator.swf',
        width: '580px',
        height: '228px',
        wmode: 'transparent',
        allowscriptaccess: 'always',
        allowfullscreen: 'false',
        flashvars: { 
            file: '/images/header/imagelist.xml', 
            screencolor: '0xFFFFFF', 
            overstretch: 'fit', 
            rotatetime: '6', 
            repeat: 'true', 
            shownavigation: 'false',
            shuffle: 'true'
        }
    }, { update: false }
    );    

    /*
    $('#vip_offers_xml').flash( { 
        src: '/vip_offers.swf',
        width: '395px',
        height: '296px',
        wmode: 'transparent',
        allowscriptaccess: 'always',
        allowfullscreen: 'false'
    }, { update: false }
    );
    */
    
    $('#contenteast_offer_flash').flash( { 
        src: '/vip_offers.swf',
        width: '180px',
        height: '135px',
        wmode: 'transparent',
        allowscriptaccess: 'always',
        allowfullscreen: 'false'
    }, { update: false }
    );
  
    $('#video_content').flash( { 
        src: 'http://www.kudebg.com/video/hoteli/Holydai_Hotel_Velingrad.swf ',
        width: '405px',
        height: '261px',
        wmode: 'transparent',
        allowfullscreen: 'true'
    }, { update: false }
    );

    $(document).pngFix(); 
});


