$(function() {
	if ($('#state_page').length>0) {
		$('#bg_fade').hide();
		$('.content_wrap').show();
		$('.footer *').show();
	}
	else {
		$('#bg_fade').delay(1000).fadeOut('slow');
		$('.content_wrap').delay(2000).fadeIn('slow');
		$('.footer *').delay(2500).fadeIn('slow');
	}
	$('#read_more').click(function() {
		$('#more').toggle('slow', function() {
			if ($('#read_more span').text()=='read more') {
				$('#read_more span').text('read less');
			}
			else {
				$('#read_more span').text('read more');
			}
		});
	});

	$('#states').submit(function() {
		var state = $('select option:selected').val();
		$('#states').attr('action', state+'.html')
	});

	
	/*$('#states').submit(function() {
		var state = $("select option:selected").val();
		$.ajax({
			type: 'POST',
			url: 'states.php',
			data: state,
			success: function(msg) {
				$('#members_vals').html(msg);
			}
		});
		return false;
	});*/

	if (Modernizr.input.placeholder) {
		$('.idle').val('');
		$(':input').removeClass('idle');
	}
	else {
		$('input').focusin(function() {
			var val = $(this).prev().text();
			if ($(this).val()==val) {
				$(this).removeClass('idle');
				if ($(this).attr('id')=='website') {
					$(this).val("http://");
				}
				else {
					$(this).val("");
				}
			}
		});
		$('input').focusout(function() {
			var val = $(this).prev().text();
			if ($(this).val().length==0 || $(this).val()=="http://") {
				$(this).addClass('idle');
				$(this).val(val);
			}
		});
	}
});
