var xmlDoc;
function loadXML(xmlFile)
{
// code for IE
if (window.ActiveXObject)
  {
  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  xmlDoc.async=false;
  xmlDoc.load(xmlFile);
  getmessage();
  }
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation &&
document.implementation.createDocument)
  {
  xmlDoc=document.implementation.createDocument("","",null);
  xmlDoc.load(xmlFile);
  xmlDoc.onload=getmessage;
  }
else
  {
  alert('Your browser cannot handle this script');
  }
}

function getmessage(){
  var x = xmlDoc.getElementsByTagName("attribute");
  for (var i=0;i<x.length;i++){
    var att_id = (x[i].getAttribute("id"));
    if (att_id == "112") {
      if(document.getElementById("attribute112").innerHTML= x[i].getAttribute('value_id')==1){
        document.getElementById("attribute112").innerHTML=('<img src="/img/icons/icon_cam.gif" alt="cam"/>');
      } else {
        document.getElementById("attribute112").innerHTML=('<img src="/img/icons/no_icon_blank.gif" alt="blank"/>');
      }

    }
    if (att_id == "113") {
      if(document.getElementById("attribute113").innerHTML= x[i].getAttribute('value_id')==1){
        document.getElementById("attribute113").innerHTML=('<img src="/img/icons/icon_mic.gif" alt="mic"/>');
      } else {
        document.getElementById("attribute113").innerHTML=('<img src="/img/icons/no_icon_blank.gif" alt="blank"/>');
      }

    }
    if (att_id == "117") {
      if(document.getElementById("attribute117").innerHTML= x[i].getAttribute('value_id')==1){
        document.getElementById("attribute117").innerHTML=('<img src="/img/icons/icon_recommended.gif" alt="recommended"/>');
      } else if(document.getElementById("attribute117").innerHTML= x[i].getAttribute('value_id')==2){
        document.getElementById("attribute117").innerHTML=('<img src="/img/icons/icon_recommended.gif" alt="recommended"/>');
      } else if(document.getElementById("attribute117").innerHTML= x[i].getAttribute('value_id')==3){
        document.getElementById("attribute117").innerHTML=('<img src="/img/icons/icon_recommended_deluxe.gif" alt="recommended_deluxe"/>');
      } else {
        document.getElementById("attribute117").innerHTML=('<img src="/img/icons/no_icon_blank.gif" alt="blank"/>');
      }
    if (att_id == "125") {
      var valueid =document.getElementById("attribute125_4").innerHTML= x[i].getAttribute('value_id');
      var ary = valueid.split(" ");
      var y, len=ary.length;
      for(y=0;y<len;y++){
        if(ary[y]==4){
          document.getElementById("attribute125_4").innerHTML=('<img src="/img/icons/icon_nude2.gif" alt="nude"/>');
        }
        if(ary[y]==1){
          document.getElementById("attribute125_1").innerHTML=('<img src="/img/icons/icon_costume2.gif" alt="costume"/>');
        }
        if(ary[y]==2){
          document.getElementById("attribute125_2").innerHTML=('<img src="/img/icons/icon_toy.gif" alt="toy"/>');
        }
        if(ary[y]==3){
          document.getElementById("attribute125_3").innerHTML=('<img src="/img/icons/icon_finger2.gif" alt="finger"/>');
        }

      }
    }
    if (att_id == "538") {
      if(document.getElementById("attribute538").innerHTML= x[i].getAttribute('value_id')==1){
        document.getElementById("attribute538").innerHTML=('<img src="/img/icons/rimo_cam.gif" alt="remote_cam"/>');
      } else {
        document.getElementById("attribute538").innerHTML=('<img src="/img/icons/no_icon_blank.gif" alt="blank"/>');
      }
    }
}
}}

function show_icons(performer){
  loadXML("http://aff-jp.dxlive.com/cache/xml/"+performer+".xml");
  var st = '<table width =100 height="60" valign="bottom">';
  st += ('            <tr valign="bottom">');
  st += ('              <td nowrap><font size=1 color=#FF9900><b>高画質</font></td>');
  st += ('              <td nowrap><font size=1 color=#FF9900><b>マイク</font></td>');
  st += ('              <td nowrap><font size=1 color=black><b>花丸 </font></td>');
  st += ('              <!--td nowrap><font size=1 color=black><b>新人 </font></td-->');
  st += ('              <td nowrap><font size=1 color=#ff6600><b>ヌード </font></td>');
  st += ('              <td nowrap><font size=1 color=#ff6600><b>コスプレ</font></td>');
  st += ('              <td nowrap><font size=1 color=#ff3300><b>おもちゃ</font></td>');
  st += ('              <td nowrap><font size=1 color=#ff3300><b>指使い</font></td>');
  st += ('              <td nowrap><font size=1 color=#ff0000><b>ヌキカメラ</font></td>');
  st += ('            </tr>');
  st += ('            <tr align=center>');
  st += ('              <td><span id="attribute112"></span></td>');
  st += ('              <td><span id="attribute113"></span></td>');
  st += ('              <td><span id="attribute117"></span></td>');
  st += ('              <!--td><span id="attribute_newgirl"></span></td-->');
  st += ('              <td><span id="attribute125_4"></span></td>');
  st += ('              <td><span id="attribute125_1"></span></td>');
  st += ('              <td><span id="attribute125_2"></span></td>');
  st += ('              <td><span id="attribute125_3"></span></td>');
  st += ('              <td><span id="attribute538"></span></td>');
  st += ('            </tr>');
  st += ('          </table>');
  document.writeln(st);
}

