$(document).ready(function(){
	

	$("#block-views-join-block_1 .form-text").each(function() {
		$(this).attr('title', $(this).attr('value'));
		$(this).addClass('autofill');
	});


	
	$("li").hover(function(){ $(this).addClass('hover'); }, function(){ $(this).removeClass('hover'); });

	$("ul").each(function() {
		$(this).children("li:last").addClass('last');
	});

	$(".minheight").each(function() {
		if ($(this).height() < $(this).css('min-height').replace('px', '')) {
			$(this).height($(this).css('min-height'));
		}
	});

	$(".autofill").focus(function() {
		if ($(this).val() == $(this).attr('title')) { $(this).val(''); }
	}).blur(function() {
		if ($(this).val() == '') { $(this).val($(this).attr('title')); }
	});


	$("#edit-log").parents('.form-item').hide();

	$("span.email").each(function() {
		email = $(this).text().replace('(at)', '@');
		$(this).empty().append($("<a href='mailto:" + email + "' />").text(email));
	});

	$("input[type=button], input[type=submit]").addClass('button');

	$("form").submit(function() {
		//$(this).find('input, textarea, submit').removeAttr('disabled');
	});


	$(".view-news.view-display-id-page_2 .views-field-field-subheadline-value p:last").append(" ").append($(".view-news.view-display-id-page_2 .views-field-nid .moreLink"));


	$("#block-menu-primary-links a").hover(function() {
		$(this).find('.replacement').hide();	
		$(this).find('.replacement_hover').show();
	}, function() {
		$(this).find('.replacement').show();	
		$(this).find('.replacement_hover').hide();
	});


	if ($('.view-photo-block.view-display-id-block_1 .view-content').length) {
		$('.view-photo-block.view-display-id-block_1 .view-content').cycle({ 
		    fx:    'fade', 
		    delay: 1000,
		    speed:  1000,
		    timeout: 4500
		});
	}

});

