/*------------------------------------------------------------------------------------
2010.02.10 banner switch
--------------------------------------------------------------------------------------*/
Array.prototype.shuffle = function(){
    var len = this.length;
    var ary = this.concat();
    var res = [];
    while(len) res.push(ary.splice(Math.floor(Math.random()*len--),1));
    return res
}

jQuery(function(){
	jQuery('p#bnrSwitch01').each(function(){
	var switchArray = new Array(0, 1);
	switchArray = switchArray.shuffle();
			if(switchArray[0] == 0){
			var bnrObject = new Object();
			bnrObject["href"] = "/locate/b10030101/index.php";
			bnrObject["target"] = "_blank";
			bnrObject["src"] = "/images/index_bnr_51.jpg";
			bnrObject["alt"] = "モヨリノ　最新号はお近くの郵便局で！";
			this.firstChild.firstChild.src = bnrObject["src"];
			this.firstChild.firstChild.alt = bnrObject["alt"];
			this.firstChild.target = bnrObject["target"];
			this.firstChild.href = bnrObject["href"];
		}
	})
	jQuery('p#bnrSwitch02').each(function(){
	var switchArray = new Array(0, 1);
	switchArray = switchArray.shuffle();
		if(switchArray[0] == 0){
			var bnrObject = new Object();
			bnrObject["href"] = "http://www.japanpost.jp/locate/b0409077/index.php";
			bnrObject["target"] = "_blank";
			bnrObject["src"] = "/images/index_bnr_37.jpg";
			bnrObject["alt"] = "エコポイント交換商品 ふるさと小包";
			this.firstChild.firstChild.src = bnrObject["src"];
			this.firstChild.firstChild.alt = bnrObject["alt"];
			this.firstChild.target = bnrObject["target"];
			this.firstChild.href = bnrObject["href"];
		}
	})
})

var topNaviHeight;
function changePos(){
	topNaviHeight = document.getElementById("topNaviH").offsetHeight;
	var topPos = topNaviHeight - 98 + "px";
	$(".toList").css("top", topPos);
	setTimeout("changePos()", 500);
}
function initListLink(){
	topNaviHeight = document.getElementById("topNaviH").offsetHeight;
	changePos();
}
/*------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------*/
try {
	window.addEventListener('load',initListLink , false);
} catch(e){
	window.attachEvent('onload',initListLink);
}