// リンクをランダムピックアップ
function writeRandomPickupLinkList() {
// ['URL', 'リンク文字列', '属性値']
// 最後の['URL', 'リンク文字列', '属性値']の後に、カンマは不要です。
// ['URL', 'リンク文字列', '属性値']の数はいくつでも可能です。
// 属性値を設定したくない場合は、''としてください(例1)。
// 例1）['http://○○.jugem.cc/?eid=○','○○○○', '']
// 例2）['http://○○.jugem.cc/?eid=○','○○○○', 'class="test"']
var list = [
['http://uto-sc.jp/sponsor/1.htm','和晃造園', ''],
['http://uto-sc.jp/sponsor/2.htm','美容室 bee', ''],
['http://uto-sc.jp/sponsor/3.htm','TOP HAIR21', ''],
['http://uto-sc.jp/sponsor/4.htm','らーめん 栄力', ''],
['http://uto-sc.jp/sponsor/6.htm','割烹 おとずれ', ''],
['http://uto-sc.jp/sponsor/7.htm','宇土センターホテル', ''],
['http://uto-sc.jp/sponsor/9.htm','セルコホーム宇土', ''],
['http://uto-sc.jp/sponsor/10.htm','田舎弁当 ままや', ''],
['http://uto-sc.jp/sponsor/11.htm','宇土マリーナ', ''],
['http://uto-sc.jp/sponsor/12.htm','居酒屋 せんば橋', ''],
['http://uto-sc.jp/sponsor/13.htm','桜ビル株式会社', ''],
['http://uto-sc.jp/sponsor/14.htm','創作居酒屋 八起', ''],
['http://uto-sc.jp/sponsor/15.htm','七夜月', ''],
['http://uto-sc.jp/sponsor/16.htm','OH!スマイル', ''],
['http://uto-sc.jp/sponsor/18.htm','タカハマオートサービス', ''],
['http://uto-sc.jp/sponsor/19.htm','斉藤農園', ''],
['http://uto-sc.jp/sponsor/20.htm','彩・食・亭 YABO', ''],
['http://uto-sc.jp/sponsor/21.htm','居酒屋 佳灯', ''],
['http://uto-sc.jp/sponsor/22.htm','居酒屋 万蔵', ''],
['http://uto-sc.jp/sponsor/23.htm','懐石料理 くま井', ''],
['http://uto-sc.jp/sponsor/24.htm','TSD スポーツダンスクラブ', ''],
['http://uto-sc.jp/sponsor/25.htm','もろが整形外科医院', ''],
['http://uto-sc.jp/sponsor/26.htm','隠れ家温泉 古保山リゾート', '']
];

// 表示するリンクの数
var listNum = 5;

// リンクをクリックした際に、別ウインドウで開くかどうか
// var isBlank = 0：別ウインドウで開かない
// var isBlank = 1：別ウインドウで開く
var isBlank = 0;

// ************ 設定ここまで **************
var selectedId = 0;
var k = 0;
var newList = list;
var tempList = null;
var target = (isBlank == 0) ? '' : ' target="_blank"';
var att = '';

if (list.length < listNum) listNum = list.length;
document.write('<ul id="sponsor_list">');
while (0 < listNum) {
k = 0;
selectedId = Math.floor(Math.random() * newList.length);
att = (newList[selectedId][2] != '') ? ' ' + newList[selectedId][2] : '';
document.write('<li><a href="' + newList[selectedId][0] + '"' + target + att + '>');
document.write(newList[selectedId][1]);
document.write('</a></li>');
listNum--;
tempList = new Array(listNum);
for (i = 0; i < newList.length; i++) {
if (i != selectedId) {
tempList[k] = newList[i];
k++;
}
}
newList = null;
newList = tempList;
}
document.write('</ul>');

}
