text:   /*****************Upload images*************************/ 
    var loadFile = function(event) {
      var reader = new FileReader();
      reader.onload = function(){
        var output = document.getElementById('output');
        output.src = reader.result
      };
      reader.readAsDataURL(event.target.files[0]);
    };
   /** end upload images **/ 
  $(document).ready(function(){
  
      $(function () {
  
  	    $(".textarea").wysihtml5();
  
  	});
  
  });
  
  function FormatNumber(obj) {
  
      var strvalue;
  
      if (eval(obj))
  
          strvalue = eval(obj).value;
  
      else
  
          strvalue = obj; 
  
      var num;
  
      num = strvalue.toString().replace(/\$|\,/g,'');
  
  
  
      if(isNaN(num))
  
      num = "";
  
      sign = (num == (num = Math.abs(num)));
  
      num = Math.floor(num*100+0.50000000001);
  
      num = Math.floor(num/100).toString();
  
      for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
  
      num = num.substring(0,num.length-(4*i+3))+','+
  
      num.substring(num.length-(4*i+3));
  
      //return (((sign)?'':'-') + num);
  
      eval(obj).value = (((sign)?'':'-') + num);
  
  }
  
  function isNumberKey(evt)
  
  {
  
     var charCode = (evt.which) ? evt.which : event.keyCode
  
     if (charCode > 31 && (charCode < 48 || charCode > 57))
  
     return false;
  
     return true;
  
  }
  
  
  
  $(document).ready( function ( e ){
  
      $('input#txtName').keyup(function(event) {
  
  		var title, slug;
  
  	
  
          title = $(this).val();
  
  
  
          slug = title.toLowerCase();
  
  
  
          slug = slug.replace(/á|à|ả|ạ|ã|ă|ắ|ằ|ẳ|ẵ|ặ|â|ấ|ầ|ẩ|ẫ|ậ/gi, 'a');
  
          slug = slug.replace(/é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ/gi, 'e');
  
          slug = slug.replace(/i|í|ì|ỉ|ĩ|ị/gi, 'i');
  
          slug = slug.replace(/ó|ò|ỏ|õ|ọ|ô|ố|ồ|ổ|ỗ|ộ|ơ|ớ|ờ|ở|ỡ|ợ/gi, 'o');
  
          slug = slug.replace(/ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự/gi, 'u');
  
          slug = slug.replace(/ý|ỳ|ỷ|ỹ|ỵ/gi, 'y');
  
          slug = slug.replace(/đ/gi, 'd');
  
          slug = slug.replace(/\`|\~|\!|\@|\#|\||\$|\%|\^|\&|\*|\(|\)|\+|\=|\,|\.|\/|\?|\>|\<|\'|\"|\:|\;|_/gi, '');
  
          slug = slug.replace(/ /gi, "-");
  
          slug = slug.replace(/\-\-\-\-\-/gi, '-');
  
          slug = slug.replace(/\-\-\-\-/gi, '-');
  
          slug = slug.replace(/\-\-\-/gi, '-');
  
          slug = slug.replace(/\-\-/gi, '-');
  
          slug = '@' + slug + '@';
  
          slug = slug.replace(/\@\-|\-\@|\@/gi, '');
  
          
  
          $('input#txtAlias').val(slug);
  
  	});
  
  });
  
  
  
  $(document).ready(function(){
  
      $('#addImages').click(function(){
  
          $('#insert').append('<div class="form-group"><input type="file" name="fEditDetail[]"></div>');
  
      });
  
  });
  
  
  
  
  
  $('.alert_thongbao').delay(3000).slideUp();
  
  $(function () {
  
    $("#example1").DataTable();
  
    $('#example2').DataTable({
  
      "paging": true,
  
      "lengthChange": false,
  
      "searching": false,
  
      "ordering": true,
  
      "info": true,
  
      "autoWidth": false
  
    });
  
  });
  
  // send email
  
  $(document).ready(function(){
  
      $('#addFile').click(function(){
  
          $('#insertBtnFile').append('<div class="form-group"><input type="file" name="inpFile[]"></div>');
  
      });
  
  });
  
  
  
  $(document).ready(function(){
  
      $('#chkAll').change(function(event){
  
          var checkAll = $('#chkAll:checked').length > 0;
  
  
  
          if (checkAll) {
  
              $('input[name="chkEmail[]"]').prop('checked', true);
  
          }else{
  
              $('input[name="chkEmail[]"]').prop('checked', false);
  
          }
  
      });
  
  });
  
  
  