$(document).ready(function() {
	$('#debug_sql_toggle').click(function() {
		$('#debug_sql').toggle();
	});
});

function toggle_time_format() {
	$('.t24h').toggle();
	$('.t12h').toggle();
}

function coordinate_in_range(lat, lng) {
  var p1 = [49.95, -123.5];
  var p2 = [49, -122.3];
  return p1[0] > lat && lat > p2[0] && p1[1] < lng && lng < p2[1];
}

// http://www.dailycoding.com/Posts/default_text_fields_using_simple_jquery_trick.aspx
// with some tweaks.
$(document).ready(function()
{
    var selector = ".has_default_text";
    $(selector).focus(function(srcc)
    {
        if ($(this).val() == $(this)[0].title)
        {
            $(this).removeClass("default_text_active");
            $(this).val("");
        }
    });
    
    $(selector).blur(function()
    {
        if ($(this).val() == "" || $(this).val() == $(this)[0].title)
        {
            $(this).addClass("default_text_active");
            $(this).val($(this)[0].title);
        }
    });
    
    $(selector).blur();        
});

