var contents = new Array();
var linky = new Array();
var total = 21;

contents[0] = "#ffffff url(shopimages/xs_1.jpg) center center no-repeat";
linky[0] = "http://www.themarketforum.co.uk/shops/refresh-cartridges/";
contents[1] = "#ffffff url(shopimages/xs_5.jpg) center center no-repeat";
linky[1] = "http://www.themarketforum.co.uk/shops/emmas-beauty-bitz/";
contents[2] = "#ffffff url(shopimages/xs_10.jpg) center center no-repeat";
linky[2] = "http://www.themarketforum.co.uk/shops/the-market-fruit--veg-shop/";
contents[3] = "#ffffff url(shopimages/xs_12.jpg) center center no-repeat";
linky[3] = "http://www.themarketforum.co.uk/shops/annies-corsets/";
contents[4] = "#ffffff url(shopimages/xs_16.jpg) center center no-repeat";
linky[4] = "http://www.themarketforum.co.uk/shops/dots-Pantry/";
contents[5] = "#ffffff url(shopimages/xs_21.jpg) center center no-repeat";
linky[5] = "http://www.themarketforum.co.uk/shops/heart--soul/";
contents[6] = "#ffffff url(shopimages/xs_22.jpg) center center no-repeat";
linky[6] = "http://www.themarketforum.co.uk/shops/sweetcheeks-clothing/";
contents[7] = "#ffffff url(shopimages/xs_24.jpg) center center no-repeat";
linky[7] = "http://www.themarketforum.co.uk/shops/vertigo/";
contents[8] = "#ffffff url(shopimages/xs_32.jpg) center center no-repeat";
linky[8] = "http://www.themarketforum.co.uk/shops/the-edge-clothing-company/";
contents[9] = "#ffffff url(shopimages/xs_46.jpg) center center no-repeat";
linky[9] = "http://www.themarketforum.co.uk/shops/the-bodyright-clinic/";
contents[10] = "#ffffff url(shopimages/xs_52.jpg) center center no-repeat";
linky[10] = "http://www.themarketforum.co.uk/shops/discovery--therapies--readings/";
contents[11] = "#ffffff url(shopimages/xs_1.jpg) center center no-repeat";
linky[11] = "http://www.themarketforum.co.uk/shops/refresh-cartridges/";
contents[12] = "#ffffff url(shopimages/xs_5.jpg) center center no-repeat";
linky[12] = "http://www.themarketforum.co.uk/shops/emmas-beauty-bitz/";
contents[13] = "#ffffff url(shopimages/xs_10.jpg) center center no-repeat";
linky[13] = "http://www.themarketforum.co.uk/shops/the-market-fruit--veg-shop/";
contents[14] = "#ffffff url(shopimages/xs_12.jpg) center center no-repeat";
linky[14] = "http://www.themarketforum.co.uk/shops/annies-corsets/";
contents[15] = "#ffffff url(shopimages/xs_16.jpg) center center no-repeat";
linky[15] = "http://www.themarketforum.co.uk/shops/dots-Pantry/";
contents[16] = "#ffffff url(shopimages/xs_21.jpg) center center no-repeat";
linky[16] = "http://www.themarketforum.co.uk/shops/heart--soul/";
contents[17] = "#ffffff url(shopimages/xs_22.jpg) center center no-repeat";
linky[17] = "http://www.themarketforum.co.uk/shops/sweetcheeks-clothing/";
contents[18] = "#ffffff url(shopimages/xs_24.jpg) center center no-repeat";
linky[18] = "http://www.themarketforum.co.uk/shops/vertigo/";
contents[19] = "#ffffff url(shopimages/xs_32.jpg) center center no-repeat";
linky[19] = "http://www.themarketforum.co.uk/shops/the-edge-clothing-company/";
contents[20] = "#ffffff url(shopimages/xs_46.jpg) center center no-repeat";
linky[20] = "http://www.themarketforum.co.uk/shops/the-bodyright-clinic/";
contents[21] = "#ffffff url(shopimages/xs_52.jpg) center center no-repeat";
linky[21] = "http://www.themarketforum.co.uk/shops/discovery--therapies--readings/";
var opacity = 0;
var display = Math.ceil((total+1) * Math.random())-1;
var curlinky = linky[display];
function visituri(){
window.location = curlinky;
}
function updatetext(){
	if (document.getElementById("mg")){
		rm = document.getElementById("mg");
		if (display != total){
		rm.style.opacity = 1.0;
		rm.style.filter = 'alpha(opacity=100)';
		rm.style.background = contents[(display+1)];
		} else {
		rm.style.opacity = 1.0;
		rm.style.filter = 'alpha(opacity=100)';
		rm.style.background = contents[0];
		}	
	rr = document.getElementById("bg");
	rr.style.background = contents[display];
		if (display > 0){
		display--;
		} else {
		display=total;
		}
		curlinky = linky[display];
		var t = setTimeout("fadein()", 7500);
	}
}
function fadein(){
	if (opacity < 101){
	value=(101-opacity);
	y= document.getElementById("mg");
	y.style.opacity = value/100;
	y.style.filter = 'alpha(opacity=' + value + ')';
	var t = setTimeout("fadein()",5);
	opacity++;
	if (opacity < 10){
	}
	} else {
	opacity =0;	
	updatetext();
	}
}
window.onload= updatetext;

