function calculateTotal (form) { 
	var numberOne = +form.number1.value;		
	var answerOne = ((numberOne * 10)/100);
	var total = (answerOne + numberOne);
	form.boxtotal.value = (total);
	}


function changeDiv(the_div,the_change)
{
  var the_style = getStyleObject(the_div);
  if (the_style != false)
  {
    the_style.display = the_change;
  }
}
function hideAll()
{
  changeDiv("livestock_questions","none");
  changeDiv("additional_questions","none");
}
// questions
function showLivestock()
{
 changeDiv("livestock_additional_no","block");
}
function showHousehold()
{
 changeDiv("household_additional_no","block");
}
//livestock questionaire
function hideLivestock()
{
  changeDiv("livestock_questions","none");
}
//household items questionaire
function hideHouseholdItems()
{
  changeDiv("household_items","none");
}
// cargo application form questions
function hideEnclosedContainer()
{
  changeDiv("enclosed_container","none");
}
function hideTranshippedDetails()
{
  changeDiv("transhipped_details","none");
}
function hideRiskCover()
{
  changeDiv("risk_cover","none");
}
function hideExcessAmount()
{
  changeDiv("excess_amount","none");
}
function hideSumInsured()
{
  changeDiv("sum_insured","none");
}
function hideMixedGoodsCondition()
{
  changeDiv("mixed_goods_condition","none");
}
function hideCombinedShipping()
{
  changeDiv("combined_shipping","none");
}

// insurance cover commencement (form radio group) 
function hideCoverCommencement()
{
  changeDiv("shipments","none");
    changeDiv("pregnant","none");
	  changeDiv("transit_farm","none");
	    changeDiv("transit_at_quarantine","none");
		  changeDiv("transit_quarantine","none");
		    changeDiv("transit_port","none");
}
// each individual section for insurance cover comencement
function hideShipments()
{
  changeDiv("shipments","none");
}
function hidePregnant()
{
  changeDiv("pregnant","none");
}
function hideTransitFarm()
{
  changeDiv("transit_farm","none");
}
function hideAtQuarantine()
{
  changeDiv("transit_at_quarantine","none");
}
function hideTransitQuarantine()
{
  changeDiv("transit_quarantine","none");
}
function hidePort()
{
  changeDiv("transit_port","none");
}
// insurance cover completetion section (form radio group)
function hideCoverTermination()
{
  changeDiv("quarantine_arrival","none");
    changeDiv("quarantine_completion","none");
	  changeDiv("final_destination","none");
}
// insurance cover completetion , each individual question
function hideQuarantineArrival()
{
  changeDiv("quarantine_arrival","none");
}

function hideQuarantineCompletion()
{
  changeDiv("quarantine_completion","none");
}

function hideFinalDestination()
{
  changeDiv("final_destination","none");
}

function getStyleObject(objectId) {
  if (document.getElementById && document.getElementById(objectId)) {
    return document.getElementById(objectId).style;
  } else if (document.all && document.all(objectId)) {
    return document.all(objectId).style;
  } else {
    return false;
  }
}
var lastDiv = "";
function showDiv(divName) {
	// hide last div
	if (lastDiv) {
		document.getElementById(lastDiv).className = "hiddenDiv";
	}
	//if value of the box is not nothing and an object with that name exists, then change the class
	if (divName && document.getElementById(divName)) {
		document.getElementById(divName).className = "visibleDiv";
		lastDiv = divName;
	}
}
