Cufon.replace("#navigation ul li a", {hover: true});
Cufon.replace(".col h2, .col h2 a, .footer-bottom .form h2, #sidebar h2, #sidebar h2 a, .content h2.pagetitle", { hover: true, color: '-linear-gradient(#c60d02, #9c0901)' });
Cufon.replace(".footer-top .col h2");

function onLoad(){
	Cufon.now();
}


jQuery(function($) {
	
	$('#menu-footer-menu a').not(':last').after('<span> | </span>');
	
	$('.gform_edit_link, .gfield_required').remove();
	$('.gfield .ginput_container').each(function() {
		$(this).find('input[type=text]').val( $(this).parent().find('label').text() ).attr('title', $(this).parent().find('label').text()).unwrap().siblings('label').remove();
	});
	
	$('.col form, #sidebar form').addClass('form');
	$('.footer-bottom .form .gform_footer input[type=submit]').appendTo('.footer-bottom .form .gform_body');
	$('.form input[type=text]').addClass('blink');
	
	$('.blink').live('focus', function () {
		if ($(this).val() == $(this).attr('title')) {
			$(this).val('');
		}
	});
	
	$('.blink').live('blur', function () {
		if ($(this).val() == '') {
			$(this).val($(this).attr('title'));
		}
	});

	if ($('.col .ngg-galleryoverview .ngg-gallery-thumbnail').length > 6) {
		var counter=0;
		$('.col .ngg-galleryoverview .ngg-gallery-thumbnail').each(function() {
			if (counter>5) {
				$(this).remove();
			}
			counter++;
		});
	}
	
	
	if ( $('.validation_error').length>0 || $('.validation_message').length>0 ) {
	
		$('.validation_error').each(function() {
			$('.errors').append($(this).text());
		});
		
		$('.errors').append("\n\n");
		
		$('.validation_message').each(function() {
			$('.errors').append("\n");
			$('.errors').append($(this).text());
		});
		
		$('.errors').text( $.trim( $('.errors').text() ) );
		alert($('.errors').text());
	}
	
	
	$('#sidebar > ul > li:last').addClass('last');
	
	$('a.more-link').each(function() {
		if ($(this).text()=='Read the rest of this entry »') {
			$(this).wrapInner('<span />');
		}
	});
	
	
	$('#navigation > ul > li').hover(function() {
		$(this).find('> ul').toggle();
	});
	
	$('#navigation > ul > li > ul > li').hover(function() {
		$(this).find('> ul').toggle();
	});
	
});
