var color=1;
var emboss=1;
//var text=1;

function update(){
	if (document.forms[0].color.value != '') {
		updateColor(document.forms[0].color.value);
	}
	if (document.forms[0].emboss.value != '') {
		updateEmboss(document.forms[0].emboss.value);
	}	
}

function changeColor(n) {
	color = n;
	document.getElementById("Folder").style.background="url(images/folders/folder" + color + ".gif)"
	changeEmboss(emboss);
	updatePrices(document.forms[0].qty.value);
}

function changeEmboss(n) {
	emboss = n;
	document.getElementById("Emboss").src=(emboss==0?"images/1pixel.gif":"images/folders/em" + color + emboss + ".gif");
}

function updateSel(the_select, n) {
	var loop;
	for (loop=0; loop < the_select.options.length; loop++) {
		if (the_select.options[loop].value == n) {
			the_select.selectedIndex = loop;
		}
	}
}

function updateEmboss(n) {
	emboss = n;
	changeEmboss(n);
	updateSel(document.forms[0].elements['emboss'], emboss);
}

function updateColor(n) {
	color = n;
	changeColor(n);
	updateSel(document.forms[0].elements['color'], color);
}

function updatePrices(qty) {
	if (qty <= 0) {
		document.getElementById('formQty').focus();
		return false;
	}
	var price_per = getPrice(color, qty);
	document.getElementById("folderQty").innerHTML = qty;
	document.getElementById("folderTotal").innerHTML = qty * 25;
	document.getElementById("folderPrice").innerHTML = price_per.toFixed(2);
	document.getElementById("totalPrice").innerHTML = (qty * price_per).toFixed(2);
}

function getPrice(folder_type, qty) {
	if (isPremium(folder_type)) {
		return getPricePremium(qty);
	} else {
		return getPriceStd(qty);
	}
}

/*

cost per folder:
White Frost, Brushed Ivory, Soft Blue, Driftwood Sand
  1-49		.85
 50-99		.69
100-249		.65
250-499		.56
500+		.48

Classic Burgundy & Forest Green
  1-49		.94
 50-99		.78
100-249		.74
250-499		.65
500+		.57

Minimum 25 Folders per Design & Color

shipping:

Folders		west coast	east coast		Alaska Guam	PR	Hawaii
100			6.50		7.50			9.00
200			7.50		8.50			14.50
250			8.00		9.50			17.50
300			9.00		11.00			20.00
400			9.50		12.50			25.00
500			10.00		14.00			29.00
750			13.00		20.00			42.00
1000		15.50		25.00			54.00

*/