$(document).ready( function()
{
  $("a.subscribe").click( function()
  {
    var userEmail = $('#newsletterEmail').val();
    if ( userEmail )
    {
      if ( userEmail.indexOf(".") > 2 && userEmail.indexOf("@") > 0 )
      {

        $.post('inc/newsletter.php', { email : $('#newsletterEmail').val(), action: 'add' }, function(data)
        {
          $("#newsletterbox p").html( data );
          $("#newsletterbox form").html(" ");
        });
      }
      else
      {
        $('#newsletterbox').find('p').html('<b>Prosz─Ö wprowadzi─ç poprawny adres e-mail.</b>');
      }
    }
    else
    {
      $('#newsletterbox').find('p').html('<b>Prosz─Ö wprowadzi─ç poprawny adres e-mail.</b>');
    }
  });
  
  $("#content div").each( function()
  {
    if ( $(this).children("div").length > 0 )
      $(this).css("float", "left");
  });
  
});
