function setProductType(typ) {
	MM_findObj("productType").value=typ;
	MM_findObj("qty").value="1";
	s=MM_findObj("selectFrame");
	if (s) {
		setPrice(true);
	}
}

function checkForm() {
	qtyReqd=MM_findObj("qty").value;
	if ((MM_findObj("price").selectedIndex==0) || (parseInt(qtyReqd)==0)) {
		alert("Please specify the option and quantity you require");
		return false;
	}
	return true;
}

function setPrice(resetDisplayPrices) {
	o=MM_findObj("selectFrame");
	p=MM_findObj("price");
	if (p.selectedIndex==0) {
		alert("Please select a print size before selecting a frame");
	}
	
	searchItem=(o.selectedIndex+1)+"|"+p.options[p.selectedIndex].text;
	frameObj=MM_findObj("allframes");
	for (f=0;f<frameObj.options.length;f++) {
		compareItem=frameObj.options[f].text+'"';
		if (searchItem==compareItem) {
			newPrice=frameObj.options[f].value;
			p.options[p.selectedIndex].value=newPrice;
		}
	}
	if (resetDisplayPrices) {
		for (x=0;x<o.options.length;x++) {
			searchItem=x+1+"|"+p.options[p.selectedIndex].text;
			for (f=0;f<frameObj.options.length;f++) {
				compareItem=frameObj.options[f].text+'"';
				if (searchItem==compareItem) {
					newPrice=frameObj.options[f].value;
					o.options[x].text=o.options[x].value+" (€ "+newPrice+")";
					break;
				}
			}
		}
	}
	
}
