function GetIndex(pic) {
   for(X=1; X<=500; X++) {
      if((pic+X)%9==0) {
         temp = pic + X;
         break;
      }
   }
   for(K=1,Y=0; K<=500; K++,Y+=9) {
      if((temp>=Y)&&(temp<=Y+9)) {
         pic = K;
         break;
      }
   }
   return pic;
}

function DropDownBox(MAXNP) {
   Nindex = GetIndex(MAXNP-1);
   document.write('<div align="center"><FORM name="form1">');
   document.write('<SELECT name="S1">');
   for(X=1; X<=Nindex; X++)
   {
      if(X!=1)
         document.write('<option value="http://guineapigs.8m.com/gpindex'+X+'.html">Index '+X+'</option>');
      else
         document.write('<option value="http://guineapigs.8m.com/gpindex.html">Index '+X+'</option>');
   }
   document.write('</SELECT>&nbsp;');
   document.write('<INPUT type="button" name="go" value="Go!"  onClick="goToUrl(document.form1.S1.options[document.form1.S1.selectedIndex].value)">');
   document.write('</div></form>');
}

function OtherDDB(NP) {
   document.write('<div align="center"><FORM name="form2">');
   document.write('<SELECT name="S1">');
   for(X=1; X<=NP; X++)
   {
      if(X!=1)
         document.write('<option value="http://guineapigs.8m.com/gpgallery'+X+'.html">Picture '+X+'</option>');
      else
         document.write('<option value="http://guineapigs.8m.com/gpgallery.html">Picture '+X+'</option>');
   }
   document.write('</SELECT>&nbsp;');
   document.write('<INPUT type="button" name="go" value="Go!" onClick="goToUrl(document.form2.S1.options[document.form2.S1.selectedIndex].value)">');
   document.write('</div></form>');
}

function goToUrl(URL) {
   parent.main.window.location.href = URL;
}