$(document).ready(function(){
  var backgroundPage = chrome.extension.getBackgroundPage();

  $('#pair-me-icon').on('click', function(e){
    e.preventDefault();
    $.ajax({
      url: "http://localhost:9393/session",
      type: "post",
      data: $('#pair_login').serialize(),
      dataType: 'json'
    })
    .done(function(data){
      backgroundPage.currentView = '.duration-form';
      backgroundPage.user1 = data['user1'];
      backgroundPage.user2 = data['user2'];
      $('.sign-in').hide();
      $('.duration-form').show();
    })
    .fail(function(data){
      $('.auth-error').html("<p style='color:white;font-size:1em'><b>Authentication Failed Please Try Again</b></p>");
    });
  });

  $('button.start-pairing').on('click', function(){
    if($('input.duration').val() !== "" ){
      backgroundPage.setTimeInterval(parseInt($('input.duration').val()));
      backgroundPage.startPairing();
    } else {
      alert("Please Enter A Real Number");
    }
    backgroundPage.currentView='.running-session';
    setPopupView();
  });

  $('.pause-pairing').on('click', function(){
    if(backgroundPage.pause()){
      $('#pause-button').hide();
      $('#resume-button').show();
    }else{
      $('#resume-button').hide();
      $('#pause-button').show();
    }

  });

  $('.exit-pairing').on('click', function(){
    backgroundPage.endPairingSession();
  });
  backgroundPage.getPopup();
  backgroundPage.updateTimerCountdown();

  function setPopupView(){
    var currentView = backgroundPage.currentView;
    if(currentView){
      $('.sign-in').hide();
      $('.duration-form').hide();
      $('.running-session').hide();
      $(currentView).show();
    }
  }

  setPopupView();
});
@@ -529,24 +529,80 @@
 m').show();%0A
+      $('input').val('')%0A      $('countdown').val('0');%0A
     %7D)%0A    .
@@ -655,95 +655,109 @@
 ml(%22
-%3Cp style='color:white;font-size:1em'%3E%3Cb%3EAuthentication Failed Please Try Again%3C/b%3E%3C/p%3E%22
+Authentication Failed Please Try Again%22);%0A      setTimeOut(function()%7B$('.auth-error').empty();%7D,5000
 );%0A 
@@ -775,22 +775,16 @@
 ;%0A%0A  $('
-button
 .start-p
@@ -820,19 +820,36 @@
 ()%7B%0A    
-if(
+var time_duration = 
 $('input
@@ -869,16 +869,72 @@
 al()
- !== %22%22 
+;%0A    if(time_duration !== %22%22 && !isNaN(parseInt(time_duration))
 )%7B%0A 
@@ -982,33 +982,21 @@
 Int(
-$('input.duration').val()
+time_duration
 ));%0A
@@ -1038,68 +1038,8 @@
 ;%0A  
-  %7D else %7B%0A      alert(%22Please Enter A Real Number%22);%0A    %7D%0A
     
@@ -1089,16 +1089,18 @@
 n';%0A    
+  
 setPopup
@@ -1103,24 +1103,183 @@
 opupView();%0A
+    %7D else %7B%0A      $('.interval-error').append(%22The Number You Entered Is Not Valid%22);%0A      setTimeout(function()%7B$('.interval-error').empty();%7D,5000);%0A    %7D%0A
   %7D);%0A%0A  $('

Add Checks/Error Messaging to Interval Selector