(function($) {
  $(document).ready(function() {
  
    $('.view-system-status .popup').hide();
    $('.view-system-status .popup-link a') .click(function() {
      //uniqueClass = Math.round(new Date().getTime() / 1000);
      //$(this).parent().parent().parent().addClass('activepopup ' + uniqueClass);
      $('body').append('<div id="popup-content"></div><div class="liveoffice-js-overlay"></div>');
      var content = $(this).parent().parent().parent().find('td.popup').html();
      $('#popup-content').html(content);

			// hide all popups when clicking away or clicking on the close button.
      $('.close-btn a').click(function() {
        $('#popup-content').remove();
        $('.liveoffice-js-overlay').remove();
        return false;        
      });

      return false;  
    });
   
//Contact Us Block

			$('#block-block-7').hide();
	    $('.call-us.popup-link a') .click(function() {
	      $('body').append('<div id="popup-content"></div><div class="liveoffice-js-overlay"></div>');
        var content = $('div.call-pop').html();
        $('#popup-content').html(content);
        // hide all popups when clicking away or clicking on the close button.
        $('.close-btn a').click(function() {
          $('#popup-content').remove();
          $('.liveoffice-js-overlay').remove();
          return false;        
        });
        $('.phone').hide();
        $('.call-open') .click(function() {
          $('.phone').css('display', 'inline');
          return false;  
        });

 	      return false;  
	    });
    
    $(document).click(function(e) {
      if(!$(e.target).parents().andSelf().is('#popup-content')) {
        $('#popup-content').remove();
        $('.liveoffice-js-overlay').remove();
      } 
   });
  
  });  
})(jQuery)
;

