function clickyHours() {	var hours = $( '#header p' )	var hide  = $( '.hide' )	$( '#hours' ).click( function() {		hide.toggle()		hours.toggle()	})}function thumbSwap() {	var div = $( '.big' )	$( '#afters img' ).each( function() {		$( this ).click( function() {			var datum = $( this ).attr( 'data-id' )			$( '.show' ).hide()			console.log( $( datum ).length )			$( this ).addClass( 'current' ).parent().parent().find( 'img' ).not( $(this) ).removeClass( 'current' )		})	})	}function sendFriend() {	// ajax form		$('p.submit').bind({		ajaxStart: function() {    	$('p.error').empty().hide()    	$('input', this).val('Sending...')			$(this).find('img').show()		},		ajaxComplete: function() {   		$('input', this).val('Send!')			$(this).find('img').hide()		}	})		// $('textarea#message').val('How can we help you?')  $('form#email_form').submit(function(e) {		var form = this  	var data = $(this).serialize()  	$.post($(this).attr('action'), data, function(data) {    	if (data == 'true') {				$('#email_form').jqmHide()				$('#send').find('a').replaceWith(        	$('<p class="thanks">Your email has been sent.</p>').hide()        )        $('p.thanks').fadeIn()      } else if (data == 'false') {      	$('p.error')        	.text('Uh oh, there was some kind of error. Please try using the form later.')        	.fadeIn()      } else {      	$('p.error')        .text('Whoops! Please do remember to fill in all the fields.')        .fadeIn()      }    })    e.preventDefault()  })    	// intialize modal  $.jqm.params.overlay  = 20  $.jqm.params.onShow   = function(hash) {		hash.w.fadeIn()	};	$.jqm.params.onHide   = function(hash) {  	hash.w.fadeOut("fast", function() {    	if(hash.o) {     		hash.o.remove()    	}  	})	}	$('#email_form').jqm()}function lithiaGallery() {	// Initialize gallery slider	var $slider = $( '#slider' )	var currentPanel = 1	var panelCount = $slider.find( 'div' ).length	var panelHeight = $slider.find( 'div:eq(0)' ).height()	console.log( panelCount, panelHeight )	// Assign click handlers	$( '#thumbs img' ).each( function( i ) {		$( this ).bind( 'click', function() {			$( this ).addClass( 'current' ).parent().parent().find( 'img' ).not( $( this ) ).removeClass( 'current' )			offset = - ( 421 * i )			// changePanelHeight( i )			$slider.animate( 				{ marginTop: offset }, 				{ queue: false, duration: 500, easing: 'easeInOutExpo' }			)		})	})	// Update <ul> height	function changePanelHeight( y ) {		panelHeight = $( '.panel:eq(' + y + ')', $slider ).height()		$slider.animate({ height: panelHeight }, 500, 'easeInOutExpo' )	}}function fancySchmancy() { 	$('a[rel=group]').fancybox({		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {			return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>'		}	})}// DOM Ready$( function() {			clickyHours()	sendFriend()	// lithiaGallery()	fancySchmancy()})
