/* scripts.js */

function dump_obj (obj) {
	var name;
	console.log ("dump_obj(" + obj + ")");
	for (name in obj) {
		if (obj.hasOwnProperty (name)) {
			console.log (name + " = " + obj[name]);
		}
	}
}

$(document).ready( function() {
	$('#tweets').tweet({
		avatar_size: 32,
	         count: 7,
	         username: "votenoquestion3",
	         loading_text: "searching twitter..."
	});

	var value_labeled_fields = $('input.value-labeled');
	
	value_labeled_fields.focus( function( e) {
		if ( typeof this.original_value == 'undefined')
		{
			this.original_value = this.value;
			this.value = '';
		} else if ( this.value == this.original_value)
		{
			this.value = '';
		}
		$(this).removeClass('value-labeled');
	});
	
	value_labeled_fields.blur( function( e) {
		if ( (this.value == '') && ( typeof this.original_value != 'undefined'))
		{
			this.value = this.original_value;
			$(this).addClass('value-labeled');
		}
	});
	
	$(".magic").colorbox({width:"80%", height:"80%", iframe:true});
	
});

/* ================================================================ */
function auto_select_click (ev) {
    var elt = ev.target;
    elt.focus();
    elt.select();
}

$(function () {
$(".auto_select").click(auto_select_click);
$(".initial_focus").focus();

});
/* ================================================================ */

