//	To Use:
//	1. must have a DIV tag with id "rollover_main"
//	2. all images that belong to the rollover have rollover_link and rollover
//	3. if rollover_link is present then clicking on the thumb will move the user to the url specified
//	4. rollover is the path to the large image
//	5. the regular part of the img (SRC) tag is the small picture
//	6. call "init_rollovers()" in body onload tag
function __init_rollovers() {
	//	CONFIG
	config_divname = "rollover_main";
	divElm = document.getElementById(config_divname);
	
	//	Loop through img elements and find rollovers
	tmpcntr = 0;
	imgElms = document.getElementsByTagName("IMG");			
	for (i = 0; i < imgElms.length; i++) {
		rollover_image = imgElms[i].getAttribute("rollover");
		rollover_link = imgElms[i].getAttribute("rolllink");

		if (rollover_image != null && rollover_image != "") {
			imgElms[i].onmouseover = function () {						
				divElm.removeChild(document.getElementById("xyzdivimg"));						
				newTag = document.createElement("IMG");
				newTag.setAttribute("id","xyzdivimg");
				newTag.src = this.getAttribute("rollover");
				
				divElm.appendChild(newTag);					
			};
			
			if (rollover_link != null) {
				imgElms[i].onclick = function() {
					document.location = this.getAttribute("rolllink");
				};
				imgElms[i].style.cursor = "url";
			} else
				imgElms[i].style.cursor = "pointer";
			
			//	Default to the first image
			if (!tmpcntr) {
				newTag = document.createElement("IMG");
				newTag.setAttribute("id","xyzdivimg");
				newTag.src = imgElms[i].getAttribute("rollover");
				
				divElm.appendChild(newTag);										
			}															
			tmpcntr++;
		}
	}
}
