
function setunitpriceNew(designForm){
	
	if (document.getElementById("designForm").material.selectedIndex == 1){
		fGalleryPrice = document.getElementById("formCanvasPrice").value;
		fUnitPrice = document.getElementById("formCanvasPrice").value;		
	}
	else {		
		fUnitPrice = document.getElementById("formPrice").value;
		fGalleryPrice = document.getElementById("formPrice").value;		
	}
	document.getElementById('formUnitPrice').value = fUnitPrice;	
}

function findDesignCostNew(designForm) {
	var WFToIn = ((document.designForm.customWidthFeet.value * 12) + (document.designForm.customWidthInch.value * 1));	
	var HFToIn = ((document.designForm.customHeightFeet.value * 12) + (document.designForm.customHeightInch.value * 1));	
	var squarefeet = Math.ceil((WFToIn * HFToIn) / 144);
	
	var fUnitPrice = document.designForm.formUnitPrice.value * 1;
	var fGalleryPrice = document.designForm.formGalleryPrice.value * 1;
	var fGalleryCanvasPrice = document.designForm.formGalleryCanvasPrice.value * 1;
	
	var fUnitPriceDisplay = fUnitPrice.toFixed(2);
	var fGalleryPriceDisplay = fGalleryPrice.toFixed(2);
	
	var minHeight = document.designForm.minHeight.value * 1;
	
	var cost = squarefeet * fUnitPrice;
	if (document.designForm.material.selectedIndex == 1) {
	var fullcost = squarefeet * fGalleryCanvasPrice;
	}
	else {
	var fullcost = squarefeet * fGalleryPrice;
	}	
	
	if (WFToIn == 0 || HFToIn == 0){
		document.getElementById('costLabel').innerHTML = "<span style='color:blue'></span>";
		
	}
	else if (((WFToIn * HFToIn) / 144) < 12){
		document.getElementById('costLabel').innerHTML = "<span style='color:red'>Below minimum size</span>";
		document.getElementById('step1').disabled = true;
	}
	else{
		if (document.designForm.specialDiscountA.value < 1) {
		document.getElementById('costLabel').innerHTML = "Reg Price <font style='text-decoration:line-through;'>$" + fullcost.toFixed(2) + "</font><br/><font style='color:red;'>Sale Price $" + cost.toFixed(2) + "</font>";
		}
		else {
		document.getElementById('costLabel').innerHTML = "$" + cost.toFixed(2) + " (" + squarefeet + " sq.ft.)";
		}
	document.getElementById('step1').disabled = false;
	}	
	
}

function validateDesignForm(designForm) {
	var WFToIn = ((designForm.customWidthFeet.value * 12) + (designForm.customWidthInch.value * 1));	
	var HFToIn = ((designForm.customHeightFeet.value * 12) + (designForm.customHeightInch.value * 1));	
	var squarefeet = Math.ceil((WFToIn * HFToIn) / 144);
	var minHeight = designForm.minHeight.value * 1;	
	
	if (WFToIn == 0 || HFToIn == 0){
		document.getElementById('costLabel').innerHTML = "<span style='color:red'>Please enter or select a size</span>";
		document.getElementById('agreement').innerHTML = "By clicking 'Continue', you agree that the image you upload is your own, or that you have received written permission from the copyright owner.";
		return false;
	}
	else if (((WFToIn * HFToIn) / 144) < 12){
		document.getElementById('costLabel').innerHTML = "<span style='color:red'>Below minimum size</span>";
		document.getElementById('agreement').innerHTML = "By clicking 'Continue', you agree that the image you upload is your own, or that you have received written permission from the copyright owner.";
		return false;
	}
	else{
		return true;
	}
		
}








