// 
//  application.js
//  General behaviours for the whole site.
//  
//  Created by Ned Baldessin on 2009-01-05.
//  Copyright 2009 Ned Baldessin. All rights reserved.
// 


$(document).ready(function() {
	
	reset_dimensions_of_content_wrapper_box();
	$(window).bind('resize', reset_dimensions_of_content_wrapper_box)
	
	$('#newsletter-email').focus(function(){
		if (this.value == 'newsletter') {
			this.value = '';
		}
	});
	
	$('#newsletter-email').blur(function(){
		if (this.value == '') {
			this.value = 'newsletter';
		}
	});
	
	$("#secondary-nav li.other-artists.closed").hide()
	$("#switch-other-artists").click(function(ev){
		ev.preventDefault();
		$("#secondary-nav li.other-artists").toggle('fast');
		
	})
});


var reset_dimensions_of_content_wrapper_box = function() {
	
	var h = ($('body').hasClass('homepage')) ? 34 : 130;
	$('#content-wrapper').height( $(window).height() - h);
	
	var w = ($('body').hasClass('artist') || $('body').hasClass('artists')) ? 816 : 643;
	$('#content-wrapper').width( Math.floor(($(window).width() - 998) / 2) + w);
}
