
// COMMON: Load page in a new window; use class="new_window" on <a> tags
$(document).ready( function() {
	$("a.new_window").click( function() {
		w = window.open( this.href, 'new_window' );
		return false;
	} );
} );

// COMMON: Empty search field on focus
$(document).ready( function() {
	$("#search input").focus( function() {
		this.value = '';
	} );
} );

// COLLECTIONS > BIOGRAPHY, ZOOM: Load popup in new window; use class="popup" on <a> tags
$(document).ready( function() {
	$("a.popup").click( function() {
		w = window.open( this.href, 'zoom', 'height=583,width=500,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0' );
		return false;
	} );
} );

// COLLECTIONS > ZOOM > CLOSE: Close popup
$(document).ready( function() {
	$("#close > a").click( function() {
		w = window.close();
		return false;
	} );
} );

// GIFT REGISTRY: Empty login fields on focus
$(document).ready( function() {
	$("#friends_fn").focus( function() {
		this.value = '';
	} );
	$("#friends_ln").focus( function() {
		this.value = '';
	} );
} );

// GIFT REGISTRY: Add another name
$(document).ready( function() {
	$("#add_name").click( function() {
		$("#add_name_box").append("<br /><input type='text' name='contributors[]' value='' />");
	} );
} );

// EXHIBITIONS: Switch exhibition image
$(document).ready( function() {
	$("span.switch_image").click( function() {
		$(this).parent().prev().attr("src", './data/exhibitions/' + this.id.substring(1) + '.full.jpg');
	} );
} );
