$("#malwarediv").css({opacity: ".5"});

$(".table_download").hover(
  function () {
    $(".table_download").not(this).stop().fadeTo('fast', 0.3);
  },
  function () {
    $(".table_download").stop().fadeTo('fast', 1);
  }
);

$("#tbl_package_download tr td").live("mouseover", function () {
  $(this).css({ background : 'transparent url(/Includes/Images/bg_fade_rev.gif) repeat-x scroll 0pt 100%' });
});

$("#tbl_package_download tr td").live("mouseout", function () {
  $(this).css({ background : '' });
});

$("#div_soho, #div_enterprise").live('mouseover', function () {
  $(this).find('p').css({ color : '#0088CC' });
});

$("#div_soho, #div_enterprise").live('mouseout', function () {
  $(this).find('p').css({ color : '#777777' });
});

$("#div_soho").click(function() {
  window.location = '/Appliances/Small_And_Medium_Businesses';
});
$("#div_enterprise").click(function() {
  window.location = '/Appliances/Large_Enterprises';
});
$("#ubuntu").click(function() {
  window.location = '/Resources/Ubuntu_Linux';
});
$("#virtualized").click(function() {
  window.location = '/vap/NullBoundMPS-NGP-WK6.tar.bz2';
});
$("#linux").click(function() {
  window.location = '/Download/NullBoundMPS_NGP.bin';
});

function downloadSubmit() {
  var formfields = new Array('#fname', '#lname', '#email', '#phone', '#company');
  
  for (var i = 0; i < formfields.length; i++) {
    if ($(formfields[i]).val().length < 3) {
      $(formfields[i]).css({ borderColor : 'ff0000' });
      $(formfields[i]).focus();
      return;
    } else {
      $(formfields[i]).css({ borderColor : '666666' });
    }
  }
  
  $.get("GenerateLicense/", {
    fname: $('#fname').val(),
    lname: $('#lname').val(),
    email: $('#email').val(),
    phone: $('#phone').val(),
    company: $('#company').val(),
    state: $('#state :selected').val(),
    country: $('#country :selected').val()
  }, function (data) {
    if (data == '') {
      $('#notice').html('You appear to already have obtained a trial license. If you feel you have receieved this message in error, or if you would like to extend your trial,  please contact support at <a href="mailto:support@nullbound.com"> support@nullbound.com</a>.');
    } else {
      $('#notice').html('Your information has been automatically processed and your 45 day trial license key is shown below. You will be prompted to enter this key during installation.<br><br>License Key: <strong>' + data + '</strong>');
      $("#fname, #lname, #email, #phone, #company").val('');
    }
  });
}