<!-- Notification sound -->
<audio id="failed">
  <source src="<?php echo $theme_link; ?>sound/failed.mp3" type="audio/mpeg">
  <source src="<?php echo $theme_link; ?>sound/failed.ogg" type="audio/ogg">
</audio>
<audio id="success">
  <source src="<?php echo $theme_link; ?>sound/success.mp3" type="audio/mpeg">
  <source src="<?php echo $theme_link; ?>sound/success.ogg" type="audio/ogg">
</audio>
<script type="text/javascript">
  var failed_sound = document.getElementById("failed"); 
  var success_sound = document.getElementById("success"); 
</script>

<script>
  $(document).ready(function() {
    if(/Mobi/i.test(navigator.userAgent)) {
      //alert("Mobile device detected");
      $('#c_balanceArea').attr('hidden',false);
      $('#cusArea').attr('hidden',false);
      $('#supArea').attr('hidden',false);
      $('#expArea').attr('hidden',false);
      $('#reportArea').attr('hidden',false);
    } else {
      document.onkeydown = fkey;
      document.onkeypress = fkey
      document.onkeyup = fkey;

      var wasPressed = false;

      function fkey(e){
              e = e || window.event;
            if( wasPressed ) return; 

            var userID = "<?php echo $this->session->userdata('inv_userid'); ?>";
          // if(userID=="1"||userID=="43"){

              if (e.keyCode == 113) {
                $('#c_balanceArea').attr('hidden',false);
                $('#cusArea').attr('hidden',false);
                $('#supArea').attr('hidden',false);
                $('#expArea').attr('hidden',false);
                $('#reportArea').attr('hidden',false);
                  wasPressed = true;
              }else {
                $('#c_balanceArea').attr('hidden',true);
                $('#cusArea').attr('hidden',true);
                $('#supArea').attr('hidden',true);
                $('#expArea').attr('hidden',true);
                $('#reportArea').attr('hidden',true);
              }
            // }
      }
    }
  });
</script>


<script type="text/javascript">
<?php if($this->session->flashdata('success')!=''){ ?>
      success_sound.play();
<?php } ?>
<?php if($this->session->flashdata('failed')!=''){ ?>
      failed_sound.play();
<?php } ?>
</script>
<!-- Notification end -->