// 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=0, 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 == "vctp_thumbnail") {
  thumbwid = 120;
  thumbheig= 90;
    }
   
 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;
      
        document.writeln('<td width="124">');
// FLASH
        if(public_performers.getPerformer(username)) {
		if (viewers >2 && viewers <7) {
        document.writeln('<table width="124" height="160" border="0" cellpadding="0" cellspacing="0" background="http://www.yu-jyo.com/images/listch.gif" class="list_name">');
        }
		else if (viewers >6) {
        document.writeln('<table width="124" height="160" border="0" cellpadding="0" cellspacing="0" background="http://www.yu-jyo.com/images/listcg.gif" class="list_name">');
        }
        else {
        document.writeln('<table width="124" height="160" border="0" cellpadding="0" cellspacing="0" background="http://www.yu-jyo.com/images/listc.gif" class="list_name">');
        }
        }
        else if(private_performers.getPerformer(username)) {
        document.writeln('<table width="124" height="160" border="0" cellpadding="0" cellspacing="0" background="http://www.yu-jyo.com/images/listf.gif" class="list_name">');
        }
        else {
        document.writeln('<table width="124" height="160" border="0" cellpadding="0" cellspacing="0" background="http://www.yu-jyo.com/images/liste.gif" class="list_name">');
        }
        document.writeln('<tr><td height="5"></td></tr>');
        document.writeln('<tr><td>');
// SESSION TYPE
		if(public_performers.getPerformer(username)) {
		document.writeln('<img src="' + ownserver + '/images/icons/icon_public.gif" alt="チャット中" border="0">');
        }
		else if(private_performers.getPerformer(username)) {
		document.writeln('<img src="' + ownserver + '/images/icons/icon_private.gif" alt="２ショット" border="0">');
        }
        else {
        document.writeln('<img src="' + ownserver + '/images/icons/icon_free.gif" alt="待機中" border="0">');
        }
        document.writeln('</td></tr>');
        document.writeln('<tr><td align=center>');
        document.writeln('<A href="javascript:;" onClick="openAppWindow(\''+url+'\',\''+wname+'\','+popWidth+','+popHeight+')">');
        document.writeln('<IMG src="http://aff-images.dxlive.com'+getAttValueByAttName(''+imgType+'')+'" alt="'+username+'" border="0" width="'+thumbwid+'" height="'+thumbheig+'"></a>');
        document.writeln('</td></tr>');
        document.writeln('<tr><td height="20">');
        document.writeln('<A href="javascript:;" onClick="openAppWindow(\''+url+'\',\''+wname+'\','+popWidth+','+popHeight+')">'+username+'</a>');
        document.writeln('</td></tr>');
// ICONS
      if(this.icons) {
      if(this.lang) document.writeln('<tr>');
        var toy = (getAtt('has_remote_toy') == '1');
        var cam = (getAtt('has_hires') == '1');
        var mic = (getAtt('has_mic') == '1');
        var flower = (getAtt('new') == '1');
        var rec = ((getAtt('recommended') == '1') || (getAtt('recommended') == '2') || (getAtt('recommended') == '3'));

        document.writeln('<td align="center"><table height="20" border="0" cellpadding="0" cellspacing="0">');
        document.writeln('<tr><td>');
        if(toy) {
        document.writeln('<img src="' + ownserver + '/images/icons/icon_toy_shake.gif" alt="リモートバイブ対応">');
		document.writeln('</td><td>');
        }
        if(cam) {
        document.writeln('<img src="' + ownserver + '/images/icons/icon_HD.gif" alt="HD-ハイビジョン高画質">');
        document.writeln('</td><td>');
        }
        if(flower) {
        document.writeln('<img src="' + ownserver + '/images/icons/icon_newgirl.gif" alt="新人">');
        document.writeln('</td><td>');
        }
        if(mic) {
        document.writeln('<img src="' + ownserver + '/images/icons/icon_sound.gif" alt="マイク有り">');
        document.writeln('</td><td>');
        }
        if(rec) {
        document.writeln('&nbsp;');
        document.writeln('</td><td>');
        }
		if(viewers >0 && viewers <3) {
        document.writeln('<span class="num">' + viewers + '</span>');
		document.writeln('</td><td>');
        }
		if(viewers > 2) {
        if(flower && cam && mic) {
        document.writeln('<span class="num">' + viewers + '</span>');
		document.writeln('</td><td width="26">');
        document.writeln('&nbsp;');
        document.writeln('</td><td>');
        }
        else {
        document.writeln('<span class="num">' + viewers + '</span>');
		document.writeln('</td><td width="10">');
        document.writeln('&nbsp;');
        document.writeln('</td><td>');
        }
        }
		if(!flower && !cam && !mic && !rec) {
		document.writeln('&nbsp;');
        document.writeln('</td><td>');
        }
		document.writeln('&nbsp;');
		document.writeln('</td>');
// LANGUAGE FLAGS
      if(this.lang) {
        var vl = getAtt('language');
        var vc = 0;
        var vl_arr = vl.split(',');
        for(vid in vl_arr) {
        if(flag_files[vl_arr[vid]-1]) {
        vc += 1;
        if(vc < 4) {
        document.writeln('<td>');
        document.write("<img border=0 src='" + vctp_url + "/images/icons/"+ flag_files[vl_arr[vid]-1]+"' width=13 height=9 alt=''>");
        document.writeln('</td>');
        }
        }
        }
        }
		document.writeln('</tr></table></td></tr>');
        }

     	document.writeln('</table>'); 
        }

    	if (linebreak) document.writeln('<TR>');
    	count++; 
        }
        }
 	 	else {
  	    document.writeln('<TR><TD align="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" align="center">'); }
  else {
   document.writeln('<TR><TD class="performer_offline" align="center">'); }
 
  if (online) document.write('<TR><TD class="performer_online" align="center"><A href="javascript:;" onClick="openViewersChat(performer)"><img src="' + ownserver + '/images/button/now_online.gif" border="0" vspace="5"><br><img src="' + ownserver + '/images/button/go_chat.gif" border="0"></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="/profile.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(getAttValueByAttName('age')); document.write('</TD>');
    document.write('<TD>'); document.write(getAttValueByAttName('area')); document.write('</TD>'); 
    document.write('<TD>'); document.write(getAttValueByAttName('category')); document.write('</TD>');
    document.write('<TD>'); document.write(getAttValueByAttName('language')); document.write('</TD>');
    document.write('<TD>'); document.write(getAttValueByAttName('job')); document.write('</TD>');

	 } 
  }
 } 
