function checkWarranty(wholesaleValue){

		if(!isNaN(parseInt(wholesaleValue))){
			document.getElementById('warrantyCostRow').style.display = '';

			if((wholesaleValue <= 0) || (wholesaleValue < 250)){
				document.getElementById('warrantyAlert').innerHTML = 'Transport Assurance is not available for goods under $250 in value';
				document.getElementById('twValue').value = '0';
				document.getElementById('warrantyCost').style.visibility = 'hidden';
			}else if(wholesaleValue == ''){
				document.getElementById('warrantyAlert').innerHTML = '';
				document.getElementById('twValue').value = '0';
				document.getElementById('warrantyCost').style.visibility = 'hidden';
			}else{
				document.getElementById('warrantyAlert').innerHTML = 'Transport Assurance Cost: ';
			}

			if((wholesaleValue >= 250) && (wholesaleValue < 1000)){
				document.getElementById('twValue').value = '5.00';
				document.getElementById('warrantyCost').style.visibility = 'visible';
			}

			if((wholesaleValue >= 1000) && (wholesaleValue < 3500)){
				document.getElementById('twValue').value = '12.00';
				document.getElementById('warrantyCost').style.visibility = 'visible';
			}

			if((wholesaleValue >= 3500) && (wholesaleValue <= 10000)){
				document.getElementById('twValue').value = '30.00';
				document.getElementById('warrantyCost').style.visibility = 'visible';
			}

			if(wholesaleValue > 10000){
				document.getElementById('warrantyAlert').innerHTML = 'Transport Assurance is not available for goods over $10,000 in value';
				document.getElementById('twValue').value ='0';
				document.getElementById('warrantyCost').style.visibility = 'hidden';
			}
			document.getElementById('warrantyCostRow').style.display = '';
		}else{
			document.getElementById('warrantyCostRow').style.display = 'none';

			document.getElementById('warrantyAlert').innerHTML = '';
			document.getElementById('twValue').value = '0';
			document.getElementById('warrantyCost').style.visibility = 'hidden';

		}

	}

	function showWarranty(val){

		if(val == 'yes'){
			document.getElementById('transWarranty').style.visibility = 'visible';
		}else{
			document.getElementById('wholeValue').value = '';
			document.getElementById('transWarranty').style.visibility = 'hidden';
			document.getElementById('warrantyAlert').innerHTML = '';
			document.getElementById('twValue').value = '0';
			document.getElementById('warrantyCost').style.visibility = 'hidden';
		}
	}

	function clearWarrantyIfInvalid(wholesaleValue) {
		if(!isNaN(parseInt(wholesaleValue)) && ((wholesaleValue <= 0) || (wholesaleValue < 250) || (wholesaleValue > 10000))) document.getElementById('wholeValue').value = '';
	}