$(document).ready(function () {

    var colHeight = $('#content').innerHeight() - 205;

	$('.sidebar').css('height', (colHeight - 30) + 'px');

	$('#content-block div').css('height', (colHeight - 40) + 'px');

	var ftrHeight = $('#footer-block').innerHeight();

	$('#footer-block div').css('height', (ftrHeight - 30) + 'px');

	$('#switcher,#cta').show();

	$('#switcher ul,#cta div').hide();

	$('#switcher').hover(function(){
		$('#switcher ul:hidden').slideDown();
	},function(){
		$('#switcher ul:visible').slideUp();
	});
	$('#cta span').click(function(){
		var theform = $('#cta div');
		if (theform.is(':hidden')) {
			theform.slideDown();
		} else if (theform.is(':visible')) {
			theform.slideUp();
		}
	});
	var hoverTimer;
	$('#cta').hover(function(){
		if(hoverTimer) {
			clearTimeout(hoverTimer);
            hoverTimer = null;
        }
        hoverTimer = setTimeout(function() {
        	$('#cta div:hidden').slideDown();
		}, 200);
	},function(){
		clearTimeout(hoverTimer);
        hoverTimer = null;
	});
	
});
