//items[items.length] = (function(){
//	rotation.ready(new Array(
//		{ href : '/download/font/brand/cinema.html', src : '/download/font/images/rotation/img1.jpg' },
//		{ href : '/download/font/brand/fonts66.html', src : '/download/font/images/rotation/img2.jpg' },
//		{ href : '/download/font/brand/ryobi.html', src : '/download/font/images/rotation/img3.jpg' }
//	),'contents',3000);
//});//window.onload03
//とかで呼び出せます。
//（微妙な実装ですが）第二引数はどこにローテーション画像を入れるか。
//インデックスならcontentsの直下、ブランドページならrotationの直下。
//第三引数はローテーション間隔です。
//なしでもOK。
//デフォルトは4000。

var rotation = new Object({
	jump : new Array(0),
	targetImg : null,
	targetA : null,
	count : 0,
	ready : function(a,b,c){
		if(!c) c = 4000;
		rotation.jump = a;
		var element = document.createElement('p');
		element.id = 'linkTarget';
		element.innerHTML = '<a href="./" id="jump"><img src="/download/font/img/spacer.gif" id="main_img" width="730" height="145" alt="" /></a>';
		document.getElementById(b).insertBefore(element, document.getElementById(b).firstChild);
		rotation.jump.shuffle();
		rotation.targetImg = document.getElementById('main_img');
		rotation.targetA = document.getElementById('jump');
		rotation.front();
		window.setInterval('rotation.front()',c);
	},
	front : function(){
		rotation.count++;
		if (rotation.count >= rotation.jump.length){rotation.count = 0;};
		rotation.targetImg.src = rotation.jump[rotation.count].src;
		rotation.targetA.setAttribute("href", rotation.jump[rotation.count].href);
	}
});
//Fisher-Yates
Array.prototype.shuffle = function() {
    var i = this.length;
    while(i){
        var j = Math.floor(Math.random()*i);
        var t = this[--i];
        this[i] = this[j];
        this[j] = t;
    }
    return this;
}





