(function(){
// PR 画像サイズ　横：468　縦：60

// 広告クラス
function Ad(rate, src) {
	this.rate = rate;	// 露出比率
	this.src  = src;	// 広告ソース
}
Ad.prototype.write = function() {
	document.write('', this.src, '');
};


// 広告をセット
var ads = new Array();


// ネココレ
ads[ads.length] = new Ad(100, '<a href="http://moon.ap.teacup.com/nikukyu/" target="blank"><img src="http://adimg.teacup.com/adhtml/neco468x60.gif" border="0"></a>');

// サーバーメンテナンスお知らせ
//ads[ads.length] = new Ad(50, '<a href="http://314.teacup.com/tcup/bbs?BD=14&CH=5&M=ORM&CID=555" target="blank"><img src="http://www.teacup.com/common/img/ja/fbbs/images/mente_468x60.gif" border="0"></a>');


// 露出比率に応じて広告を表示
var total_rate = 0;

for (var i = 0; i < ads.length; i++) {
	total_rate += ads[i].rate;
}

var rand = Math.floor(Math.random() * total_rate);

var i;
for (i = 0; i < ads.length; i++) {
	if ((rand -= ads[i].rate) < 0) break;
}
ads[i < ads.length ? i : 0].write();

})();
