﻿function checkCush( ) {

 
if (document.form1.length.value.length <1 ) 
{alert ("Please put a value in the length box") 
       return false}
if (document.form1.width.value.length <1 ) 
{alert ("Please put a value in the width box") 
       return false}  
if (document.form1.depth.value.length <1 ) 
{alert ("Please put a value in the depth box") 
       return false} 

document.form1.submit()
return true
}


function boxChangecush(x){
if (x==3) {
document.form1.firmness.selectedIndex=1 ;
document.form1.firmness.disabled=true
}
else {
document.form1.firmness.disabled=false
}

if (x==0) {
document.form1.firmness.selectedIndex=2 ;
document.form1.firmness.disabled=true
}
if (x==4) {
document.form1.firmness.selectedIndex=1 ;
document.form1.firmness.disabled=true
}

}


function boxChangewrap(x){
if (x>0) {
document.form1.stocking.selectedIndex=1 ;
document.form1.stocking.disabled=true
}
else {
document.form1.stocking.disabled=false ;
document.form1.stocking.selectedIndex=0
}
}







function checkdepth(x) {



var Measure = document.form1.measure.selectedIndex ;



if (Measure==0) {



var depthmax = 5



}



else {



var depthmax = 2



}



var depthchk = document.form1.depth.value ;



if (depthchk!=depthmax) {



alert("We can make an overlay to any required depth, although we ideally recommend a depth of 2 inches (5 cms) for our mattress overlays")



return false



}











}
