$(document).ready(function() {
   
   $.backstretch(
		"img/background.jpg", {
			speed: 150,
			centeredY: false
		}
	);
   
   
  // resizepush();
	
	$(window).bind('resize', function() {
		//resizepush()
	});
	
	$('a[rel=external]').attr('target','_blank');
	
	$('#mce-EMAIL').addClass("idleField");
	$('#mce-EMAIL').focus(function() {
		$(this).removeClass("idleField").addClass("focusField");
		if (this.value == this.defaultValue){ 
			this.value = '';
		}
		if(this.value != this.defaultValue){
			this.select();
		}
	});
	$('#mce-EMAIL').blur(function() {
		$(this).removeClass("focusField").addClass("idleField");
		if ($.trim(this.value) == ''){
			this.value = (this.defaultValue ? this.defaultValue : '');
		}
	});
	
	$('#newsletter').hide();
	$('#sendnewsletter').click(function(e){
		$('#newsletter').show();
        $(this).addClass('on');
		e.preventDefault();
	})
	$('#mc_embed_close').click(function(){
		$('#newsletter').fadeOut(200);
        $('#sendnewsletter').removeClass('on');
        $('#mce-success-response').hide().text('');
        $('#mce-error-response').hide().text('');
	})
	
});
function resizepush(){
	var c = $('#container').height(),
	   bh = $(window).height(),
	   $push = $('#push');
	   fh = $('#footer').height();
   $push.height(bh - c - fh);
}
