// EXtended Vars


if(typeof(ownserver) == "undefined") {
  ownserver = "http://aff-jp.dxlive.com";
   }

function openAppWindow(url, name, width, height, wincfg) {
if(!wincfg) wincfg = 'resizable=yes, toolbar=no, scrollbars=auto, personalbar=no, menubar=no, width='+width+', height='+height;
var w = window.open(url,name,wincfg);
w.focus();
}

Performers.prototype.list= function(perLine, popUrl, popName, popWidth, popHeight, howMany, keepOrder, imgType, type ) {
 if(!popUrl) {
   var popUrl = "launch_free.html";
   var popName = 'FreeView';
   var popWidth = 760;
   var popHeight = 600;
   var winconfig = false;
   if(document.location.href.indexOf('/viewers/') != -1 ||
     document.location.href.indexOf('/video_chat/') != -1 ) { 
     popUrl = "vc_frameset.shtml";
     popName = '';
     winconfig = "left=0, Top=0, width=" + screen.width + ", height=" + screen.height + ", menubar=0, resizable=yes, toolbar=0, scrollbars=0, status=0"; 
   }
 }
  if( (typeof(imgType) == "undefined") || (imgType == "") ) {
  imgType = "live_thumbnail";
  }
var thumbwid = 80;
var thumbheig= 60;

 if(imgType == "snapshot") {
 thumbwid = 160;
 thumbheig= 120;
   }

 var url = popUrl;
 var wname = popName;
 with (this) {
  if (length) {
   document.writeln('<tr>');
   var count=1;
   var keys = new Array();
   var i = 0;
   for (var perf in performers) {
      if(type == "NEW") {
       with(performers[perf]){
if(getAtt('new') == '1') 
             keys[i++] = perf;
}
     }
      else if(type == "HQ"){
         with(performers[perf]){
           //var arr = getAttributeValueId(113);
           if( getAtt('has_hires') == '1' && getAtt('has_mic') == '1')
             keys[i++] = perf;
         }
      }

      else if(type == "REC"){
         with(performers[perf]){
           if( getAtt('recommended') == '1' )
             keys[i++] = perf;
         }
      }

      else
        keys[i++] = perf;
  }

   if(!keepOrder) keys.sort(randomizeOrder);
   for(i = 0; i < keys.length; i++) {
    if(howMany && i >= howMany) break;
    var linebreak=((count%perLine)==0);
    var k = keys[i];
    with (performers[k]) {
      if(popUrl.indexOf('?') == -1) url = popUrl + "?"+username;
      if(popName == '') wname = username;

if(private_performers.getPerformer(username))
document.writeln('<td class="top"><table cellpadding="0" cellspacing="0" style="width: 93px; height: 140px; background-color: #996396; border: 1px solid #8D3B6B; background-image: url(/images/list_bg2.jpg); background-repeat: repeat-x; background-position: center bottom"><tr><td class="center" style="font-size: 10px"><a href="profile.shtml?' + username + '" target="_blank" style="color: #FFFFFF; text-decoration: none">'+username+'</a></td></tr><tr><td class="center" style="padding-bottom: 2px"><a href="preview.shtml?' + username + '" target="_blank"><img src="http://aff-images.dxlive.com'+getAttValueByAttName(''+imgType+'')+'" alt="パフォーマー - '+username+'" width="'+thumbwid+'" height="'+thumbheig+'"></a></td></tr><tr><td class="center"><a href="'+ownserver+'/viewers/mail.html"><img src="'+ownserver+'/images/icon_mail.gif" width="41" height="13" alt="メール"></a></td></tr>');
else if(viewers >= 3)
document.writeln('<td class="top"><table cellpadding="0" cellspacing="0" style="width: 93px; height: 140px; background-color: #FFF7FA; border: 1px solid #ED94B2; background-image: url(/images/pika.gif); background-repeat: repeat-x; background-position: center bottom"><tr><td class="center" style="font-size: 10px"><a href="profile.shtml?' + username + '" target="_blank" style="color: #E6487C; text-decoration: none">'+username+'</a></td></tr><tr><td class="center" style="padding-bottom: 2px"><a href="preview.shtml?' + username + '" target="_blank"><img src="http://aff-images.dxlive.com'+getAttValueByAttName(''+imgType+'')+'" alt="パフォーマー - '+username+'" width="'+thumbwid+'" height="'+thumbheig+'"></a></td></tr><tr><td class="center"><a href="'+ownserver+'/viewers/mail.html"><img src="'+ownserver+'/images/icon_mail.gif" width="41" height="13" alt="メール"></a></td></tr>');
else if (public_performers.getPerformer(username))
document.writeln('<td class="top"><table cellpadding="0" cellspacing="0" style="width: 93px; height: 140px; background-color: #FFD034; border: 1px solid #EC7D23; background-image: url(/images/list_bg3.jpg); background-repeat: repeat-x; background-position: center bottom"><tr><td class="center" style="font-size: 10px"><a href="profile.shtml?' + username + '" target="_blank" style="color: #CF6712; text-decoration: none">'+username+'</a></td></tr><tr><td class="center" style="padding-bottom: 2px"><a href="preview.shtml?' + username + '" target="_blank"><img src="http://aff-images.dxlive.com'+getAttValueByAttName(''+imgType+'')+'" alt="パフォーマー - '+username+'" width="'+thumbwid+'" height="'+thumbheig+'"></a></td></tr><tr><td class="center"><a href="'+ownserver+'/viewers/mail.html"><img src="'+ownserver+'/images/icon_mail.gif" width="41" height="13" alt="メール"></a></td></tr>');
else if(getPerformer(username))
document.writeln('<td class="top"><table cellpadding="0" cellspacing="0" style="width: 93px; height: 140px; background-color: #FFF7FA; border: 1px solid #ED94B2; background-image: url(/images/list_bg.jpg); background-repeat: repeat-x; background-position: center bottom"><tr><td class="center" style="font-size: 10px"><a href="profile.shtml?' + username + '" target="_blank" style="color: #E6487C; text-decoration: none">'+username+'</a></td></tr><tr><td class="center" style="padding-bottom: 2px"><a href="preview.shtml?' + username + '" target="_blank"><img src="http://aff-images.dxlive.com'+getAttValueByAttName(''+imgType+'')+'" alt="パフォーマー - '+username+'" width="'+thumbwid+'" height="'+thumbheig+'"></a></td></tr><tr><td class="center"><a href="'+ownserver+'/viewers/mail.html"><img src="'+ownserver+'/images/icon_mail.gif" width="41" height="13" alt="メール"></a></td></tr>');

// SESSION TYPE
if(public_performers.getPerformer(username)) {
document.writeln('<tr><td style="font-size: 8px; font-family: ＭＳ ゴシック; color: #FFFFFF; line-height: 15px" class="center">パーティチャット');
if(viewers > 0 && this.view_count);
document.write('<span style="font-size: 10px;">(' + viewers + ')</span>');
document.writeln('</td></tr>');
}
else if(private_performers.getPerformer(username)) {
document.writeln('<tr><td style="font-size: 8px; font-family: ＭＳ ゴシック; color: #FFFFFF; line-height: 15px" class="center">２ショットチャット');
if(viewers > 0 && this.view_count);
document.write('<span style="font-size: 10px;">(' + viewers + ')</span>');
document.writeln('</td></tr>');
}
else if(getPerformer(username))
document.writeln('<tr><td style="font-size: 8px; font-family: ＭＳ ゴシック; color: #ED94B2; line-height: 15px" class="center">スタンバイ</a></td></tr>');

if(this.icons) {
   if(this.lang) document.writeln('<tr>');
   var toy = getAttributeValueId(537);
   var flower = (getAtt('new') == '1');
var rec = (getAtt('recommended') == '1');
var rec2 = (getAtt('recommended') == '2');
var rec3 = (getAtt('recommended') == '3');
   var mic = (getAtt('has_mic') == '1');
   var cam = (getAtt('has_hires') == '1');
   document.writeln('<td class="center">');
   if(flower) {
   document.writeln('<img src="http://www.happening-room.com/images/icons/icon1.gif" width="16" height="16" alt="新人" class="middle">');
   }
   if(rec || rec2 || rec3) {
   document.writeln('<img src="http://www.happening-room.com/images/icons/icon6.gif" width="16" height="16" alt="おすすめ" class="middle">');
   }
   if(mic) {
   document.writeln('<img src="http://www.happening-room.com/images/icons/icon2.gif" width="16" height="16" alt="マイク" class="middle">');
   }
   if(cam) {
   document.writeln('<img src="http://www.happening-room.com/images/icons/icon3.gif" width="16" height="16" alt="高画質" class="middle">');
   }
   if(toy==1) {
   document.writeln('<img src="http://www.happening-room.com/images/icons/icon4.gif" width="16" height="16" alt="リモコンバイブ" class="middle">');
   }
   if(toy==2) {
   document.writeln('<img src="http://www.happening-room.com/images/icons/icon5.gif" width="16" height="16" alt="リモコンバイブ" class="middle">');
   }
   if(!flower && !rec && !mic && !cam)
   document.writeln('<img src="http://www.happening-room.com/images/icons/spacer.gif" width="21" height="13" alt="" class="middle">');
   document.writeln('</td></tr>');
}

     document.writeln('</table>'); }

    if (linebreak) document.writeln('<tr>');
    count++; 
}
}
  else {
   document.writeln('<tr><td class="center" class="performers_offline"><img src="' + ownserver + '/images/no_performers.gif"></td>'); 
}
}
}

var flag_files = new Array('flag-jp.gif','flag-en.gif','flag-kr.gif','flag-ch','flag-ch','flag-fr','flag-sp','flag-it');

// NEW PRINT

function vclist_performer (performer) {
 performer.vcprint();
}

Performer.prototype.vcprint=function() {
 var online=0;
 with (this) {

  if (online_performers.getPerformer(username)) online=1;
  if (online) {
   document.writeln('<tr><td class="performer_online">'); }
  else {
   document.writeln('<tr><td class="performer_offline">'); }
 
  if (online) document.write('<tr><td class="performer_online"><a href="javascript:;" onclick="openViewersChat(performer)"><img src="' + ownserver + '/images/button/now_online.gif"><br><img src="' + ownserver + '/images/button/go_chat.gif"></a>');
document.write('</td></tr>'); }  }



// search list * Target blank

function list_performers (performers) {
if(performers.performers)
performers = performers.performers;
  for (var performer in performers) {
   with (performers[performer]) {
    document.writeln('<tr>');
    document.write('<td><a href="/preview.shtml?'+username+'" target="_blank">'); writeImageAttribute('live_thumbnail', 80, 60, 'Live Thumbnail - '+username); document.write('</a></td>');
    document.write('<td><a href="/profile.shtml?'+username+'" target="_blank">'); document.write(username); document.write('</a></td>');
    document.write('<td>'); document.write(getAtt('age')); document.write('</td>');
    document.write('<td>'); document.write(getAtt('area')); document.write('</td>'); 
    document.write('<td>'); document.write(getAtt('category')); document.write('</td>');
    document.write('<td>'); document.write(getAtt('language')); document.write('</td>');
    document.write('<td>'); document.write(getAtt('job')); document.write('</td>');
}
}
}
