// JavaScript Document

function contPrice(calform){

	var costObj = document.getElementById('showPrice');
	var costObj2 = document.getElementById('priceDetails');
	

	var m = "";

	var cost ="";

	var widthVal = calform.wid.value;

	var depthVal = calform.dep.value;

	

	/*if(calform.wid.value == "" || calform.wid.value == "Width" && calform.dep.value == "" || calform.dep.value == "Depth"){

		if(calform.wid.value == "" || calform.wid.value == "Width"){

			alert("Please Enter Width") ;

			calform.wid.value = '';

			calform.wid.focus();

			return false;

		}

		if(calform.dep.value == "" || calform.dep.value == "Depth"){

			alert("Please Enter Depth") ;

			calform.dep.value = '';

			calform.dep.focus();

			return false;

		}

	}*/

	
	if(widthVal == "Width" || widthVal == ""){
		widthVal = 0;
		m = parseInt(widthVal*depthVal);
		cost = (m*230);
	}
	else if(depthVal == "Depth" || depthVal == ""){
		depthVal = 0;
		m = parseInt(widthVal*depthVal);
		cost = (m*230);
	}
	else{
		m = parseInt(widthVal*depthVal);
		cost = (m*230);

		//alert(cost);

		if(cost <= 2760){
			costObj.innerHTML = 2760;
			costObj2.innerHTML = '(min order)';
		}
		else if(cost >= 5900){
			costObj.innerHTML = 5900;
			costObj2.innerHTML = '+ vat (price capped)';
		}
		else{
			costObj.innerHTML = cost;
			costObj2.innerHTML = '';
		}
	}
}