function get_object( id, doc /* = document */ ) {
   if ( typeof doc == 'undefined' ) { doc = document; }
      if ( doc.all ) {
         return doc.all[ id ];
      } else if ( doc.layer ) {
         return doc.layer[ id ];
      } else if ( doc.getElementById ) {
         return doc.getElementById( id );
      }
}

function loadDiscography() {
  var intIndex;
  var intImages = 13; //全体の枚数
  var intSpaces = 3; //枠の数
  var aryLinks = Array(
    'http://www.gotomidori.com/japan/cms/discography.php?itemid=78#more',
    'http://www.gotomidori.com/japan/cms/discography.php?itemid=77#more',
    'http://www.gotomidori.com/japan/cms/discography.php?itemid=76#more',
    'http://www.gotomidori.com/japan/cms/discography.php?itemid=75#more',
    'http://www.gotomidori.com/japan/cms/discography.php?itemid=8#more',
    'http://www.gotomidori.com/japan/cms/discography.php?itemid=44#more',
    'http://www.gotomidori.com/japan/cms/discography.php?itemid=43#more',
    'http://www.gotomidori.com/japan/cms/discography.php?itemid=42#more',
    'http://www.gotomidori.com/japan/cms/discography.php?itemid=41#more',
    'http://www.gotomidori.com/japan/cms/discography.php?itemid=40#more',
    'http://www.gotomidori.com/japan/cms/discography.php?itemid=39#more',
    'http://www.gotomidori.com/japan/cms/discography.php?itemid=38#more',
    'http://www.gotomidori.com/japan/cms/discography.php?itemid=37#more'
  ); //飛び先
  var aryImages = new Array();

  //サムネイル生成
  for(intIndex=1; intIndex<intImages+1; intIndex++) {
    var strIndex = intIndex + ""; //文字列にキャスト
    if(strIndex.length < 2) strIndex = '0' + strIndex;
    aryImages[intIndex-1] = 'imgs/img_disco_' + strIndex + '.jpg';
  }

  //入れ替え
  while (intImages) {
    var intNewIndex = Math.floor(Math.random() * intImages);
    var image = aryImages[--intImages];
    var link = aryLinks[intImages];
    aryImages[intImages] = aryImages[intNewIndex];
    aryImages[intNewIndex] = image;
    aryLinks[intImages] = aryLinks[intNewIndex];
    aryLinks[intNewIndex] = link;
  }

  //実際に設定
  for(intIndex=0; intIndex<intSpaces; intIndex++) {
    get_object('image' + intIndex).src = aryImages[intIndex];
    get_object('link' + intIndex).href = aryLinks[intIndex];
  }
}


