function textselect(bool) {
    $(document)[bool ? "unbind" : "bind"]("selectstart", function () { return !mouseDown; })
			.attr("unselectable", bool ? "off" : "on")
			.css("MozUserSelect", bool ? "" : "none");
}

var page = 1;
function nextPage(url, page, callback) {
    $.get(url + '?page=' + page, function (data) {
        $('section.threeColBoxes').html($(data).find('section.threeColBoxes').html());
        if (callback != null)
            callback();
    });
}

// Provides legacy support for the html5 placeholder property of input fields
jQuery(function() {
	jQuery.support.placeholder = false;
	var test = document.createElement('input');
	if ('placeholder' in test) jQuery.support.placeholder = true;
});

$(function() {
	if (!$.support.placeholder) {
		var active = document.activeElement;
		$(':text').focus(function() {
			if ($(this).attr('placeholder') != '' && $(this).val() == $(this).attr('placeholder')) {
				$(this).val('').removeClass('legacyPlaceholder');
			}
		}).blur(function() {
			if ($(this).attr('placeholder') != '' && ($(this).val() == '' || $(this).val() == $(this).attr('placeholder'))) {
				$(this).val($(this).attr('placeholder')).addClass('legacyPlaceholder');
			}
		});
		$(':text').blur();
		$(active).focus();
		$('form').submit(function() {
			$(this).find('.legacyPlaceholder').each(function() { $(this).val(''); });
		});
	}
});
