
mainurl = "http://www.beatgopgear.com/";
imagedir = "images/thumbnails/standard/";

function makeRotator(rotationObject,rotationList) 
{
	 imageList = new Array();
	 i=0;
	 for (theImage in rotationList) 
	 {
			imageList[i++] = { name:rotationList[theImage], image:(newImage(mainurl + imagedir + rotationList[theImage] + "_md.gif")) }
	 }
	 return(imageList);
}

function newImage(image_location) {  // Cool way of doing this...
	image_item = new Image();
	image_item.src = image_location;
	//alert("HELLO?"); alert(image_location);
	return image_item;
}

function getImage(obj,list,dir) { 
	//alert(obj + " and " +  list + " and dir " + dir);
	//if (random_display) { image_index = generate(0, number_of_image-1); }
	//else { 
	eval("index = "+obj+"_index + dir");
	// }
	
	if (index < 0) index += imageList.length;
	if (index >= list.length) index = 0;
	imgurl = list[index].image.src;
	document.getElementById(obj+"_box").innerHTML = "<a href='"+mainurl+list[index].name+"'><img width='123' height='123' style='border:5px solid #D3883E' src='"+imgurl+"' /></a>";
	eval(obj+"_index = index");
}

//for (foo in list) document.writeln(foo);
