

function truncate() {
  var len = 0;
  var p = document.getElementById('NhaDat');
  var p1 = document.getElementById('DoanhNghiep');
  var p2 = document.getElementById('ThuongMai');
  var p3 = document.getElementById('SoHuuTriTue');
  var p4 = document.getElementById('BaoHiem');
  var p5 = document.getElementById('ThuaKe');
  var p6 = document.getElementById('HonNhanGiaDinh');
  var p7 = document.getElementById('LaoDong');
  var p8 = document.getElementById('HoatDongToTung');  
  if (p) {
    var trunc = p.innerHTML;
    if (trunc.length > len) {

      /* Truncate the content of the P, then go back to the end of the
         previous word to ensure that we don't truncate in the middle of
         a word */
      trunc = trunc.substring(0, len);
      trunc = trunc.replace(/\w+$/, '');

      /* Add an ellipses to the end and make it a link that expands
         the paragraph back to its original size */
      trunc += '<a href="#" ' +
        'onclick="this.parentNode.innerHTML=' +
        'unescape(\''+escape(p.innerHTML)+'\');return false;">' +
        '<span >[ Chi Tiết... ]</span><\/a>';
      p.innerHTML = trunc;
    }
  }
  
  
  if (p1) {
    var trunc = p1.innerHTML;
    if (trunc.length > len) {

      /* Truncate the content of the P, then go back to the end of the
         previous word to ensure that we don't truncate in the middle of
         a word */
      trunc = trunc.substring(0, len);
      trunc = trunc.replace(/\w+$/, '');

      /* Add an ellipses to the end and make it a link that expands
         the paragraph back to its original size */
      trunc += '<a href="#" ' +
        'onclick="this.parentNode.innerHTML=' +
        'unescape(\''+escape(p1.innerHTML)+'\');return false;">' +
        '<span >[ Chi Tiết... ]</span><\/a>';
      p1.innerHTML = trunc;
    }
  }
  
  
  if (p2) {
    var trunc = p2.innerHTML;
    if (trunc.length > len) {

      /* Truncate the content of the P, then go back to the end of the
         previous word to ensure that we don't truncate in the middle of
         a word */
      trunc = trunc.substring(0, len);
      trunc = trunc.replace(/\w+$/, '');

      /* Add an ellipses to the end and make it a link that expands
         the paragraph back to its original size */
      trunc += '<a href="#" ' +
        'onclick="this.parentNode.innerHTML=' +
        'unescape(\''+escape(p2.innerHTML)+'\');return false;">' +
        '<span >[ Chi Tiết... ]</span><\/a>';
      p2.innerHTML = trunc;
    }
  }
  
  if (p3) {
    var trunc = p3.innerHTML;
    if (trunc.length > len) {

      /* Truncate the content of the P, then go back to the end of the
         previous word to ensure that we don't truncate in the middle of
         a word */
      trunc = trunc.substring(0, len);
      trunc = trunc.replace(/\w+$/, '');

      /* Add an ellipses to the end and make it a link that expands
         the paragraph back to its original size */
      trunc += '<a href="#" ' +
        'onclick="this.parentNode.innerHTML=' +
        'unescape(\''+escape(p3.innerHTML)+'\');return false;">' +
        '<span >[ Chi Tiết... ]</span><\/a>';
      p3.innerHTML = trunc;
    }
  }
  
  if (p4) {
    var trunc = p4.innerHTML;
    if (trunc.length > len) {

      /* Truncate the content of the P, then go back to the end of the
         previous word to ensure that we don't truncate in the middle of
         a word */
      trunc = trunc.substring(0, len);
      trunc = trunc.replace(/\w+$/, '');

      /* Add an ellipses to the end and make it a link that expands
         the paragraph back to its original size */
      trunc += '<a href="#" ' +
        'onclick="this.parentNode.innerHTML=' +
        'unescape(\''+escape(p4.innerHTML)+'\');return false;">' +
        '<span >[ Chi Tiết... ]</span><\/a>';
      p4.innerHTML = trunc;
    }
  }
  
  if (p5) {
    var trunc = p5.innerHTML;
    if (trunc.length > len) {

      /* Truncate the content of the P, then go back to the end of the
         previous word to ensure that we don't truncate in the middle of
         a word */
      trunc = trunc.substring(0, len);
      trunc = trunc.replace(/\w+$/, '');

      /* Add an ellipses to the end and make it a link that expands
         the paragraph back to its original size */
      trunc += '<a href="#" ' +
        'onclick="this.parentNode.innerHTML=' +
        'unescape(\''+escape(p5.innerHTML)+'\');return false;">' +
        '<span >[ Chi Tiết... ]</span><\/a>';
      p5.innerHTML = trunc;
    }
  }
  
  if (p6) {
    var trunc = p6.innerHTML;
    if (trunc.length > len) {

      /* Truncate the content of the P, then go back to the end of the
         previous word to ensure that we don't truncate in the middle of
         a word */
      trunc = trunc.substring(0, len);
      trunc = trunc.replace(/\w+$/, '');

      /* Add an ellipses to the end and make it a link that expands
         the paragraph back to its original size */
      trunc += '<a href="#" ' +
        'onclick="this.parentNode.innerHTML=' +
        'unescape(\''+escape(p6.innerHTML)+'\');return false;">' +
        '<span >[ Chi Tiết... ]</span><\/a>';
      p6.innerHTML = trunc;
    }
  }
  
  if (p7) {
    var trunc = p7.innerHTML;
    if (trunc.length > len) {

      /* Truncate the content of the P, then go back to the end of the
         previous word to ensure that we don't truncate in the middle of
         a word */
      trunc = trunc.substring(0, len);
      trunc = trunc.replace(/\w+$/, '');

      /* Add an ellipses to the end and make it a link that expands
         the paragraph back to its original size */
      trunc += '<a href="#" ' +
        'onclick="this.parentNode.innerHTML=' +
        'unescape(\''+escape(p7.innerHTML)+'\');return false;">' +
        '<span >[ Chi Tiết... ]</span><\/a>';
      p7.innerHTML = trunc;
    }
  }
  
  if (p8) {
    var trunc = p8.innerHTML;
    if (trunc.length > len) {

      /* Truncate the content of the P, then go back to the end of the
         previous word to ensure that we don't truncate in the middle of
         a word */
      trunc = trunc.substring(0, len);
      trunc = trunc.replace(/\w+$/, '');

      /* Add an ellipses to the end and make it a link that expands
         the paragraph back to its original size */
      trunc += '<a href="#" ' +
        'onclick="this.parentNode.innerHTML=' +
        'unescape(\''+escape(p8.innerHTML)+'\');return false;">' +
        '<span >[ Chi Tiết... ]</span><\/a>';
      p8.innerHTML = trunc;
    }
  }
  
  
  
}

// Multiple onload function created by: Simon Willison
// http://simon.incutio.com/archive/2004/05/26/addLoadEvent
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(function() {
  truncate();
});


