var imgPath = "/images/main/rollovers/" + product + "/";

window.onload = function(){
	rolloverInit();
	openColors();
}

function rolloverInit(){
	for(var i=0; i < document.images.length; i++){

		var imageRef = document.images[i];
		
		if(imageRef.id && imageRef.id != "main"){
			var linkObj = imageRef;
			imgObj = document.getElementById("main");
			setupRollover(imageRef, imgObj);
		}
	}
}

function setupRollover(thisLink, thisImage) {
	thisLink.mainImage = new Image();
	thisLink.mainImage.src = imgPath + thisLink.id + ".jpg";

	thisLink.shownImg = thisImage;
	thisLink.onmouseover = rollOver;
}

function rollOver(){
	this.shownImg.src = this.mainImage.src;
}

//color gallery pop-up
function openColors(){
	var idCall = document.getElementById("colors");
	if(idCall){
		if(idCall){
			idCall.onclick = function(){
				window.open("/info_links/" + product + "-colors.html","colors","toolbar=0, menubar=1, location=0, scrollbars=1, resizeable=1, left=30, top=30");
				return false;
			}
		}
	}
}