// JavaScript Document



function switchTips(currentPage, switchTo) {
document.getElementById('content').style.backgroundImage = 'url(/img/tipstricks/'+switchTo+'.jpg)';
document.getElementById(currentPage).style.display = 'none';
document.getElementById(switchTo).style.display = 'block';
}

function switchBackTips (currentPage, switchFrom) {
document.getElementById('content').style.backgroundImage = 'url(/img/tipstricks/'+currentPage+'.jpg)';
document.getElementById(currentPage).style.display = 'block';
document.getElementById(switchFrom).style.display = 'none';
}

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();
}
