/* This code is Copyright (c) 1996 Nick Heinle all rights reserved.
 * In order to receive the right to license this code for use on your
 * site the original code must be copied from the Web site 
 * webreference.com/javascript/. License is granted to user to reuse
 * this code on their own Web site if and only if this entire copyright
 * notice is included. Code written by Nick Heinle of webreference.com.
 */

toc1on = new Image();
 toc1on.src = "graphics/toc/1on.jpg";
toc2on = new Image();
 toc2on.src = "graphics/toc/2on.jpg";
toc3on = new Image();
 toc3on.src = "graphics/toc/3on.jpg";
toc4on = new Image();
 toc4on.src = "graphics/toc/4on.jpg";
toc5on = new Image();
 toc5on.src = "graphics/toc/5on.jpg";

toc1off = new Image();
 toc1off.src = "graphics/toc/1off.jpg";
toc2off = new Image();
 toc2off.src = "graphics/toc/2off.jpg";
toc3off = new Image();
 toc3off.src = "graphics/toc/3off.jpg";
toc4off = new Image();
 toc4off.src = "graphics/toc/4off.jpg";
toc5off = new Image();
 toc5off.src = "graphics/toc/5off.jpg";

function blink(imgName,state) {
	thisImg = eval(imgName + state + ".src");
//	if (version == "n3") {
//		document [imgName].src = imgOn;
//	} else {
		document.images[imgName].src = thisImg;
//	}
}

//  Shopping cart

function buildName(i) {
	var description = document.forms[i].elements[3].value;
	var color;
	var scent;
	if (document.forms[i].elements[6].options) {
		var idx6 = document.forms[i].elements[6].selectedIndex * 1;
		if (idx6 < 0) {
			idx6 = 0;
		}
		color = document.forms[i].elements[6].options[idx6].text;
	} else {
		color = document.forms[i].elements[6].value;
	}
	
	if (document.forms[i].elements[7].options) {
		var idx7 = document.forms[i].elements[7].selectedIndex;
		if (idx7 < 0) idx7 = 0;
		var scent = document.forms[i].elements[7].options[idx7].text;
	} else {
		var scent = document.forms[i].elements[7].value;
	}
	
	if (color || scent) {
		description += ' (' + color;
		if (color) {
			description += ', ';
		}
		description += scent + ')';
	}

	document.forms[i].elements[8].name =
	document.forms[i].elements[2].value+'|'
	+document.forms[i].elements[4].value+'|'
	+description +'||||'
	+document.forms[i].elements[5].value;

//	alert(document.forms[i].elements[8].name);
}
