$(function() {	

	// Main navigation
	var timer;
	
	function hide_nav() {
		$('#nav2 > li ul').hide().css('z-index', '1').removeClass('active');
		$('#nav2 > li a').removeClass('current');
	}
	
	$('#nav2 > li').mouseover(function() {
		hide_nav();
		if (document.timer) window.clearTimeout(document.timer);
		$('ul', this).show().css('z-index', '2').addClass('active');
		$('a', this).addClass('current');
	}).mouseout(function() {
		document.timer = window.setTimeout(hide_nav, 500);
	});
	
	// Homepage building reskin cycler
	$('#footer-rotater').cycle({ 
		fx:     'fade', 
		speed:   2000, 
		timeout: 3000, 
		pause:   1 
	});
	
	// Blog popular posts tabs
	$("#tab1 > ul").tabs();
	$("#tab2 > ul").tabs();
	$("#tabs").tabs();
	
	// Lazy Load plugin init
	$('#blogContent div.postContent p a').attr('target','_blank');
});

// Jump menus
function jump(el) {
	console.log($(el).val());
	document.location = $(el).val();
}

