$('#primary > div > div').each(function(){
	var a = $('a:first', this);
	$(this).hover(function(){
		a.addClass('hovered');
	},function(){
		a.removeClass('hovered');
	}).click(function(e){
		var t = $(e.target);
		if (!t.is('a') && !t.parent().is('a') && !t.is('input') && !t.is('button')) document.location.href = a.attr('href');
	});
});
if (!('placeholder' in document.createElement('input'))) {
	$('input[placeholder]:not(.processed)').each(function() {
		var input = $(this);
		input.addClass('processed');
		var pl = input.attr('placeholder');
		if (input.val() == '') {
			input.val(pl).addClass('placeholded');
		}
		$(this).focus(function() {
			if (input.val() == pl) {
				input.val('').removeClass('placeholded');
			}
		}).blur(function() {
			if (input.val() == '') {
				input.val(pl).addClass('placeholded');
			}
		}).closest('form').submit(function(){
			if (input.val() == pl) input.val('');
		});
	});
}
