﻿$('div.subscr input').each(function () {
  if ($(this).attr("value") == "")
    $(this).attr("value", $(this).attr("title"))
});
$('#btnSubscribe').css({'cursor':'pointer'})

$('div.subscr input').focus(function () {
    if ($(this).attr("value") == $(this).attr("title"))
      $(this).attr("value", "")
  });

  $("div.subscr input").blur(function () {
    if ($(this).attr("value") == "")
      $(this).attr("value", $(this).attr("title"))
  });

  function subscribe() {
    var data = { email: $('#email').val() }
    if (data.email != '' && data.email != $('#email').attr('title') && data.email.indexOf('@') != -1) {
      $('#btnSubscribe,#email').attr("disabled", "disabled");
      $.getJSON(window.SUBSCRIBE_ROOT + "SubscribeHandler.ashx?", data,
     function (data) {
       $('#btnSubscribe,#email').removeAttr("disabled");
       alert(data.message);
     });
    }
   else {
     alert(window.SUBSCRIBE_ALERT);
    }
   
  }
