
function showLastBoard(){
  lastBoard = getCookie( 'ckBH_lastBoard' );

  document.write('<h5><span style="color:yellow">◆</span> 最近閱覽看板</h5>');
  document.write('<div class="BH-rbox BH-list1">');
  document.write('<ul>');

  if(lastBoard){
    barr1 = lastBoard.split(',,,');
    for(i=0; i<barr1.length; i++){
      barr2 = barr1[i].split('@@@');
      document.write('<li><a href="http://forum.gamer.com.tw/A.php?bsn='+barr2[0]+'">'+unescape(barr2[1])+'</a></li>');
    }
  }

  document.write('</ul>');
  document.write('</div>');
}

function setLastBoard(bsn, btitle){
  btitle = escape(btitle);
  tb = bsn+'@@@'+btitle;
  cookieID = 'ckBH_lastBoard';
  lastBoard = getCookie( cookieID );

  barr = new Array();
  barr.push(tb);

  if(lastBoard){
    lbarr = lastBoard.split(',,,');
    var length = lbarr.length;
    for(i=0; i<length; i++){
      pb = lbarr.shift();
      if(pb != tb){
        barr.push(pb);
      }

    }
    if(barr.length>10){
      barr.pop();
    }
  }
  newBoard = barr.join(',,,');
 
//設定cookie
  days = 14;
  var date = new Date();
  date.setTime(date.getTime()+(days*86400000));
  var expires = "; expires="+date.toGMTString();

  if( isIE() ){
    document.cookie = escape(cookieID)+"="+escape(newBoard)+expires+"; domain=gamer.com.tw";
    //document.cookie = escape(cookieID)+"="+escape(newBoard)+expires+"; path=/";
  }
  else{
    document.cookie = cookieID+"="+newBoard+expires+"; domain=gamer.com.tw";
    //document.cookie = cookieID+"="+newBoard+expires+"; path=/";
  }
}
