/* Author: Jonny Campbell

*/

$(document).ready(function(){
	
	// Run Matt Kersley's jQuery Responsive menu plugin (see plugins.js)
	if ($.fn.mobileMenu) {
		$('ol#id').mobileMenu({
			switchWidth: 768,                   // width (in px to switch at)
			topOptionText: 'Choose a page',     // first option text
			indentString: '&nbsp;&nbsp;&nbsp;'  // string for indenting nested items
		});
	}

	// Run Mathias Bynens jQuery placeholder plugin (see plugins.js)
	if ($.fn.placeholder) {
		$('input, textarea').placeholder();		
	}
});


// Noise Background

$('html').noisy({
    'intensity' : 1, 
    'size' : 200, 
    'opacity' : 0.11, 
    'fallback' : '../img/bg-black.png', 
    'monochrome' : false
}).css('background-color', '#000');

$('body').noisy({
    'intensity' : 1, 
    'size' : 200, 
    'opacity' : 0.08, 
    'fallback' : '../img/bg-white.png', 
    'monochrome' : false
}).css('background-color', '#fff');

$('.love').noisy({
    'intensity' : 1, 
    'size' : 200, 
    'opacity' : 0.08, 
    'fallback' : '../img/bg-white.png', 
    'monochrome' : false
}).css('background-color', '#fff');

$('footer').noisy({
    'intensity' : 1, 
    'size' : 200, 
    'opacity' : 0.11, 
    'fallback' : '../img/bg-black.png', 
    'monochrome' : false
}).css('background-color', '#000');


// Hover Heart

$("span.love").hover(
function() {
$(this).stop().animate({"opacity": "1"}, "20");
},
function() {
$(this).stop().animate({"opacity": "0"}, "20");
});


// Page Weather

$("span.earthquake").click(function () {
	  $('*').addClass('shake');
		setTimeout(function(){
     $('*').removeClass('shake');}, 6 * 1000);
});


$("span.hurricane").click(function () {
	  $('*').addClass('windy');
		setTimeout(function(){
     $('*').removeClass('windy');}, 6 * 1000);
});


$("h2.intro-header span").click(function () {
	  $('span.earthquake').stop().toggleClass('highlight'),
		$('span.hurricane').stop().toggleClass('highlight');
});

/*
$("h2.intro-header span").toggle(
function() {
$(this).stop().animate({"zoom": "33%"}, "20"),
$("nav ul span").stop().animate({"zoom": "400%"}, "20");
},
function() {
$(this).stop().animate({"zoom": "100%"}, "20"),
$("nav ul span").stop().animate({"zoom": "100%"}, "20");
});
*/
