// Javascript

// $('html').addClass('js'); // Flash of content fix (.js class hidden in CSS) - this now included inline header.php

$(document).ready(function() {
	
	
	/*
	==============================================================
		Remove No-Script Styles
	==============================================================
	*/
	
	$('html').removeClass('js'); // Flash of content fix (when doc is ready, pull the .js class)
	
	
	/*
	==============================================================
		Navigation Classes for IE
	==============================================================
	*/
	
	$('#header .nav > li > a').addClass('first-level-a');
	$('#header .nav > li').addClass('first-level-li');
	$('#header .nav li:first-child').addClass('first-child');
	$('#header .nav li:last-child').addClass('last-child');
	
	
	/*
	==============================================================
		Block Element to Link
	==============================================================
	*/
	
	$('.link').click(function(){
		window.location = $(this).find("a").attr("href");
		return false;
	});
	
	
	/*
	==============================================================
		Toggle Slider
	==============================================================
	*/
	
	$('.slider').each(function(){
		
		// Kill empty DOM elements
		$(this).children(':empty').remove();
		
		// Add title class to first DOM element
		$(this).children(':first').addClass('slider-title');
		
		// Wrap all DOM elements except title
		$(this).children().not('.slider-title').wrapAll('<div class="slider-content"></div>');
	
	});
	
	$('.slider-content').each(function(){
		
		// Pull top/bottom margins off slider content to avoid animation jump
		$(this).children(':first').css('margin-top', '0');
		$(this).children(':last').css('margin-bottom', '0');
	
	});
	
	// Add +/- symbols
	$('.slider-title').append('<span class="plus">+</span><span class="minus">-</span>');
	
	// Slide toggle function
	$('.slider-title').click(function() {
		$(this).siblings('.slider-content').slideToggle();
		$(this).children('.plus, .minus').toggle();
	});
	
		
});
















