function lounge()
{  
    var loungeFurniture= 0;
    var lounge = 0;
    var theForm = document.forms["contentsCalculator"];
    
    var loungeFurniture = theForm.elements["loungeFurniture"];
    //If the box has a greater value than 0
    if(loungeFurniture.value > 0){
        lounge = lounge + parseInt(loungeFurniture.value, 10);
    } 
    var curtainsAndBlinds= 0;
    var curtainsAndBlinds = theForm.elements["curtainsAndBlinds"];
    //If the box has a greater value than 0
    if(curtainsAndBlinds.value > 0){
        lounge = lounge + parseInt(curtainsAndBlinds.value, 10);
    }    
    
        var carpetsandFloors= 0;
    var carpetsandFloors = theForm.elements["carpetsandFloors"];
    //If the box has a greater value than 0
    if(carpetsandFloors.value > 0){
        lounge = lounge + parseInt(carpetsandFloors.value, 10);
    }  
    
        var electricalItems= 0;
    var electricalItems = theForm.elements["electricalItems"];
    //If the box has a greater value than 0
    if(electricalItems.value > 0){
        lounge = lounge + parseInt(electricalItems.value, 10);
    }  
    
        var hifiEquipment= 0;
    var hifiEquipment = theForm.elements["hifiEquipment"];
    //If the box has a greater value than 0
    if(hifiEquipment.value > 0){
        lounge = lounge + parseInt(hifiEquipment.value, 10);
    }  
    
        var ornaments= 0;
    var ornaments = theForm.elements["ornaments"];
    //If the box has a greater value than 0
    if(ornaments.value > 0){
        lounge = lounge + parseInt(ornaments.value, 10);
    }  
    
        var televisions= 0;
    var televisions = theForm.elements["televisions"];
    //If the box has a greater value than 0
    if(televisions.value > 0){
        lounge = lounge + parseInt(televisions.value, 10);
    }  
    
        var games= 0;
    var games = theForm.elements["games"];
    //If the box has a greater value than 0
    if(games.value > 0){
        lounge = lounge + parseInt(games.value, 10);
    }  
    
        var cds= 0;
    var cds = theForm.elements["cds"];
    //If the box has a greater value than 0
    if(cds.value > 0){
        lounge = lounge + parseInt(cds.value, 10);
    }  
    
        var dvd= 0;
    var dvd = theForm.elements["dvd"];
    //If the box has a greater value than 0
    if(dvd.value > 0){
        lounge = lounge + parseInt(dvd.value, 10);
    }  
    
        var mirrors= 0;
    var mirrors = theForm.elements["mirrors"];
    //If the box has a greater value than 0
    if(mirrors.value > 0){
        lounge = lounge + parseInt(mirrors.value, 10);
    }  
    
        var loungeother= 0;
    var loungeother = theForm.elements["loungeother"];
    //If the box has a greater value than 0
    if(loungeother.value > 0){
        lounge = lounge + parseInt(loungeother.value, 10);
    }  

    return lounge;
}

function dining()
{  
    var diningFurniture= 0;
    var dining = 0;
    var theForm = document.forms["contentsCalculator"];
    
    var diningFurniture = theForm.elements["diningFurniture"];
    //If the box has a greater value than 0
    if(diningFurniture.value > 0){
        dining = dining + parseInt(diningFurniture.value, 10);
    } 
    var diningcurtainsAndBlinds= 0;
    var diningcurtainsAndBlinds = theForm.elements["diningcurtainsAndBlinds"];
    //If the box has a greater value than 0
    if(diningcurtainsAndBlinds.value > 0){
        dining = dining + parseInt(diningcurtainsAndBlinds.value, 10);
    }    
    
        var diningcarpetsandFloors= 0;
    var diningcarpetsandFloors = theForm.elements["diningcarpetsandFloors"];
    //If the box has a greater value than 0
    if(diningcarpetsandFloors.value > 0){
        dining = dining + parseInt(diningcarpetsandFloors.value, 10);
    }  
    
        var diningelectricalItems= 0;
    var diningelectricalItems = theForm.elements["diningelectricalItems"];
    //If the box has a greater value than 0
    if(diningelectricalItems.value > 0){
        dining = dining + parseInt(diningelectricalItems.value, 10);
    }  
    
        var dininghifiEquipment= 0;
    var dininghifiEquipment = theForm.elements["dininghifiEquipment"];
    //If the box has a greater value than 0
    if(dininghifiEquipment.value > 0){
        dining = dining + parseInt(dininghifiEquipment.value, 10);
    }  
    
        var diningornaments= 0;
    var diningornaments = theForm.elements["diningornaments"];
    //If the box has a greater value than 0
    if(diningornaments.value > 0){
        dining = dining + parseInt(diningornaments.value, 10);
    }  
    
        var diningtelevisions= 0;
    var diningtelevisions = theForm.elements["diningtelevisions"];
    //If the box has a greater value than 0
    if(diningtelevisions.value > 0){
        dining = dining + parseInt(diningtelevisions.value, 10);
    }  
    
        var linen= 0;
    var linen = theForm.elements["linen"];
    //If the box has a greater value than 0
    if(linen.value > 0){
        dining = dining + parseInt(linen.value, 10);
    }  
    
        var diningchinaglassessilverware= 0;
    var diningchinaglassessilverware = theForm.elements["diningchinaglassessilverware"];
    //If the box has a greater value than 0
    if(diningchinaglassessilverware.value > 0){
        dining = dining + parseInt(diningchinaglassessilverware.value, 10);
    }  
    
        var winesandspirits= 0;
    var winesandspirits = theForm.elements["winesandspirits"];
    //If the box has a greater value than 0
    if(winesandspirits.value > 0){
        dining = dining + parseInt(winesandspirits.value, 10);
    } 
    
    var diningother= 0;
    var diningother = theForm.elements["diningother"];
    //If the box has a greater value than 0
    if(diningother.value > 0){
        dining = dining + parseInt(diningother.value, 10);
    }  
            
    return dining;
}
  
  function office()
{  
    var officeFurniture= 0;
    var office = 0;
    var theForm = document.forms["contentsCalculator"];
    
    var officeFurniture = theForm.elements["officeFurniture"];
    //If the box has a greater value than 0
    if(officeFurniture.value > 0){
        office = office + parseInt(officeFurniture.value, 10);
    } 
    var officecurtainsAndBlinds= 0;
    var officecurtainsAndBlinds = theForm.elements["officecurtainsAndBlinds"];
    //If the box has a greater value than 0
    if(officecurtainsAndBlinds.value > 0){
        office = office + parseInt(officecurtainsAndBlinds.value, 10);
    }    
    
        var officecarpetsandFloors= 0;
    var officecarpetsandFloors = theForm.elements["officecarpetsandFloors"];
    //If the box has a greater value than 0
    if(officecarpetsandFloors.value > 0){
        office = office + parseInt(officecarpetsandFloors.value, 10);
    }  
    
        var officeelectricalItems= 0;
    var officeelectricalItems = theForm.elements["officeelectricalItems"];
    //If the box has a greater value than 0
    if(officeelectricalItems.value > 0){
        office = office + parseInt(officeelectricalItems.value, 10);
    }  
    
        var computing= 0;
    var computing = theForm.elements["computing"];
    //If the box has a greater value than 0
    if(computing.value > 0){
        office = office + parseInt(computing.value, 10);
    }  
    
        var books= 0;
    var books = theForm.elements["books"];
    //If the box has a greater value than 0
    if(books.value > 0){
        office = office + parseInt(books.value, 10);
    }  
    
    var officeother= 0;
    var officeother = theForm.elements["officeother"];
    //If the box has a greater value than 0
    if(officeother.value > 0){
        office = office + parseInt(officeother.value, 10);
    }            
     
    return office;
}


function kitchen()
{  
    var kitchenFurniture= 0;
    var kitchen = 0;
    var theForm = document.forms["contentsCalculator"];
    
    var kitchenFurniture = theForm.elements["kitchenFurniture"];
    //If the box has a greater value than 0
    if(kitchenFurniture.value > 0){
        kitchen = kitchen + parseInt(kitchenFurniture.value, 10);
    } 
    var kitchencurtainsAndBlinds= 0;
    var kitchencurtainsAndBlinds = theForm.elements["kitchencurtainsAndBlinds"];
    //If the box has a greater value than 0
    if(kitchencurtainsAndBlinds.value > 0){
        kitchen = kitchen + parseInt(kitchencurtainsAndBlinds.value, 10);
    }    
    
        var kitchencarpetsandFloors= 0;
    var kitchencarpetsandFloors = theForm.elements["kitchencarpetsandFloors"];
    //If the box has a greater value than 0
    if(kitchencarpetsandFloors.value > 0){
        kitchen = kitchen + parseInt(kitchencarpetsandFloors.value, 10);
    }  
    
        var kitchenware= 0;
    var kitchenware = theForm.elements["kitchenware"];
    //If the box has a greater value than 0
    if(kitchenware.value > 0){
        kitchen = kitchen + parseInt(kitchenware.value, 10);
    }  
    
        var largeelectrical= 0;
    var largeelectrical = theForm.elements["largeelectrical"];
    //If the box has a greater value than 0
    if(largeelectrical.value > 0){
        kitchen = kitchen + parseInt(largeelectrical.value, 10);
    }  
    
        var smallelectrical= 0;
    var smallelectrical = theForm.elements["smallelectrical"];
    //If the box has a greater value than 0
    if(smallelectrical.value > 0){
        kitchen = kitchen + parseInt(smallelectrical.value, 10);
    }  
    
            var cooking= 0;
    var cooking = theForm.elements["cooking"];
    //If the box has a greater value than 0
    if(cooking.value > 0){
        kitchen = kitchen + parseInt(cooking.value, 10);
    } 
    
        var washing= 0;
    var washing = theForm.elements["washing"];
    //If the box has a greater value than 0
    if(washing.value > 0){
        kitchen = kitchen + parseInt(washing.value, 10);
    }  
    
        var dishwasher= 0;
    var dishwasher = theForm.elements["dishwasher"];
    //If the box has a greater value than 0
    if(dishwasher.value > 0){
        kitchen = kitchen + parseInt(dishwasher.value, 10);
    }  
    
        var refridgeration= 0;
    var refridgeration = theForm.elements["refridgeration"];
    //If the box has a greater value than 0
    if(refridgeration.value > 0){
        kitchen = kitchen + parseInt(refridgeration.value, 10);
    }  
    
        var freezercontents= 0;
    var freezercontents = theForm.elements["freezercontents"];
    //If the box has a greater value than 0
    if(freezercontents.value > 0){
        kitchen = kitchen + parseInt(freezercontents.value, 10);
    } 
    
       var cupboardcontents= 0;
    var cupboardcontents = theForm.elements["cupboardcontents"];
    //If the box has a greater value than 0
    if(cupboardcontents.value > 0){
        kitchen = kitchen + parseInt(cupboardcontents.value, 10);
    } 
    
    var kitchenother= 0;
    var kitchenother = theForm.elements["kitchenother"];
    //If the box has a greater value than 0
    if(kitchenother.value > 0){
        kitchen = kitchen + parseInt(kitchenother.value, 10);
    }  
            
    return kitchen;
}



function bedroom()
{  
    var bedroomFurniture= 0;
    var bedroom = 0;
    var theForm = document.forms["contentsCalculator"];
    
    var bedroomFurniture = theForm.elements["bedroomFurniture"];
    //If the box has a greater value than 0
    if(bedroomFurniture.value > 0){
        bedroom = bedroom + parseInt(bedroomFurniture.value, 10);
    } 
    var bedroomcurtainsAndBlinds= 0;
    var bedroomcurtainsAndBlinds = theForm.elements["bedroomcurtainsAndBlinds"];
    //If the box has a greater value than 0
    if(bedroomcurtainsAndBlinds.value > 0){
        bedroom = bedroom + parseInt(bedroomcurtainsAndBlinds.value, 10);
    }    
    
        var bedroomcarpetsandFloors= 0;
    var bedroomcarpetsandFloors = theForm.elements["bedroomcarpetsandFloors"];
    //If the box has a greater value than 0
    if(bedroomcarpetsandFloors.value > 0){
        bedroom = bedroom + parseInt(bedroomcarpetsandFloors.value, 10);
    }  
    
        var bedroomelectricalItems= 0;
    var bedroomelectricalItems = theForm.elements["bedroomelectricalItems"];
    //If the box has a greater value than 0
    if(bedroomelectricalItems.value > 0){
        bedroom = bedroom + parseInt(bedroomelectricalItems.value, 10);
    }  
    
        var bedroomhifiEquipment= 0;
    var bedroomhifiEquipment = theForm.elements["bedroomhifiEquipment"];
    //If the box has a greater value than 0
    if(bedroomhifiEquipment.value > 0){
        bedroom = bedroom + parseInt(bedroomhifiEquipment.value, 10);
    }  
    
        var bedroomornaments= 0;
    var bedroomornaments = theForm.elements["bedroomornaments"];
    //If the box has a greater value than 0
    if(bedroomornaments.value > 0){
        bedroom = bedroom + parseInt(bedroomornaments.value, 10);
    }  
    
        var bedroomtelevisions= 0;
    var bedroomtelevisions = theForm.elements["bedroomtelevisions"];
    //If the box has a greater value than 0
    if(bedroomtelevisions.value > 0){
        bedroom = bedroom + parseInt(bedroomtelevisions.value, 10);
    }  
    
        var bedroomgames= 0;
    var bedroomgames = theForm.elements["bedroomgames"];
    //If the box has a greater value than 0
    if(bedroomgames.value > 0){
        bedroom = bedroom + parseInt(bedroomgames.value, 10);
    }  
    
        var bedlinen= 0;
    var bedlinen = theForm.elements["bedlinen"];
    //If the box has a greater value than 0
    if(bedlinen.value > 0){
        bedroom = bedroom + parseInt(bedlinen.value, 10);
    }  
    
        var bedroombooks= 0;
    var bedroombooks = theForm.elements["bedroombooks"];
    //If the box has a greater value than 0
    if(bedroombooks.value > 0){
        bedroom = bedroom + parseInt(bedroombooks.value, 10);
    } 
    
       var clothes= 0;
    var clothes = theForm.elements["clothes"];
    //If the box has a greater value than 0
    if(clothes.value > 0){
        bedroom = bedroom + parseInt(clothes.value, 10);
    } 
    
    var bedroomother= 0;
    var bedroomother = theForm.elements["bedroomother"];
    //If the box has a greater value than 0
    if(bedroomother.value > 0){
        bedroom = bedroom + parseInt(bedroomother.value, 10);
    }  
            
    return bedroom;
}

function bathroom()
{  
    var bathroomFurniture= 0;
    var bathroom = 0;
    var theForm = document.forms["contentsCalculator"];
    
    var bathroomFurniture = theForm.elements["bathroomFurniture"];
    //If the box has a greater value than 0
    if(bathroomFurniture.value > 0){
        bathroom = bathroom + parseInt(bathroomFurniture.value, 10);
    } 
    var bathroomcurtainsAndBlinds= 0;
    var bathroomcurtainsAndBlinds = theForm.elements["bathroomcurtainsAndBlinds"];
    //If the box has a greater value than 0
    if(bathroomcurtainsAndBlinds.value > 0){
        bathroom = bathroom + parseInt(bathroomcurtainsAndBlinds.value, 10);
    }    
    
        var bathroomcarpetsandFloors= 0;
    var bathroomcarpetsandFloors = theForm.elements["bathroomcarpetsandFloors"];
    //If the box has a greater value than 0
    if(bathroomcarpetsandFloors.value > 0){
        bathroom = bathroom + parseInt(bathroomcarpetsandFloors.value, 10);
    }  
    
        var bathroomelectricalItems= 0;
    var bathroomelectricalItems = theForm.elements["bathroomelectricalItems"];
    //If the box has a greater value than 0
    if(bathroomelectricalItems.value > 0){
        bathroom = bathroom + parseInt(bathroomelectricalItems.value, 10);
    }  
    
        var perfume= 0;
    var perfume = theForm.elements["perfume"];
    //If the box has a greater value than 0
    if(perfume.value > 0){
        bathroom = bathroom + parseInt(perfume.value, 10);
    }  
        
    var bathroomother= 0;
    var bathroomother = theForm.elements["bathroomother"];
    //If the box has a greater value than 0
    if(bathroomother.value > 0){
        bathroom = bathroom + parseInt(bathroomother.value, 10);
    }  
            
    return bathroom;
}

function garden()
{  
    var gardenbuildings= 0;
    var garden = 0;
    var theForm = document.forms["contentsCalculator"];
    
    var gardenbuildings = theForm.elements["gardenbuildings"];
    //If the box has a greater value than 0
    if(gardenbuildings.value > 0){
        garden = garden + parseInt(gardenbuildings.value, 10);
    } 
    var gardenfurniture= 0;
    var gardenfurniture = theForm.elements["gardenfurniture"];
    //If the box has a greater value than 0
    if(gardenfurniture.value > 0){
        garden = garden + parseInt(gardenfurniture.value, 10);
    }    
    
        var gardenmachinery= 0;
    var gardenmachinery = theForm.elements["gardenmachinery"];
    //If the box has a greater value than 0
    if(gardenmachinery.value > 0){
        garden = garden + parseInt(gardenmachinery.value, 10);
    }  
    
        var gardentools= 0;
    var gardentools = theForm.elements["gardentools"];
    //If the box has a greater value than 0
    if(gardentools.value > 0){
        garden = garden + parseInt(gardentools.value, 10);
    }  
    
        var powertools= 0;
    var powertools = theForm.elements["powertools"];
    //If the box has a greater value than 0
    if(powertools.value > 0){
        garden = garden + parseInt(powertools.value, 10);
    }  
    
        var gardenornaments= 0;
    var gardenornaments = theForm.elements["gardenornaments"];
    //If the box has a greater value than 0
    if(gardenornaments.value > 0){
        garden = garden + parseInt(gardenornaments.value, 10);
    }  
    
        var playequipment= 0;
    var playequipment = theForm.elements["playequipment"];
    //If the box has a greater value than 0
    if(playequipment.value > 0){
        garden = garden + parseInt(playequipment.value, 10);
    }  
    
    var gardenother= 0;
    var gardenother = theForm.elements["gardenother"];
    //If the box has a greater value than 0
    if(gardenother.value > 0){
        garden = garden + parseInt(gardenother.value, 10);
    }  
            
    return garden;
}

function valuable()
{  
    var antiques= 0;
    var valuable = 0;
    var theForm = document.forms["contentsCalculator"];
    
    var antiques = theForm.elements["antiques"];
    //If the box has a greater value than 0
    if(antiques.value > 0){
        valuable = valuable + parseInt(antiques.value, 10);
    } 
    var collections= 0;
    var collections = theForm.elements["collections"];
    //If the box has a greater value than 0
    if(collections.value > 0){
        valuable = valuable + parseInt(collections.value, 10);
    }    
    
        var jewellery= 0;
    var jewellery = theForm.elements["jewellery"];
    //If the box has a greater value than 0
    if(jewellery.value > 0){
        valuable = valuable + parseInt(jewellery.value, 10);
    }  
    
        var valuableornaments= 0;
    var valuableornaments = theForm.elements["valuableornaments"];
    //If the box has a greater value than 0
    if(valuableornaments.value > 0){
        valuable = valuable + parseInt(valuableornaments.value, 10);
    }  
    
        var personalitems= 0;
    var personalitems = theForm.elements["personalitems"];
    //If the box has a greater value than 0
    if(personalitems.value > 0){
        valuable = valuable + parseInt(personalitems.value, 10);
    }  
    
        var luggage= 0;
    var luggage = theForm.elements["luggage"];
    //If the box has a greater value than 0
    if(luggage.value > 0){
        valuable = valuable + parseInt(luggage.value, 10);
    }  
    
        var musicalinstruments= 0;
    var musicalinstruments = theForm.elements["musicalinstruments"];
    //If the box has a greater value than 0
    if(musicalinstruments.value > 0){
        valuable = valuable + parseInt(musicalinstruments.value, 10);
    }  
    
        var sportsequipment= 0;
    var sportsequipment = theForm.elements["sportsequipment"];
    //If the box has a greater value than 0
    if(sportsequipment.value > 0){
        valuable = valuable + parseInt(sportsequipment.value, 10);
    }  
        
    var valuableother= 0;
    var valuableother = theForm.elements["valuableother"];
    //If the box has a greater value than 0
    if(valuableother.value > 0){
        valuable = valuable + parseInt(valuableother.value, 10);
    }  
            
    return valuable;
}

function extra()
{  
    var extrafurniture= 0;
    var extra = 0;
    var theForm = document.forms["contentsCalculator"];
    
    var extrafurniture = theForm.elements["extrafurniture"];
    //If the box has a greater value than 0
    if(extrafurniture.value > 0){
        extra = extra + parseInt(extrafurniture.value, 10);
    } 
    var extracurtainsAndBlinds= 0;
    var extracurtainsAndBlinds = theForm.elements["extracurtainsAndBlinds"];
    //If the box has a greater value than 0
    if(extracurtainsAndBlinds.value > 0){
        extra = extra + parseInt(extracurtainsAndBlinds.value, 10);
    }    
    
        var extracarpetsandFloors= 0;
    var extracarpetsandFloors = theForm.elements["extracarpetsandFloors"];
    //If the box has a greater value than 0
    if(extracarpetsandFloors.value > 0){
        extra = extra + parseInt(extracarpetsandFloors.value, 10);
    }  
    
        var extraelectricalItems= 0;
    var extraelectricalItems = theForm.elements["extraelectricalItems"];
    //If the box has a greater value than 0
    if(extraelectricalItems.value > 0){
        extra = extra + parseInt(extraelectricalItems.value, 10);
    }  
    
        var extraAppliances= 0;
    var extraAppliances = theForm.elements["extraAppliances"];
    //If the box has a greater value than 0
    if(extraAppliances.value > 0){
        extra = extra + parseInt(extraAppliances.value, 10);
    }  
        
    var extraother= 0;
    var extraother = theForm.elements["extraother"];
    //If the box has a greater value than 0
    if(extraother.value > 0){
        extra = extra + parseInt(extraother.value, 10);
    }  
            
    return extra;
}

        
function calculateTotal()
{
    //Here we get the total price by calling our function
    //Each function returns a number so by calling them we add the values they return together
    var totalPrice = lounge() + dining() + office() + kitchen() + garden() + bedroom() + valuable() + extra() + bathroom();
    
    //display the results
    
    var divobj = document.getElementById('totalPrice');
    divobj.style.display='block';
    divobj.innerHTML = "Total Value of your contents &pound;"+totalPrice;

    var divobj = document.getElementById('totalValue');
    divobj.value = totalPrice;
    
    var divobj = document.getElementById('loungePrice');
    divobj.style.display='block';
    divobj.innerHTML = "&pound;"+lounge();
    
    var divobj = document.getElementById('diningPrice');
    divobj.style.display='block';
    divobj.innerHTML = "&pound;"+dining();
    
    var divobj = document.getElementById('officePrice');
    divobj.style.display='block';
    divobj.innerHTML = "&pound;"+office();
    
        var divobj = document.getElementById('kitchenPrice');
    divobj.style.display='block';
    divobj.innerHTML = "&pound;"+kitchen();
    
        var divobj = document.getElementById('bedroomPrice');
    divobj.style.display='block';
    divobj.innerHTML = "&pound;"+bedroom();
    
        var divobj = document.getElementById('gardenPrice');
    divobj.style.display='block';
    divobj.innerHTML = "&pound;"+garden();
    
        var divobj = document.getElementById('valuablePrice');
    divobj.style.display='block';
    divobj.innerHTML = "&pound;"+valuable();
    
        var divobj = document.getElementById('extraPrice');
    divobj.style.display='block';
    divobj.innerHTML = "&pound;"+extra();
    
            var divobj = document.getElementById('bathroomPrice');
    divobj.style.display='block';
    divobj.innerHTML = "&pound;"+bathroom();
}

function hideTotal()
{
    var divobj = document.getElementById('totalPrice');
    divobj.style.display='none';
}
