var bannerArray_small = new Array();
var bannerArray_large = new Array();
var transformspeed = 2000;

bannerArray_small[1] 	= 'images/lagers_90.jpg';      
bannerArray_small[2] 	= 'images/gereedschap_90.jpg'; 
bannerArray_small[3] 	= 'images/tandwiel_90.jpg';    
bannerArray_small[4] 	= 'images/reparatie_90.jpg';   
bannerArray_small[5] 	= 'images/bevestiging_90.jpg'; 
bannerArray_small[6] 	= 'images/elektro_90.jpg';    
bannerArray_small[7] 	= 'images/diversen_90.jpg';    
bannerArray_small[8] 	= 'images/kettingen_90.jpg';   
bannerArray_small[9] 	= 'images/klembussen_90.jpg'; 
bannerArray_small[10] = 'images/vsnaren_90.jpg';     
bannerArray_small[11] = 'images/koppeling_90.jpg';   
bannerArray_small[12] = 'images/verspaning_90.jpg'; 
bannerArray_small[13] = 'images/lineair_90.jpg';    
bannerArray_small[14] = 'images/pneumatiek_90.jpg';  
bannerArray_small[15] = 'images/afdichtingen_90.jpg';

bannerArray_large[1] 	= 'images/lagers_114.jpg';      
bannerArray_large[2] 	= 'images/gereedschap_114.jpg'; 
bannerArray_large[3] 	= 'images/tandwiel_114.jpg';    
bannerArray_large[4] 	= 'images/reparatie_114.jpg';   
bannerArray_large[5] 	= 'images/bevestiging_114.jpg'; 
bannerArray_large[6] 	= 'images/elektro_114.jpg';    
bannerArray_large[7] 	= 'images/diversen_114.jpg';    
bannerArray_large[8] 	= 'images/kettingen_114.jpg';   
bannerArray_large[9] 	= 'images/klembussen_114.jpg'; 
bannerArray_large[10] = 'images/vsnaren_114.jpg';     
bannerArray_large[11] = 'images/koppeling_114.jpg';   
bannerArray_large[12] = 'images/verspaning_114.jpg'; 
bannerArray_large[13] = 'images/lineair_114.jpg';    
bannerArray_large[14] = 'images/pneumatiek_114.jpg';  
bannerArray_large[15] = 'images/afdichtingen_114.jpg';

var current = new Array();
current[1] = 1;
current[2] = 2;
current[3] = 3;
current[4] = 4;
current[5] = 5;
current[6] = 6;
current[7] = 7;

var currentlocation=0;
var numberoflocations=7;
var numberofimages=15;

var preLoad = new Array();

function loopSlide(size)
{
	nextlocation = Math.floor(Math.random()*numberoflocations)+1;
	while (nextlocation==currentlocation)
		nextlocation = Math.floor(Math.random()*numberoflocations)+1;
	
	nextimg = Math.floor(Math.random()*numberofimages)+1;
	while (nextimg==current[1] || nextimg==current[2] || nextimg==current[3] || nextimg==current[4] || nextimg==current[5] || nextimg==current[6] || nextimg==current[7])
		nextimg = Math.floor(Math.random()*numberofimages)+1;

	if(ie5xwin) {
		document.images['product'+nextlocation].style.filter="blendTrans(duration=1)";
		document.images['product'+nextlocation].filters.blendTrans.Apply();
		if (size=='small') document.images['product'+nextlocation].src = bannerArray_small[nextimg];
		else document.images['product'+nextlocation].src = bannerArray_large[nextimg];
		document.images['product'+nextlocation].filters.blendTrans.Play();
	}
	else {
		if (size=='small') document.images['product'+nextlocation].src = bannerArray_small[nextimg];
		else document.images['product'+nextlocation].src = bannerArray_large[nextimg];
	}
	current[nextlocation]=nextimg;
	currentlocation=nextlocation;
		
	setTimeout('loopSlide("'+size+'")', transformspeed);
}


var d, dom, ie, ie4, ie5x, moz, mac, win, lin, old, ie5mac, ie5xwin, op;
d = document; n = navigator; na = n.appVersion; nua = n.userAgent; win = ( na.indexOf( 'Win' ) != -1 ); mac = ( na.indexOf( 'Mac' ) != -1 ); 
lin = ( nua.indexOf( 'Linux' ) != -1 );
if ( !d.layers ){
	dom = ( d.getElementById );
	ie5x = ( d.all && dom );
	ie5xwin = ( win && ie5x );
}
