function avatarDEMO(c1, c2, type, machine){
  ary = forumRandAvatar();
  key = Math.round(Math.random()*(ary.length))%(ary.length-1)+1;
  strs = ary[key];

  //strs = forumRandAvatar();
  strArr = strs.split('<>');
  sn = strArr[0];
  sex = strArr[1];
  race = strArr[2];
  layer = parseInt(strArr[3]);
  title = strArr[4];

  //陣列0的值儲存該資料中心代號下的勇造數量,0表示無對應的勇造，連到新品屋
  otherLink = (ary[0] == 'this')? '<a href="http://avatar1.gamer.com.tw/shop.php?s=1&gsn='+c1+'_'+c2+'" target="_blank"><img src="http://pic.bahamut.com.tw/forum/avatarOthers.gif" width="110" height="15" border=0></a>':'<a href="http://avatar1.gamer.com.tw/shop.php?c1=all&c2=all" target="_blank"><img src="http://pic.bahamut.com.tw/forum/avatarOthers2.gif" width="110" height="15" border=0></a>';

  //判斷用哪張素體
  bodylayer = 52;

  //判斷圖層次序
  if(layer > bodylayer){
    imgtop = 'http://avatar2.bahamut.com.tw/objectpic/'+sn+'.png';
    imgdown = 'http://pic.bahamut.com.tw/avatar/gbody_'+sex+'_'+race+'.png';
  }
  else{
    imgtop = 'http://pic.bahamut.com.tw/avatar/gbody_'+sex+'_'+race+'.png';
    imgdown = 'http://avatar2.bahamut.com.tw/objectpic/'+sn+'.png';
  }

  document.write('<div style="position:relative; z-index:1">');
  document.write('<table width="173" border="0" cellspacing="0" cellpadding="0">');
  document.write('  <tr>');
  document.write('    <td class="post_title">勇者造型展示區</td>');
  document.write('  </tr>');
  document.write('</table>');
  document.write('<table width="173" border="0" cellpadding="0" cellspacing="0" class="postbox2">');
  document.write('  <tr>');
  document.write('    <td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="postboxin">');
  document.write('        <tr>');
  document.write('          <td height="10"><img src="http://pic.bahamut.com.tw/spacer.gif" width="1" height="1"></td>');
  document.write('        </tr>');
  document.write('        <tr>');
  document.write('          <td align="center" class="home_t1 home_h3 home_c1"><a href="http://avatar1.gamer.com.tw/detail.php?sn='+sn+'" target="_blank">'+title+'</a></td>');
  document.write('        </tr>');
  document.write('        <tr>');

  document.write('          <td align="center" class="home_t1 home_h3 home_c1"><div style="background:url('+imgdown+');width:110px; height:160px; z-index:1; position:relative;"><a href="http://avatar1.gamer.com.tw/detail.php?sn='+sn+'" target="_blank">');

  //判斷瀏覽器
  if('Microsoft Internet Explorer' == navigator.appName){
    document.write('<img src="http://pic.bahamut.com.tw/spacer.gif" style="display:none !important;display:inline; width: 110px; height: 160px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+imgtop+'\', sizingMethod=\'crop\');" border=0/>');
  }
  else if('Netscape' == navigator.appName){
    document.write('<img src="'+imgtop+'" width="110" height="160" border="0" style="z-index:2; position:relative;">');
  }

  document.write('</a></div></td>');


  document.write('        </tr>');
  document.write('        <tr>');
  document.write('          <td align="center" class="home_t1 home_h3 home_c1">'+otherLink+'</td>');
  document.write('        </tr>');
  document.write('        <tr>');
  document.write('          <td height="10"><img src="http://pic.bahamut.com.tw/spacer.gif" width="1" height="1"></td>');
  document.write('        </tr>');
  document.write('    </table></td>');
  document.write('  </tr>');
  document.write('</table>');
  document.write('</div>');
}

function blogDEMO(){
  key = Math.round(Math.random()*(darenForum.length))%(darenForum.length-1)+1;

  var u = darenForum[key][0].toLowerCase();
  var ua = blogForum3[key][0].toLowerCase();
  
  document.write('<div style="position:relative; z-index:1">');
  document.write('<table width="173" border="0" cellspacing="0" cellpadding="0">');
  document.write('  <tr>');
  document.write('    <td class="post_title">勇者小屋新文章</td>');
  document.write('  </tr>');
  document.write('</table>');
  document.write('<table width="173" border="0" cellpadding="0" cellspacing="0" class="postbox2">');
  document.write('  <tr>');
  document.write('    <td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="postboxin">');
  document.write('      <tr>');
  document.write('        <td height="10"><img src="http://pic.bahamut.com.tw/spacer.gif" width="1" height="1"></td>');
  document.write('      </tr>');
  document.write('      <tr>');
  document.write('        <td class="home_t1 home_h3 home_c1"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="wide_titlebar">');
  document.write('          <tr>');
  document.write('            <td width="30%" rowspan="2"><a href="http://home.gamer.com.tw/' + darenForum[key][0] + '" target="_blank"><img src="http://avatar2.bahamut.com.tw/avataruserpic/'+ u.substr(0, 1) + '/'+ u.substr(1, 1) + '/'+ u + '/'+ u + '_s.png" width="40" height="40" border="0"></a></td>');
  document.write('            <td width="70%" class="tsmal">' + darenForum[key][0] + '</td>');
  document.write('          </tr>');
  document.write('          <tr>');
  document.write('            <td class="tsmal">' + darenForum[key][1] + '</td>');
  document.write('          </tr>');
  document.write('        </table></td>');
  document.write('      </tr>');
  document.write('      <tr>');
  document.write('        <td class="home_t1 home_h3 home_c1"><a href="' + darenForum[key][2] + '" target="_blank">' + darenForum[key][3] + '</a></td>');
  document.write('      </tr>');
  document.write('      <tr>');
  document.write('        <td height="10" class="post_line2"><img src="http://pic.bahamut.com.tw/spacer.gif" width="1" height="1"></td>');
  document.write('      </tr>');
  document.write('    </table>');
  document.write('    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="postboxin">');
  document.write('      <tr>');
  document.write('        <td height="10"><img src="http://pic.bahamut.com.tw/spacer.gif" width="1" height="1"></td>');
  document.write('      </tr>');
  document.write('      <tr>');
  document.write('        <td class="home_t1 home_h3 home_c1"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="wide_titlebar1">');
  document.write('          <tr>');
  document.write('            <td width="30%" rowspan="2"><a href="http://home.gamer.com.tw/' + blogForum3[key][0] + '" target="_blank"><img src="http://avatar2.bahamut.com.tw/avataruserpic/'+ ua.substr(0, 1) + '/'+ ua.substr(1, 1) + '/'+ ua + '/'+ ua + '_s.png" width="40" height="40" border="0"></a></td>');
  document.write('            <td width="70%" class="tsmal">' + blogForum3[key][0] + '</td>');
  document.write('          </tr>');
  document.write('          <tr>');
  document.write('            <td class="tsmal">' + blogForum3[key][1] + '</td>');
  document.write('          </tr>');
  document.write('        </table></td>');
  document.write('      </tr>');
  document.write('      <tr>');
  document.write('        <td class="home_t1 home_h3 home_c1"><a href="' + blogForum3[key][2] + '" target="_blank">' + blogForum3[key][3] + '</a></td>');
  document.write('      </tr>');
  document.write('      <tr>');
  document.write('        <td height="10"><img src="http://pic.bahamut.com.tw/spacer.gif" width="1" height="1"></td>');
  document.write('      </tr>');
  document.write('    </table>');
  document.write('    </td>');
  document.write('  </tr>');
  document.write('</table>');
  document.write('</div>');
}

