// JavaScript Document

function ovrGIF(theImg) {
	theImg.src = theImg.src.replace('.gif','-b.gif');
}

// image rollout
function outGIF(theImg) {
	theImg.src = theImg.src.replace('-b.gif','.gif');
}

function ovrJPG(theImg) {
	theImg.src = theImg.src.replace('.jpg','-b.jpg');
}

// image rollout
function outJPG(theImg) {
	theImg.src = theImg.src.replace('-b.jpg','.jpg');
}

function chooseColor ( ) {
	// always takes at least two arguments. first is sku, second is color.
	// third optional argument is the form we want to submit.
	//function chooseColor( sku, color, theForm="a2c1" )
	
	sku = "";
	color = "";
	theForm = "a2c1";
	sku = arguments[0]; // the first arg is the sku
	color = arguments[1]; // second arg is the color
	if ( arguments[2] ) {
			theForm = arguments[2]; // third arg is the form
	}

	document.forms[theForm].hidSKU.value = sku;
	document.forms[theForm].hidBoxCt.value = color;
	changes = (document.forms[theForm].hidSKU.value) + " - " + color;
	if(document.getElementById("txtQty2"))
		{
		secondtxtqty = document.getElementById("txtQty2");
		if(eval(secondtxtqty.value) > eval(document.forms[theForm].txtQty.value))
			{document.forms[theForm].txtQty.value = secondtxtqty.value;}
		}
	document.forms[theForm].submit();


}
