﻿
Cufon.replace('h1, #mainnav a, .newsTtl, h2, h3, h4, .subNavigation li a, #apartmentsTableResult .title, .coufonMe', { hover: true })

$(document).ready(function () {
    footer();
    headers();
    $('.datepicker').datepicker({
        dateFormat: 'dd.mm.yy',
        changeMonth: true,
        changeYear: true
    });
    $('.qtip').qtip({ style: { tip: true} });
});

$(window).resize(function () {
    footer();
});

function headers() {
    $('#thumbs li a').click(function () {
        $('#cycle').cycle('pause');
    })
    $('#cycle').cycle({
        fx: 'fade',
        speed: 700,
        timeout: 4500,
        pager: '#thumbs',
        pagerAnchorBuilder: function (idx, slide) {
            return '#thumbs ul li:eq(' + idx + ') a';
        }
    });
}


function footer() {
    var windowHeight = $(window).height();
    var containerHeight = $('#content').height() + $('#header').height();
    var footerHeight = $('#footer').height();
    var totalHeight = windowHeight - (containerHeight + footerHeight) - 53;  //footer padding
    if (totalHeight >= 0) {
        $('#footer').css('top', totalHeight);
    }
    else {
        $('#footer').css('top', 0);
    }

}
