// EXtended Vars MOD


if(typeof(ownserver) == "undefined") {
  ownserver = "http://affiliate.dtiserv.com/image/dxlive/rotation/";
   }





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, attr ) {
    if(!popUrl) {
	    var popUrl = "launch_free.html";
        var popName = 'FreeView';
        var popWidth = 160;
        var popHeight = 400;
        var winconfig = false;
        if(document.location.href.indexOf('/viewers/') != -1 ||
        document.location.href.indexOf('/video_chat/') != -1 ) { 
            popUrl = "http://aff-jp.dxlive.com/viewers/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 = 120;
  thumbheig= 90;
    }


 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;
  




 //---old script::::> 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]){
           
         //   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;
    //} <::::---old script//
   
   
   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_mic') == '1')
||  (getAtt('has_hires') > 0 && getAtt('has_mic') > 0))
             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 + "/index.html";
      if(popName == '') wname = username;

// ?T?C?Y?-?§?w’e
   var popWidth = 1200;
   var popHeight = 760;

	document.writeln('<td  align="center">');
		
		//don't need to be flash//
		//if (viewers > 2){
			//document.writeln('<table cellspacing="0" cellpadding="0" border="0" width="100"  height="151" class="thumbnailboxflash">');
		//} else {
			//document.writeln('<table cellspacing="0" cellpadding="0" border="0" width="100" height="151" class="thumbnailbox">');
		//} 
		
		document.writeln('<table cellspacing="0" cellpadding="0" border="0" width="90"  height="120" class="box">');

			// SESSION TYPE
			
		document.writeln('<tr>');
			
				if(public_performers.getPerformer(username))
		document.writeln('<td width="100" height="20" align="center" valign="top" class="liveshow"></td>');
	else if(private_performers.getPerformer(username))
		document.writeln('<td width="100" height="20" align="center" valign="top" class="oneon"></td>');
	else if(!public_performers.getPerformer(username) && !private_performers.getPerformer(username))
		document.writeln('<td width="100" height="20" align="center" valign="top" class="waiting"></td>');
	document.writeln('</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="?`???b?g’†" ></td>');
				// else if(private_performers.getPerformer(username))
				//   document.writeln('<td><img src="' + ownserver + '/shambara/images/icons/icon_private.gif" alt="?Q?V?‡?b?g’†" ></td>');
				// else if(!public_performers.getPerformer(username) && !private_performers.getPerformer(username))//‘O?@
				//   document.writeln('<td><img src="' + ownserver + '/shambara/images/icons/icon_free.gif" alt="‘O?@’†" ></td>');
			
      document.writeln('<tr><td height="70" align="center">');
      document.writeln('<A style="cursor: pointer;" 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 style="font-size: 11px; font-family: Arial, Helvetica, sans-serif;" align="center"><A style="cursor: hand;" onClick="openAppWindow(\''+url+'\',\''+wname+'\','+popWidth+','+popHeight+')">'+username+'</a></td></tr>');
document.writeln('<tr><td height="6" align="center" style="font-size: 10px; font-family: Arial, Helvetica, sans-serif;">(入室中:'+viewers+')</td></tr>');


/*試しにコメントする　12/29/09
// ICONS
    if(this.icons) {

        if(this.lang) document.writeln('<tr>');
//		var toy = getAttributeValueId(537);
	var toy=1;  
	var flag_spacer_html = '<td align="right">';
	var spacer_counter = 16;
	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');
	var toy = (getAtt('has_remote_toy') == '1');	
	var flag_files = new Array('flag-jp.gif','flag-en.gif','world.gif','flag-ch','flag-ch','flag-fr','flag-sp','flag-it');

	document.writeln('<td height="24" align="left"><table border="0" cellpadding="2" cellspacing="0">');
	document.writeln('<tr><td>');

        if(toy==1){
            document.write('<img src="images/icons/icon_toy_shake.gif " >');
	    document.writeln('</td><td>');
	    spacer_counter -= 4;
	}
	else if(toy==2){
            document.write('<img src="images/icons/icon_toy_blink.gif " >');
	    document.writeln('</td><td>');
	    spacer_counter -= 4;
	}

        if(flower){
		// ?A?C?R?“?I?[?i?[?T?[?o?[?w’e//document.writeln('<img src="' + ownserver + '/images/icons/icon_newgirl.gif" alt="?V?l">');
	    	document.write('<img src="images/icons/icon_newgirl.gif" alt="?V?l">');
            document.writeln('</td><td>');
	    spacer_counter -= 4;
	}
		
        if(cam){
            document.write('<img src="images/icons/icon_hirez.gif" alt="??hires">');
            document.writeln('</td><td>');
	    spacer_counter -= 4;
	}

        if(mic){
            document.write('<img src="images/icons/icon_sound.gif" alt="sound">');
            document.writeln('</td><td>')
	    spacer_counter -= 4;
	}
	
	//ここは最初からコメントされてた↓(12/29/09)　次の*まで。

   /*    if(rec){
           document.write('<img src="images/icons/icon_flower.gif" alt="record">');
           document.writeln('</td><td>')
		   spacer_counter -= 4;
	}
	*/


/*試しにコメントする　12/29/09

	document.writeln('</td>');

	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) {

	for (var x = 0; x <= spacer_counter; x++)
	{
	    flag_spacer_html = flag_spacer_html + '&nbsp;';
	} 

	document.writeln(flag_spacer_html);

		if( (vl_arr[vid]-1) == 3)		
	   document.write("<img border=0 src='images/icons/"+ flag_files[vl_arr[vid]-1]+"' width=13 height=13 alt=''>");
	else
	   document.write("<img border=0 src='images/icons/"+ flag_files[vl_arr[vid]-1]+"' width=13 height=9 alt=''>");
		}
		}
	   }
	}

	   document.writeln('</td></tr></table>');

	}
ここまで　*/
	
//ここのProfile Linkは最初からコメントされてたので触らなくてよい	
// PROFILE LINK

//				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>');
// LANGUAGE FLAGS
// 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="?`???b?g’†" ></td>');
				// else if(private_performers.getPerformer(username))
				//   document.writeln('<td><img src="' + ownserver + '/shambara/images/icons/icon_private.gif" alt="?Q?V?‡?b?g’†" ></td>');
				// else if(!public_performers.getPerformer(username) && !private_performers.getPerformer(username))//‘O?@
				//   document.writeln('<td><img src="' + ownserver + '/shambara/images/icons/icon_free.gif" alt="‘O?@’†" ></td>');

 
			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>'); 
		}
	} 
}


// 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>');

	 } 
  }
 } 




