$(document).ready(function() {
  $('#show-more').click(function(){
		$(this).hide();
		$('#continue').fadeIn()
  });
  $('#feedForm').submit(feedFormSubmit);
});

function feedFormSubmit() {
  var email = $('#subscribebox').val();
  chk = new RegExp(/^[a-zA-Z][\+\w\.-]*[a-zA-Z0-9]*@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/);
  if(chk.test(email)) {
    window.open('http://feedburner.google.com/fb/a/mailverify?uri=ichartsblog&email='+email, 'popupwindow', 'scrollbars=yes,width=550,height=520');
  } else
    alert("Please enter a valid email address");
  return false;
}

/*$(window).load(function() { resizebg(); });
$(window).resize(function() { resizebg(); });

function resizebg() {
  console.log('resize');
	//if ($('#backstretch').complete) clearInterval(loadbg);
	if ($('#backstretch')) {
  		var w, h, x, y;
  		var iw = $('#backstretch').width();
  		var ih = $('#backstretch').height();
  		var winx = $(window).width();
  		var winy = $(window).height();
      //console.log(winx);
  		var constrain = winx/winy > iw/ih ? 'w' : 'h';
  		if(constrain=='w') {
  			w = winx;
  			h = winx * ih / iw;
  			x = 0;
  			y = -(h - winy) / 2;
  		} else if(constrain=='h') {
  			w = winy * iw/ih;
  			h = winy;
  			x = -(w - winx)/2;
  			y = 0;
  		}
  		$('#backstretch').css({
  		        width: w+'px',
  		        height: h+'px',
  		        top:0, //y+'px',
  		        left: x+'px'
  		});
	}
}
*/
