
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 findDesignCostNew2(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);
	if (WFToIn <= 52 || HFToIn <= 52) {
		var panels = 1;
	}
	else {
		var panels = Math.ceil(WFToIn / 48);
	}
	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 = panels + ' panel - ' + squarefeet + " sq.ft.<br>Regular Price: $" + fullcost.toFixed(2) + "&nbsp;&nbsp;<font style='color:#E57F03;'>Sale Price: $" + cost.toFixed(2);
		}
		else {
		document.getElementById('costLabel').innerHTML = panels + ' panel - ' + squarefeet + " sq.ft.<br>Your Price:$" + cost.toFixed(2);
		}
	document.getElementById('step1').disabled = false;
	}	
	
}

function findDesignCostNew3(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);
	if (WFToIn <= 52 || HFToIn <= 52) {
		var panels = 1;
	}
	else {
		var panels = Math.ceil(WFToIn / 48);
	}
	document.getElementById('panelLabel').innerHTML = panels + ' section - ' + squarefeet + " sq.ft.";
	/*var fUnitPrice = document.designForm.formUnitPrice.value * 1;
	var fGalleryPrice = document.designForm.formGalleryPrice.value * 1;
	var fGalleryRestikPrice = document.designForm.formGalleryRestikPrice.value * 1;
	var fGalleryCanvasPrice = document.designForm.formGalleryCanvasPrice.value * 1;*/
	
	//net prices
	var customPrice = document.designForm.formCustomPrice.value * 1;
	var customRestikPrice = document.designForm.formCustomRestikPrice.value * 1;
	var customCanvasPrice = document.designForm.formCustomCanvasPrice.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;
	}*/
	var fullcost = squarefeet * document.designForm.formFullPrice.value;
	var fullcostRestik = squarefeet * document.designForm.formFullRestikPrice.value;
	var fullcostCanvas = squarefeet * document.designForm.formFullCanvasPrice.value;
	var cost = squarefeet * customPrice;
	var costRestik = squarefeet * customRestikPrice;
	var costCanvas = squarefeet * customCanvasPrice;	
	
	if (WFToIn == 0 || HFToIn == 0){
		document.getElementById('panelLabel').innerHTML = "";
		document.getElementById('costLabel').innerHTML = "<span style='color:blue'></span>";
		document.getElementById('costLabelRestik').innerHTML = "<span style='color:blue'></span>";
		document.getElementById('costLabelCanvas').innerHTML = "<span style='color:blue'></span>";
	}
	else if (((WFToIn * HFToIn) / 144) < 21){
		document.getElementById('panelLabel').innerHTML = "";
		document.getElementById('costLabel').innerHTML = "<span style='color:red'>Below minimum size</span>";
		document.getElementById('costLabelRestik').innerHTML = "<span style='color:blue'></span>";
		document.getElementById('costLabelCanvas').innerHTML = "<span style='color:blue'></span>";
		
	}
	else{
		document.getElementById('panelLabel').innerHTML = panels + ' section - ' + squarefeet + " sq.ft.";
		if (document.designForm.specialDiscountA.value < 1) {
		
		document.getElementById('costLabel').innerHTML = "<strong>Vinyl</strong> - Regular Price: $" + fullcost.toFixed(2) + "&nbsp;&nbsp;<font style='font-weight:bold; color:#E57F03;'>Sale Price: $" + cost.toFixed(2) + "</font>";
		document.getElementById('costLabelRestik').innerHTML = "<strong>SmartStick&#153\;</strong> - Regular Price: $" + fullcostRestik.toFixed(2) + "&nbsp;&nbsp;<font style='font-weight:bold; color:#E57F03;'>Sale Price: $" + costRestik.toFixed(2) + "</font>";
		document.getElementById('costLabelCanvas').innerHTML = "<strong>Canvas</strong> - Regular Price: $" + fullcostCanvas.toFixed(2) + "&nbsp;&nbsp;<font style='font-weight:bold; color:#E57F03;'>Sale Price: $" + costCanvas.toFixed(2) + "</font>";
		
		}
		else {
		document.getElementById('costLabel').innerHTML = "<strong>Vinyl - &nbsp;&nbsp;<font style='font-weight:bold; color:#E57F03;'>Your price: $" + fullcost.toFixed(2) + "</font>";
		document.getElementById('costLabelRestik').innerHTML = "<strong>SmartStick&#153\;</strong> - &nbsp;&nbsp;<font style='font-weight:bold; color:#E57F03;'>Your price: $" + fullcostRestik.toFixed(2) + "</font>";
		document.getElementById('costLabelCanvas').innerHTML = "<strong>Canvas</strong> - &nbsp;&nbsp;<font style='font-weight:bold; color:#E57F03;'>Your price: $" + fullcostCanvas.toFixed(2) + "</font>";
		
		}
	//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 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.";
		alert('Please enter a size.');
		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;
	}
		
}













