// JavaScript Document


	//	shopRoller pour 'index.php'
	

	var tab = ['01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20'];
	var links = [
					'2732828858', '2290346888', '2732892157', '2868397913', '2848950102',
					'291152568X', '2895657270', '2850901415', '2850901512', '2710705206',
					'2841971880', '2733910450', '2850902144', '2890446662', '2841972518',
					'2895422192', '2846390215', '2841973883', '2012602215', '2718909870'
				];
	var i = Math.floor(20 * Math.random());


	function recall() {var interval = setInterval(amazonRoll, 15000);}
	function fade()	{$('shopRoller').fade(0);}


	function imgRoll()
	{
		var elem = $('shopRoller');
	
		var childList = elem.childNodes;
		for(j=0; j<childList.length; j++)
		{
			elem.removeChild( childList[j] );
		}

		var href = document.createElement("a");
			href.setAttribute("href", "boutique.php?isbn=" + links[i]);
		var img = document.createElement("img");
			img.setAttribute("src", "amazon/" + tab[i] + ".jpg");
			img.setAttribute("border", "0");
		href.appendChild(img);
		elem.appendChild(href);
		i++;
	}

	function amazonRoll()
	{
		$('shopRoller').fade(1);	

		if( i < 20 )
		{
			imgRoll();	
		}
		else
		{
			i = 0;
			imgRoll();
		}

		setTimeout(fade, 14200); 
	}
	
