$(document).ready(function() {

	///Header - Main nav
	$("nav#main-nav ul").superfish({
		delay: 500,
		autoArrows:  false,
		dropShadows: false,
		animation: { opacity:'show', height:'show' },
		speed: 'fast'
	});
	$("nav#main-nav ul li ul").superfish({
		delay: 500,
		autoArrows:  false,
		dropShadows: false,
		speed: 'fast'
	});
	
	//Slider
	$("#slider").slideDown(500);
	
	//Tabs
	$("#tabs").tabs({ fx: { height: 'toggle', opacity: 'toggle' } });
	
	//Tags
	$('#tabs .tags a').hover(function(){
		$(this).stop(true, false).animate({
			backgroundColor: '#fafafa'
		}, 'fast');
	}, function(){
		$(this).animate({
			backgroundColor: '#fff'
		}, 'fast');
	});
	
	//UL.list
	$('.list li, .xoxo li').hover(function(){
		$(this).stop(true, false).animate({
			paddingLeft: '10px'
		}, 'fast');
	}, function(){
		$(this).animate({
			paddingLeft: '0'
		}, 'fast');
	});
	$('#listing .list-alt li').hover(function(){
		$(this).stop(true, false).animate({
			backgroundColor: '#ebeff2'
		}, 'fast');
	}, function(){
		$(this).animate({
			backgroundColor: '#fff'
		}, 'fast');
	});
	
	//Clear
	$('.list li, .list-alt').addClass('clearfix');
	
	//Toggle
	$('.toggle-content').hide();
	$('.toggle-button').click(function() {
		if($(this).hasClass('active') == true) {
			$(this).removeClass('active');
			$(this).next('.toggle-content').slideUp('fast');
		}
		else { 
			$(this).addClass('active');
			$(this).next('.toggle-content').slideDown('fast');
		}
	});
	$('.toggle-button').mouseover(function() {
		$(this).addClass('hover');
	}).mouseout(function() {
		$(this).removeClass('hover');										
	});
	$('.toggle-content').hide();
	
	//Form submit & validation
	$("#comment-form-submit").click(function() {
		$("#comment-form").submit();
	});
	$("#comment-form").validate();
	$("#contact-form-submit").click(function() {
		$("#contact-form").submit();
	});
	$("#contact-form").validate();
	
});
