// 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=yes, 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 = 700;
   var popHeight = 650;
   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=1, status=0"; 
   }
 }
  if( (typeof(imgType) == "undefined") || (imgType == "") ) {
  imgType = "live_thumbnail";
  }
var thumbwid = 80;
var thumbheig= 60;


 if(imgType == "vctp_thumbnail") {
  thumbwid = 118;
  thumbheig= 89;
    }


 if(imgType == "snapshot") {
 thumbwid = 160;
 thumbheig= 120;
   }
   
//document.write('<script src="http://aff-jp.dxlive.com/include/js/topperformers.js"></script>');
    

 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' || getAtt('new') > 0)
             keys[i++] = perf;
        }
     }
      else if(type == "HQ"){
         with(performers[perf]){
           //var arr = getAttributeValueId(113);
           if(( getAtt('has_hires') == '1')
||  (getAtt('has_hires') > 0))
             keys[i++] = perf;
         }
      }

      else if(type == "remote_toy"){
         with(performers[perf]){
           if( getAtt('has_remote_toy') == '1')
             keys[i++] = perf;
         }
      } 

      else if(type == "REC"){
         with(performers[perf]){
           if( getAtt('recommended') == '1' || getAtt('recommended') > 0)
             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;

// サイズ強制指定
//  var popWidth = 700;
//  var popHeight = 650;


	
		
	document.writeln('<td  align="center">');
	
		switch(username){
			case "ako39":
			case "an07":
			case "aya25n":
			case "cocoa22":
			case "haruhi53":
			case "hinano13":
			case "honoka01n":
			case "mari09":
			case "mirei301":
			case "miu31":
			case "nao81vv":
			case "ran12n":
			case "rii31":
			case "rika10":
			case "rina15":
			case "ryo67n":
			case "sae26":
			case "sakura10n":
			case "yui12n":
			case "yuka73":
			case "yun38":
			case "yurino33":
			case "sherry77":
			case "rie55n":
			case "emi17":
			case "mina37n":
			case "tomo16n":
			case "kanako28n":
			case "mizuki18":
			case "anna10":
			case rankedPerformers[0]:
			case rankedPerformers[1]:
			case rankedPerformers[2]:
			case rankedPerformers[3]:
			case rankedPerformers[4]:
					document.writeln('<table  border="1" width="120" height="170" cellpadding="0" cellspacing="0" background="/images/osusume_bak.gif" style="background-repeat:no-repeat;margin-bottom:1px; margin-right:3px;">');
			break;
			default:
				if (viewers == 0 ){
				// 3人以上なら光る
					document.writeln('<table  border="1" width="120" height="170" cellpadding="0" cellspacing="0" background="" style="background-repeat:no-repeat;margin-bottom:1px; margin-right:3px;">');
				}else{
					if (viewers > 0 && viewers <= 2 ){
						document.writeln('<table  border="1" width="120" height="170" cellpadding="0" cellspacing="0" background="/images/bg_pink.gif" style="background-repeat:no-repeat;margin-bottom:1px; margin-right:3px;">');
					} else {
						document.writeln('<table  border="1" width="120" height="170" cellpadding="0" cellspacing="0" background="/images/bg_mura.gif" style="background-repeat:no-repeat;margin-bottom:1px; margin-right:3px;">');
					}
				}
		}
	// SESSION TYPE

//	document.writeln('<tr><td>');
	document.write('<tr><td width="120" height="25" align="left" valign="top">');
        if(this.icons) {
          var cam = (getAtt('has_hires') == '1');
		var toy = (getAtt('has_remote_toy') == '1');
	}
       if(cam){
          document.write('<img src="/images/icons/hd.gif"  ALIGN=TOP alt="高画質">');
	}		
	if(public_performers.getPerformer(username))
//		document.writeln('<img src="/images/icons/icon_public.gif"  alighn="left"><span class="num" title="'+username+'のチャット中人数：'+ viewers +'人" style="color:#ffffff;text-decoration:bold;font-family:ariel;font-size:11;align="absmiddle;">' + viewers + '</span></td></tr></table>');
//		document.writeln('<img src="http://aff-jp.dxlive.com/images/icons/icon_public.gif"  alighn="right"></td><td background="" width="5" height="18" align="right"><span class="num" title="'+username+'のチャット中人数：'+ viewers +'人" style="padding-left:13px;color:#ffffff;text-decoration:bold;font-family:ariel;font-size:11;align="absmiddle;">' + viewers + '</span></td></tr></table>');
        	if(cam){
			if (viewers < 10){
				if(toy==2){
//					document.writeln('<img src="/images/icons/toy_blink.gif" style="margin-top:4px;" ALIGN=center><span  title="'+username+'のチャット中人数：'+ viewers +'人" style="margin-top:15px;margin-left:14px;color:#ffffff;text-decoration:bold;font-family:ariel;font-size:12;align=absmiddle;">' + viewers + '</span></td></tr>');
					document.writeln('<img src="/images/icons/icon_public.gif" style="margin-top:4px;margin-left:7px;" ALIGN=center><span  title="'+username+'のチャット中人数：'+ viewers +'人" style="margin-top:15px;margin-left:14px;color:#ffffff;text-decoration:bold;font-family:ariel;font-size:12;align=absmiddle;">' + viewers + '</span></td></tr>');
				}else{
					document.writeln('<img src="/images/icons/icon_public.gif" style="margin-top:4px;margin-left:7px;" ALIGN=center><span  title="'+username+'のチャット中人数：'+ viewers +'人" style="margin-top:15px;margin-left:14px;color:#ffffff;text-decoration:bold;font-family:ariel;font-size:12;align=absmiddle;">' + viewers + '</span></td></tr>');
				}
			}else{
				if(toy==2){
//					document.writeln('<img src="/images/icons/toy_blink.gif" style="margin-top:4px;" ALIGN=center><span  title="'+username+'のチャット中人数：'+ viewers +'人" style="margin-top:15px;margin-left:8px;color:#ffffff;text-decoration:bold;font-family:ariel;font-size:12;align=absmiddle;">' + viewers + '</span></td></tr>');
					document.writeln('<img src="/images/icons/icon_public.gif" style="margin-top:4px;margin-left:7px;" ALIGN=center><span  title="'+username+'のチャット中人数：'+ viewers +'人" style="margin-top:15px;margin-left:8px;color:#ffffff;text-decoration:bold;font-family:ariel;font-size:12;align=absmiddle;">' + viewers + '</span></td></tr>');
				}else{
					document.writeln('<img src="/images/icons/icon_public.gif" style="margin-top:4px;margin-left:7px;" ALIGN=center><span  title="'+username+'のチャット中人数：'+ viewers +'人" style="margin-top:15px;margin-left:8px;color:#ffffff;text-decoration:bold;font-family:ariel;font-size:12;align=absmiddle;">' + viewers + '</span></td></tr>');
				}
			}
		}else{
			if (viewers < 10){
				if(toy==2){
//					document.writeln('<img src="/images/icons/toy_blink.gif" style="margin-top:4px;" ALIGN=center><span  title="'+username+'のチャット中人数：'+ viewers +'人" style="margin-top:15px;margin-left:38px;color:#ffffff;text-decoration:bold;font-family:ariel;font-size:12;align=absmiddle;">' + viewers + '</span></td></tr>');
					document.writeln('<img src="/images/icons/icon_public.gif" style="margin-top:4px;margin-left:7px;" ALIGN=center><span  title="'+username+'のチャット中人数：'+ viewers +'人" style="margin-top:15px;margin-left:38px;color:#ffffff;text-decoration:bold;font-family:ariel;font-size:12;align=absmiddle;">' + viewers + '</span></td></tr>');
				}else{
					document.writeln('<img src="/images/icons/icon_public.gif" style="margin-top:4px;margin-left:7px;" ALIGN=center><span  title="'+username+'のチャット中人数：'+ viewers +'人" style="margin-top:15px;margin-left:38px;color:#ffffff;text-decoration:bold;font-family:ariel;font-size:12;align=absmiddle;">' + viewers + '</span></td></tr>');
				}
			}else{
				if(toy==2){
//					document.writeln('<img src="/images/icons/toy_blink.gif" style="margin-top:4px;" ALIGN=center><span  title="'+username+'のチャット中人数：'+ viewers +'人" style="margin-top:15px;margin-left:28px;color:#ffffff;text-decoration:bold;font-family:ariel;font-size:12;align=absmiddle;">' + viewers + '</span></td></tr>');
					document.writeln('<img src="/images/icons/icon_public.gif" style="margin-top:4px;margin-left:7px;" ALIGN=center><span  title="'+username+'のチャット中人数：'+ viewers +'人" style="margin-top:15px;margin-left:28px;color:#ffffff;text-decoration:bold;font-family:ariel;font-size:12;align=absmiddle;">' + viewers + '</span></td></tr>');
				}else{
					document.writeln('<img src="/images/icons/icon_public.gif" style="margin-top:4px;margin-left:7px;" ALIGN=center><span  title="'+username+'のチャット中人数：'+ viewers +'人" style="margin-top:15px;margin-left:28px;color:#ffffff;text-decoration:bold;font-family:ariel;font-size:12;align=absmiddle;">' + viewers + '</span></td></tr>');
				}
			}
		}
	else if(private_performers.getPerformer(username))
//		document.writeln('<img src="/images/icons/twoshot.gif"  alt="２ショット中" style="margin-top:7px; margin-left:7px;" ALIGN=center></td></tr>');
        	if(cam){
			if (viewers < 10){
				document.writeln('<img src="/images/icons/twoshot.gif"  alt="２ショット中" style="margin-top:4px;margin-left:7px;" ALIGN=center><span  title="'+username+'のチャット中人数：'+ viewers +'人" style="margin-top:15px;margin-left:14px;color:#ffffff;text-decoration:bold;font-family:ariel;font-size:12;align=absmiddle;">' + viewers + '</span></td></tr>');
			}else{
				document.writeln('<img src="/images/icons/twoshot.gif" alt="２ショット中" style="margin-top:4px;margin-left:7px;" ALIGN=center><span  title="'+username+'のチャット中人数：'+ viewers +'人" style="margin-top:15px;margin-left:8px;color:#ffffff;text-decoration:bold;font-family:ariel;font-size:12;align=absmiddle;">' + viewers + '</span></td></tr>');
			}
		}else{
			if (viewers < 10){
				document.writeln('<img src="/images/icons/twoshot.gif"  alt="２ショット中" style="margin-top:4px;margin-left:7px;" ALIGN=center><span  title="'+username+'のチャット中人数：'+ viewers +'人" style="margin-top:15px;margin-left:38px;color:#ffffff;text-decoration:bold;font-family:ariel;font-size:12;align=absmiddle;">' + viewers + '</span></td></tr>');
			}else{
				document.writeln('<img src="/images/icons/twoshot.gif"  alt="２ショット中" style="margin-top:4px;margin-left:7px;" ALIGN=center><span  title="'+username+'のチャット中人数：'+ viewers +'人" style="margin-top:15px;margin-left:28px;color:#ffffff;text-decoration:bold;font-family:ariel;font-size:12;align=absmiddle;">' + viewers + '</span></td></tr>');
			}
		}
	else if(!public_performers.getPerformer(username) && !private_performers.getPerformer(username))//待機
		document.writeln('<img src="/images/icons/taiki.gif" alt="待機中" style="margin-top:5px;"ALIGN=center></td></tr>');
	document.writeln('</td></tr>');
		// SESSION TYPE
				//if(busy_performers.getPerformer(username) && !private_performers.getPerformer(username))
				// if(public_performers.getPerformer(username))
					// document.writeln('<td><img src="' + ownserver + '/shambara/images/icons/icon_public.gif" alt="チャット中" ></td>');
				// else if(private_performers.getPerformer(username))
				//   document.writeln('<td><img src="' + ownserver + '/shambara/images/icons/icon_private.gif" alt="２ショット中" ></td>');
				// else if(!public_performers.getPerformer(username) && !private_performers.getPerformer(username))//待機
				//   document.writeln('<td><img src="' + ownserver + '/shambara/images/icons/icon_free.gif" alt="待機中" ></td>');
			
//      document.writeln('<tr><td bgcolor="#FFDAB9" height="70" valign="top" align="center" class="txtOnline">');
      document.writeln('<tr><td height="70" valign="top" align="center" class="txtOnline">');
      document.writeln('<A href="#" onClick="openAppWindow(\''+url+'\',\''+wname+'\','+popWidth+','+popHeight+')">');
      document.writeln('<IMG src="http://aff-images.dxlive.com'+getAttValueByAttName(''+imgType+'')+'" alt="Live Thumbnail - '+username+'" border="0" width="'+thumbwid+'" height="'+thumbheig+'">');
      var showLength = 9 ; // 表示文字数
//      for (var i = 0; i < username.length; ++i)
//            with (username[i])
//              if (className == "syoryaku" && innerHTML.length > showLength)
//                innerHTML = innerHTML.substr(0, showLength) + '...' ;
//        }
	if (username.length > showLength){
		name_dsp =username.substr(0, showLength) + '...' ;
	}else{
		name_dsp =username ;
	}

			document.writeln('&nbsp;&nbsp;'+name_dsp+'&nbsp;&nbsp;</a></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 rec = ((getAtt('recommended') == '1') || (getAtt('recommended') == '2') || (getAtt('recommended') == '3'));
        	var mic = (getAtt('has_mic') == '1');
 		var flower = (getAtt('new') == '1');
		document.writeln('<td height="17" align="center"><table border="0" cellpadding="0" cellspacing="0">');
        	document.writeln('<tr><td>');
        if(toy==1)
                document.write('<img src="http://aff-jp.dxlive.com/VCTP/images/icons/icon_toy_shake.gif " >');
		document.writeln('</td><td>');
        if(toy==2)
                document.write('<img src=" http://aff-jp.dxlive.com/VCTP/images/icons/icon_toy_blink.gif " >');
		document.writeln('</td><td>');
        if(flower) 
		// アイコンオーナーサーバー指定//document.writeln('<img src="' + ownserver + '/images/icons/icon_newgirl.gif" alt="新人">');
	
					document.write('<img src="http://aff-jp.dxlive.com/images/icons/icon_newgirl.gif" alt="新人">');
        document.writeln('</td><td>');
//        if(cam)
//          document.write('<img src="http://aff-jp.dxlive.com/images/icons/icon_hirez.gif" alt="高画質">');
        document.writeln('</td><td>');
        if(mic)
          document.write('<img src="http://aff-jp.dxlive.com/images/icons/icon_sound.gif" alt="マイク">');
        document.writeln('</td><td>')
        if(rec)
          document.writeln('<img src="' + ownserver + '/images/icons/icon_flower.gif" alt="お薦め">');
        document.writeln('</td><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.write("<img border=0 src='" + vctp_url + "/images/icons/"+ flag_files[vl_arr[vid]-1]+"' width=13 height=9 alt=''>");
			        document.writeln('</td><td>');
			      }
        		}
		}
      	}


				if(!toy &&!flower && !cam && !mic && !rec && !this.lang) 
					document.writeln('&nbsp;');
				document.writeln('</td></tr></table></td></tr>');

			}
// PROFILE LINK
//				document.writeln('<tr><td height="10" align="right"><table border="0" cellpadding="1" cellspacing="1">');
//				document.writeln('<tr>');
//				document.writeln('<td><a href="/profile.shtml?' + username + '" target="_blank">');
//				document.writeln('<img src="' + ownserver + '/images/icons/icon_profile.gif" alt="Profile - PerformerName" border="0"></a>');
//				document.writeln('</td>');
// SESSION TYPE
				//if(busy_performers.getPerformer(username) && !private_performers.getPerformer(username))
				// if(public_performers.getPerformer(username))
					// document.writeln('<td><img src="' + ownserver + '/shambara/images/icons/icon_public.gif" alt="チャット中" ></td>');
				// else if(private_performers.getPerformer(username))
				//   document.writeln('<td><img src="' + ownserver + '/shambara/images/icons/icon_private.gif" alt="２ショット中" ></td>');
				// else if(!public_performers.getPerformer(username) && !private_performers.getPerformer(username))//待機
				//   document.writeln('<td><img src="' + ownserver + '/shambara/images/icons/icon_free.gif" alt="待機中" ></td>');

 
//     		document.writeln('</tr></table></td></tr></table>'); }
   		document.writeln('</tr></table>'); }

                    if (linebreak) document.writeln('<TR>');
                    count++;
                        }
                }
                  else {
           document.writeln('<TR><TD align="center" class="performers_offline"><img src="http://www.axlive.com/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>');

	 } 
  }
 } 



