$(document).ready(function() {
	$(document).pngFix(); 
    
    $('#sendemail').jqEasyPanel2({
		position: 'bottom',
		height: '245',
		speed: 'fast'
	});
	
	$('#newsletter').jqEasyPanel({
		position: 'bottom',
		height: '152',
		speed: 'fast'
	});
	
	getTwitters('sge', {
     	id: 'bdhome', 
        count: 2, 
        withFriends: true, // currently disabled due to change in Twitter API
        enableLinks: true, 
        ignoreReplies: true,
        includeRT: true,
        template: '<span class="twitterPrefix"><p class="twitterStatus">%text%</p>'
	});

        $("form#register").submit(function(){ 
              var email = $("input#email").val();
              var name = $("input#name").val();
              if (email==""||email=="Email")
			  {
					$('#emailInput').append("<p class='required'>required</p>");
					document.register.email.value='Email';
					return false;
			  }else if(email.indexOf("@") < 1){ // very basic check if email address entered is valid
					$('#emailInput').append("<p class='required'>invalid</p>"); //could have a different image for invalid input
					document.register.email.focus();  //could be used to focus on email field
					return false;				  	
			  }else{
				  var sendData = 'email='+ email + '&name=' + name;
				  $.ajax({
					type: "POST",
					url: "submit.php",
					data: sendData,
					success: function() {
					  $('#right').html("<div id='submitted'></div>");
					  $('#submitted').html("<h1>Thank you!</h1><p>You have successfully signed up for our e-newsletter.</p>")
					  .hide()
					  .fadeIn(1000, function() {
						
					  });
					}
				  });
				  return false;
			  }
        });
		
		


});

  

