$(document).ready(function() {

	$('ul.nav li:last-child').css('padding-right', 0);
	$("ul.subnav").parent().append("<span class='dropdown'></span>");
	$("ul.subnav").prev('a').css({'padding-right':'15px'});
	$("ul.subnav").prev('a').parent().each(function(){
		$(this).hover(function(){
			$(this).find("ul.subnav").slideDown('fast').show();
		}, function(){
			$(this).find("ul.subnav").slideUp('fast');
		});
	});

	$('<span></span>').appendTo('#header ul.nav > li:not(:last)');
	$('<span>·</span>').appendTo('#footer ul.nav li:not(:last)');
	$('<span>|</span>').appendTo('#header ul.lang li:not(:last)');

	$('ul.properties-box li:nth-child(3n)').css('margin-right', 0);
	$('ul.properties-box li p:last-child').css('margin-bottom', 0);
	$('<div class="clear"></div>').insertAfter('ul.properties-box li:nth-child(3n)');

	//$('<div class="clear"></div>').insertAfter('ul.threeColumns li:last-child');

	if (!$('ul.threeColumns').length == 0) {
		$('ul.threeColumns li:last-child').addClass('last');
		$('ul.threeColumns li p:last-child').css('margin-bottom', 0);
	}

	if (!$('#carousel-demo5').length == 0) {
		ulHeight = $('ul.threeColumns').outerHeight();
		sliderKitH = $('#carousel-demo5').outerHeight();
		headerH = 472;
		ulPadding =  headerH + ulHeight + sliderKitH;
		$('#wrapper.home').css('paddingTop', ulPadding + 40);
		//$('.aside').css('paddingTop', paddingSubmenu);
		//console.log(ulPadding);
	}

	if (!$('.discover').length == 0) {
		$('.discover .background').show();
		setTimeout(function() {
		   $('.discover .background').hide('blind',{},'slow');
		}, 2000);
		$('.discover h2').hover(function () {
			$('.discover .background').show('blind',{},'slow');
		});
		$('.discover .background').mouseleave(function () {
			$('.discover .background').hide('blind',{},'slow');
		});
	}

});
