var regionWhangareiArray = new Array([['Whangarei City'],['01']], [['Other'],['02']]);

var regionAucklandCityArray = new Array([['Auck CBD'],['01']], [['Avondale'],['02']], [['Blockhouse Bay'],['03']],[['Eden Tce'],['04']],[['Ellerslie'],['05']], [['Epsom'],['06']], [['Freemans Bay'],['07']], [['Glen Innes'],['08']], [['Glendowie'],['09']], [['Grafton'],['10']], [['Greenlane'],['11']], [['Grey Lynn'],['12']], [['Hobson'],['13']], [['Lynfield'],['14']], [['Meadow Park'],['15']], [['Mission Bay'],['16']], [['Mt Albert'],['17']], [['Mt Eden'],['18']], [['Mt Roskill'],['19']], [['Mt Wellington'],['20']], [['New Market'],['21']], [['One Tree Hill'],['22']], [['Onehunga'],['23']], [['Panmure'],['24']], [['Papakura'],['25']], [['Parnell'],['26']], [['Penrose'],['27']], [['Point Chevalier'],['28']], [['Ponsonby'],['29']], [['Remuera'],['30']], [['Royal Oak'],['31']], [['Sandringham'],['32']], [['St Helliers'],['33']], [['St Johns'],['34']], [['Three Kings'],['35']], [['Viaduct Basin'],['36']],  [['Western Springs'],['37']], [['Westhaven'],['38']], [['Westmere'],['39']], [['Other'],['40']]);
var regionAucklandNorthshoreArray = new Array([['Albany'],['01']], [['Beachhaven'],['02']], [['Birkdale'],['03']],[['Birkenhead'],['04']],[['Browns Bay'],['05']],[['Chatswood'],['06']], [['Devonport'],['07']], [['Glenfield'],['08']], [['Greenhithe'],['09']], [['Hillcrest'],['10']], [['Mairangi Bay'],['11']], [['Meadowood'],['12']], [['Milford'],['13']], [['North Harbour'],['14']], [['Northshore'],['15']], [['Northcote'],['16']], [['Okura'],['17']], [['Pinehill'],['18']], [['Rosedale'],['19']], [['Takapuna'],['20']], [['Torbay'],['21']], [['Other'],['22']]);
var regionAucklandSouthArray = new Array([['Auckland Airport'],['01']], [['Botany Downs'],['02']], [['Cockle Bay'],['03']],[['East Tamaki'],['04']],[['Highland Park'],['05']],[['Howick'],['06']], [['Mangere'],['07']], [['Manukau'],['08']], [['Manurewa'],['09']], [['Middlemore'],['10']], [['Otara'],['11']], [['Pakuranga'],['12']], [['Papatoetoe'],['13']], [['Wattledowns'],['14']],[['Other'],['15']]);
var regionAucklandWestArray = new Array([['Glen Eden'],['01']], [['Green Bay'],['02']], [['Henderson'],['03']],[['Massey'],['04']],[['New Lynn'],['05']],[['Ranui'],['06']],[['Sunnyvale'],['07']], [['Swanson'],['08']], [['Titirangi'],['09']],[['Other'],['10']]);

var regionHamiltonArray = new Array([['Hamilton City'],['01']], [['Other'],['02']]);
var regionTaurangaArray = new Array([['Tauranga City'],['01']], [['Mt Maunganui'],['02']], [['Other'],['03']]);
var regionRotoruaArray = new Array([['Rotorua City'],['01']], [['Other'],['02']]);
var regionPalmerstonNorthArray = new Array([['Palmerston North City'],['01']],[['Massey'],['02']],[['Linton'],['03']],[['Tokomaru'],['04']],[['Longburn'],['05']],[['Rongotea'],['06']],[['Feilding'],['07']],[['Ashhurst'],['08']], [['Other'],['09']]);
var regionWanganuiArray = new Array([['Wanganui City'],['01']], [['Other'],['02']]);
var regionHawkesBayArray = new Array([['Napier'],['01']],[['Hastings'],['02']],[['Taradale'],['03']],[['Havelock North'],['04']],[['Westshore'],['05']],[['Awatoto'],['06']], [['Other'],['07']]);
var regionNewPlymouthArray = new Array([['New Plymouth City'],['01']],[['Bell Block'],['02']],[['Omata'],['03']],[['Oakura'],['04']], [['Other'],['05']]);
var regionWellingtonArray = new Array([['Wellington'],['01']],[['Johnsonville'],['02']],[['Tawa'],['03']],[['Porirua'],['04']],[['Whitby'],['05']],[['Stokes Valley'],['06']],[['Upper Hutt'],['07']],[['Lower Hutt'],['08']],[['Petone'],['09']],[['Wainuiomata'],['10']],[['Eastbourne'],['11']], [['Other'],['12']]);
var regionNelsonArray = new Array([['Nelson'],['01']],[['Stoke'],['02']],[['Richmond'],['03']],[['Motueka'],['04']], [['Other'],['05']]);
var regionBlenheimArray = new Array([['Blenheim City'],['01']], [['Other'],['02']]);
var regionChristchurchArray = new Array([['Christchurch City'],['01']],[['Lyttelton'],['02']],[['Prebbleton'],['03']],[['Sumner'],['04']],[['Belfast'],['05']],[['Kaiapoi'],['06']], [['Other'],['07']]);
var regionTimaruArray = new Array([['Timaru'],['01']], [['Other'],['02']]);
var regionDunedinArray = new Array([['Dunedin City'],['01']],[['Mosgiel'],['02']],[['Outram'],['03']],[['Port Chalmers'],['04']], [['Other'],['05']]);
var regionQueenstownArray = new Array([['Queenstown City'],['01']],[['Wanaka'],['02']],[['Cromwell'],['03']], [['Other'],['04']]);
var regionInvercargillArray = new Array([['Invercargill City'],['01']],[['Bluff'],['02']], [['Other'],['03']]);

var northislandArray = new Array('Whangarei','Auckland City','Auckland Northshore','Auckland South','Auckland West','Hamilton','Tauranga','Rotorua','Palmerston North','Wanganui','Hawkes Bay','New Plymouth','Wellington', 'Other-North-Island');
var southislandArray = new Array('Nelson','Blenheim','Christchurch','Timaru','Dunedin','Queenstown','Invercargill', 'Other-South-Island');
var samecityArray = new Array('Auckland City','Auckland Northshore','Auckland South','Auckland West');

var pickupcityArray = new Array([['Whangarei'],['01']], [['Auckland City'],['02']], [['Auckland Northshore'],['03']],[['Auckland South'],['04']],[['Auckland West'],['05']], [['Hamilton'],['06']],[['Tauranga'],['07']],[['Rotorua'],['08']],[['Palmerston North'],['09']],[['Wanganui'],['10']],[['Hawkes Bay'],['11']],[['New Plymouth'],['12']],[['Wellington'],['13']],[['Nelson'],['14']],[['Blenheim'],['15']],[['Christchurch'],['16']],[['Timaru'],['17']],[['Dunedin'],['18']],[['Queenstown'],['19']],[['Invercargill'],['20']],[['Other-North-Island'],['21']],[['Other-South-Island'],['22']]);

//var regionOtherArray = new Array('Please type in you location');



function GetSearchLocations(RegionValue, RegionField, IdName, FieldName, bQQC)
{

//remove space from region value
var newstr = RegionValue.replace('/', '') ;
var newRegion = '';
var sOptions = '';

document.getElementById('First_note').innerHTML = '';
document.getElementById('Second_note').innerHTML = '';
document.getElementById('Third_note').innerHTML = '';
document.getElementById('Forth_note').innerHTML = '';
document.getElementById('totalCostNote').innerHTML = '';
document.getElementById('Fifth_note').innerHTML = '';

//remove space from region value
  for (var iCharPos = 0; iCharPos < newstr.length; iCharPos++) {
    if (newstr.charAt(iCharPos) != ' ') 
    {  
       
       newRegion = newRegion + newstr.charAt(iCharPos); 
    } 
  }  

//alert ("RegionValue is " + RegionValue);
if ((RegionValue == "Other-North-Island") || (RegionValue == "0")|| (RegionValue == "Other-South-Island"))
{
 document.getElementById(IdName).innerHTML = '<input type="hidden" name="' + FieldName + '">'; 
 
}
else { 

    var RegionarrayName = "region"+newRegion+"Array";

	if (eval("typeof(" + RegionarrayName + ") != 'undefined'")) {
		Regionarray = eval(RegionarrayName);
		
		var ArrStart = 0;
		var ArrEnd = Regionarray.length - 1;
		//alert('ArrEnd  is ' + ArrEnd);
        
		for (i=ArrStart; i<= ArrEnd; i++) {
                  sOptions = sOptions + '<option value="' + Regionarray[i][0] + '">' + Regionarray[i][0] + '</option>';	
				  //alert(i + ' is ' + Regionarray[i][0]);
		}

		sOptions = '<select name="' + FieldName + '" onChange="getweight('+bQQC+')"><option value="0">..then a suburb</option>' + sOptions + '</select>';

		document.getElementById(IdName).innerHTML = sOptions;
       
	}


 }//end else

 if (IdName == 'deliverysuburb'){
 
   getweight(bQQC);
 }

}

function GetPickupCityUniqueKey(SelectValue)
{

  //remove space from region value
  var newstr = SelectValue.replace('/', '') ;
  var newRegion = '';
  var sOptions = ''; 
 

    var RegionarrayName = "pickupcityArray";

	if (eval("typeof(" + RegionarrayName + ") != 'undefined'")) {
		Regionarray = eval(RegionarrayName);
		
		var ArrStart = 0;
		var ArrEnd = Regionarray.length - 1;
        
		for (i=ArrStart; i<= ArrEnd; i++) {
		    if (SelectValue == Regionarray[i][0])
		    {
			  return Regionarray[i][1];
		    }
                  			
		}
       
	}
}


function GetPickupSuburbUniqueKey(PickupCityStr, SelectValue)
{

  //remove space from region value
  var newstr = PickupCityStr.replace('/', '') ;
  var newRegion = '';
  var sOptions = ''; 
 

   for (var iCharPos = 0; iCharPos < newstr.length; iCharPos++) {
    if (newstr.charAt(iCharPos) != ' ') 
    {  
       
       newRegion = newRegion + newstr.charAt(iCharPos); 
    } 
  }  

    var RegionarrayName = "region"+newRegion+"Array";

	if (eval("typeof(" + RegionarrayName + ") != 'undefined'")) {
		Regionarray = eval(RegionarrayName);
		
		var ArrStart = 0;
		var ArrEnd = Regionarray.length - 1;
        
		for (i=ArrStart; i<= ArrEnd; i++) {
		    if (SelectValue == Regionarray[i][0])
		    {
			  return Regionarray[i][1];
		    }
                  			
		}
       
	}
}

function GetPickupSuburbIndex(PickupCityStr, SelectValue)
{

    var RegionarrayName = "region"+PickupCityStr+"Array";

	if (eval("typeof(" + RegionarrayName + ") != 'undefined'")) {
		Regionarray = eval(RegionarrayName);
		
		var ArrStart = 0;
		var ArrEnd = Regionarray.length - 1;
        
		for (i=ArrStart; i<= ArrEnd; i++) {
		    if (SelectValue == Regionarray[i][1])
		    {
			  return i+1;
		    }
                  			
		}
       
	}
}

function getweight(bQQC){
  var sOptions ='';
  var sIslandType = '';

  var sPickup = document.SmallQuoteForm.pick_up_city.value;
  var sDelivery = document.SmallQuoteForm.delivery_city.value;

  var inSouthPU = searchString(southislandArray,sPickup);  
  var inNorthPU = searchString(northislandArray,sPickup);

  var inSouthD = searchString(southislandArray,sDelivery);
  var inNorthD = searchString(northislandArray,sDelivery);

  var inSameCityP = searchString(samecityArray,sPickup);
  var inSameCityD = searchString(samecityArray,sDelivery);

  var sPickupsuburb = '';
  var sDeliverysuburb = '';
  
  
  //alert ('value is ' + sPickup + ' in North ' + inNorthPU);
  
 // alert ('value is ' + sDelivery + ' in North ' + inNorthD);

  if (((inSouthPU) && (inSouthD)) || ((inNorthPU) && (inNorthD)) )
  {
//       sOptions = '<option value="0">Select  Weight (kg)</option>' +
//               '<option value="up to 5kg">up to 5kg</option>' + 
//               '<option value="5.1kg to 10kg">5.1kg to 10kg</option>' + 
//               '<option value="10.1kg to 15 kg">10.1kg to 15 kg</option>' + 
//               '<option value="15.1kg to 20kg">15.1kg to 20kg</option>' + 
//               '<option value="20.1kg to 25kg">20.1kg to 25kg</option>' + 
//               '<option value="Over 25kg">Over 25kg</option>';

       sOptions = '<option value="0">Select  Weight (kg)</option>' +
               '<option value="up to 3kg">up to 3kg</option>' + 
               '<option value="3.1kg to 8kg">3.1kg to 8kg</option>' + 
               '<option value="8.1kg to 13kg">8.1kg to 13kg</option>' + 
               '<option value="13.1kg to 18kg">13.1kg to 18kg</option>' + 
               '<option value="18.1kg to 25kg">18.1kg to 25kg</option>' + 
               '<option value="Over 25kg">Over 25kg</option>';

	  //alert ('same island value is ' + sPickup + ' in South ' + inSouthPU);
  
    // alert ('same island  value is ' + sDelivery + ' in South ' + inNorthD);
	
	 if ( ((sPickup != '') && (sDelivery != '')) && ((sPickup == sDelivery) && (sPickup != 'Other-South-Island') && (sPickup != 'Other-North-Island') || ((inSameCityP) && (inSameCityD)) ))
     {
	    if (typeof(document.SmallQuoteForm.pick_up_suburb) != 'undefined')
        {
           sPickupsuburb = document.SmallQuoteForm.pick_up_suburb.value;
        }
        if (typeof(document.SmallQuoteForm.delivery_suburb) != 'undefined')
        {
         sDeliverysuburb = document.SmallQuoteForm.delivery_suburb.value;
        }

        if ((sPickupsuburb == 'Other') || (sDeliverysuburb == 'Other'))
        {
	          sIslandType = 'same_island';
        }
	    else {
         sIslandType = 'same_town';
	     sOptions = '<option value="0">Select  Weight (kg)</option>' +
               '<option value="25kg or less">25kg or less</option>' + 
               '<option value="Over 25kg">Over 25kg</option>';
	    }
      }
	  else {
          sIslandType = 'same_island';
	  }
      //alert (sIslandType);

  }
  else {

//       sOptions = '<option value="0">Select  Weight (kg)</option>' +
//               '<option value="up to 5kg">up to 5kg</option>' + 
//               '<option value="5.1kg to 10kg">5.1kg to 10kg</option>' + 
//               '<option value="10.1kg to 15 kg">10.1kg to 15 kg</option>' + 
//               '<option value="15.1kg to 20kg">15.1kg to 20kg</option>' + 
//               '<option value="20.1kg to 25kg">20.1kg to 25kg</option>' + 
//               '<option value="Over 25kg">Over 25kg</option>';
               
       sOptions = '<option value="0">Select  Weight (kg)</option>' +
               '<option value="up to 3kg">up to 3kg</option>' + 
               '<option value="3.1kg to 8kg">3.1kg to 8kg</option>' + 
               '<option value="8.1kg to 13kg">8.1kg to 13kg</option>' + 
               '<option value="13.1kg to 18kg">13.1kg to 18kg</option>' + 
               '<option value="18.1kg to 25kg">18.1kg to 25kg</option>' + 
               '<option value="Over 25kg">Over 25kg</option>';

	    sIslandType = 'cross_island';
  }
  //alert (sIslandType);
  if (!bQQC)
  {
      document.getElementById('1st_weight').innerHTML = '<select name="first_item_weight">' + sOptions + '</select>';
      document.getElementById('2nd_weight').innerHTML = '<select name="second_item_weight">' + sOptions + '</select>';
      document.getElementById('3rd_weight').innerHTML = '<select name="third_item_weight">' + sOptions + '</select>';
      document.getElementById('4th_weight').innerHTML = '<select name="forth_item_weight">' + sOptions + '</select>';
      document.getElementById('5th_weight').innerHTML = '<select name="fifth_item_weight">' + sOptions + '</select>'; 
  }
 // alert(sIslandType);
  document.SmallQuoteForm.Island_type.value = sIslandType;
}

function getsuburbweight(){
  var sOptions ='';
  var sIslandType = document.SmallQuoteForm.Island_type.value;
  var sPickup = '';
  var sDelivery = '';

  if (typeof(document.SmallQuoteForm.pick_up_suburb) != 'undefined')
  {
    sPickup = document.SmallQuoteForm.pick_up_suburb.value;
  }
  if (typeof(document.SmallQuoteForm.delivery_suburb) != 'undefined')
  {
    sDelivery = document.SmallQuoteForm.delivery_suburb.value;
  }

   alert (sIslandType + sPickup + sDelivery);

  if ((sIslandType == 'same_town') && ((sPickup == 'Other') || (sDelivery == 'Other')) )
  {
	   sOptions = '<option value="0">Select  Weight (kg)</option>' +
               '<option value="25kg or less">25kg or less</option>' + 
               '<option value="Over 25kg">Over 25kg</option>';
	  document.getElementById('1st_weight').innerHTML = '<select name="first_item_weight">' + sOptions + '</select>';
      document.getElementById('2nd_weight').innerHTML = '<select name="second_item_weight">' + sOptions + '</select>';
      document.getElementById('3rd_weight').innerHTML = '<select name="third_item_weight">' + sOptions + '</select>';
      document.getElementById('4th_weight').innerHTML = '<select name="forth_item_weight">' + sOptions + '</select>';
      document.getElementById('5th_weight').innerHTML = '<select name="fifth_item_weight">' + sOptions + '</select>'; 
      document.SmallQuoteForm.Island_type.value = 'same_island';

 }
 else {
   getweight();
 }   
   
}

function searchString(sarray,sstring){

  var found = false;
  var iLength = sarray.length-1; 
  var ArrStart = 0;

  for (i=ArrStart; i<= iLength; i++)  { 
   if (sarray[i] == sstring) {
     found = true;
     i = iLength;      
   }

  } 
  return found;

}

 function isNumberKey(evt, sField)
 {
         var charCode = (evt.which) ? evt.which : event.keyCode;
		 var hasChar = false;
         if (charCode > 31 && (charCode < 48 || charCode > 57)){
            alert('Please enter the dimension as whole centimetres - round up to the nearest whole centimetre.');
			hasChar = true;            
         }
		 if ((hasChar) ||  (sField.value.charAt(0) == '0'))
		 {
		   sField.value = '';
		   return false;
		 }
		 
         return true;
}

function CheckValues(sField, NoteName, iItem){

 sField.value =  removeSpaces((sField.value.replace(/[(*!a-zA-Z)&^@#$%_+,";:,?/\|><{}]/g,"")));
//alert('input value is:'+ sField.value);
 if ((sField.value == 'Over 25kg') || (sField.value > 190))
 { 
   document.getElementById(NoteName).innerHTML  = '<div class="note">Your item is too large - please use the <a href="http://zx.co.nz/lhquote.htm" class="note">Large/Heavy Item Quote Form</a></div>';
   //alert(sValue);
 }
 else if (sField.value == '0')
 {
   alert ('Please enter a number > 0'); 
   sField.value = '';  
 }
  else if (sField.value == '')
 {
   alert ('Please enter a number');
   //sField.focus();
 }
 else {
  document.getElementById(NoteName).innerHTML  = '';
 }

 if (iItem == 1)
 {
   var firstHeight =  removeSpaces((document.SmallQuoteForm.First_item_height.value.replace(/[(*!a-zA-Z)&^@#$%_+,";:,?/\|><{}]/g,"")));
   var firstLength = removeSpaces((document.SmallQuoteForm.First_item_length.value.replace(/[(*!a-zA-Z)&^@#$%_+,";:,?/\|><{}]/g,"")));
   if (document.SmallQuoteForm.elements['First_item_Box_or_Cylinder'][1].checked)
   {
       document.SmallQuoteForm.First_item_width.value = document.SmallQuoteForm.First_item_height.value;    
   }
   var firstWidth = removeSpaces((document.SmallQuoteForm.First_item_width.value.replace(/[(*!a-zA-Z)&^@#$%_+,";:,?/\|><{}]/g,"")));
   var ifirstSize = (firstHeight * firstLength * firstWidth)/ 1000000;
    document.SmallQuoteForm.First_item_total_size.value = ifirstSize;
  if (ifirstSize > 0.125)
  {
    document.getElementById('First_note').innerHTML  = '<div class="note">Your item is too large - please use the <a href="http://zx.co.nz/lhquote.htm" class="note">Large/Heavy Item Quote Form</a></div>';
  }
 }
 if (iItem == 2){
   var secondHeight =  removeSpaces((document.SmallQuoteForm.Second_item_height.value.replace(/[(*!a-zA-Z)&^@#$%_+,";:,?/\|><{}]/g,"")));
   var secondLength = removeSpaces((document.SmallQuoteForm.Second_item_length.value.replace(/[(*!a-zA-Z)&^@#$%_+,";:,?/\|><{}]/g,"")));
   if (document.SmallQuoteForm.elements['Second_item_Box_or_Cylinder'][1].checked)
   {
       document.SmallQuoteForm.Second_item_width.value = document.SmallQuoteForm.Second_item_height.value;    
   }
   var secondWidth = removeSpaces((document.SmallQuoteForm.Second_item_width.value.replace(/[(*!a-zA-Z)&^@#$%_+,";:,?/\|><{}]/g,"")));
   var isecondSize = (secondHeight * secondLength * secondWidth)/ 1000000;
      document.SmallQuoteForm.Second_item_total_size.value = isecondSize;
}
if (iItem == 3) {
   var thirdHeight =  removeSpaces((document.SmallQuoteForm.Third_item_height.value.replace(/[(*!a-zA-Z)&^@#$%_+,";:,?/\|><{}]/g,"")));
   var thirdLength = removeSpaces((document.SmallQuoteForm.Third_item_length.value.replace(/[(*!a-zA-Z)&^@#$%_+,";:,?/\|><{}]/g,"")));
   if (document.SmallQuoteForm.elements['Third_item_Box_or_Cylinder'][1].checked)
   {
       document.SmallQuoteForm.Third_item_width.value = document.SmallQuoteForm.Third_item_height.value;    
   }
   var thirdWidth = removeSpaces((document.SmallQuoteForm.Third_item_width.value.replace(/[(*!a-zA-Z)&^@#$%_+,";:,?/\|><{}]/g,"")));
   var ithirdSize = (thirdHeight * thirdLength * thirdWidth)/ 1000000;
      document.SmallQuoteForm.Third_item_total_size.value = ithirdSize;
  if (ithirdSize > 0.125)
  {
    document.getElementById('Third_note').innerHTML  = '<div class="note">Your item is too large - please use the <a href="http://zx.co.nz/lhquote.htm" class="note">Large/Heavy Item Quote Form</a></div>';
  }
}
if (iItem == 4){
 var forthHeight =  removeSpaces((document.SmallQuoteForm.Forth_item_height.value.replace(/[(*!a-zA-Z)&^@#$%_+,";:,?/\|><{}]/g,"")));
 var forthLength = removeSpaces((document.SmallQuoteForm.Forth_item_length.value.replace(/[(*!a-zA-Z)&^@#$%_+,";:,?/\|><{}]/g,"")));
 if (document.SmallQuoteForm.elements['Forth_item_Box_or_Cylinder'][1].checked)
 {
     document.SmallQuoteForm.Forth_item_width.value = document.SmallQuoteForm.Forth_item_height.value;    
 }
 var forthWidth = removeSpaces((document.SmallQuoteForm.Forth_item_width.value.replace(/[(*!a-zA-Z)&^@#$%_+,";:,?/\|><{}]/g,"")));
 var iforthSize = (forthHeight * forthLength * forthWidth)/ 1000000;
    document.SmallQuoteForm.Forth_item_total_size.value = iforthSize;
  if (iforthSize > 0.125)
  {
    document.getElementById('Forth_note').innerHTML  = '<div class="note">Your item is too large - please use the <a href="http://zx.co.nz/lhquote.htm" class="note">Large/Heavy Item Quote Form</a></div>';
  }
}
if (iItem == 5) {
 var fifthHeight =  removeSpaces((document.SmallQuoteForm.Fifth_item_height.value.replace(/[(*!a-zA-Z)&^@#$%_+,";:,?/\|><{}]/g,"")));
 var fifthLength = removeSpaces((document.SmallQuoteForm.Fifth_item_length.value.replace(/[(*!a-zA-Z)&^@#$%_+,";:,?/\|><{}]/g,"")));
 if (document.SmallQuoteForm.elements['Fifth_item_Box_or_Cylinder'][1].checked)
 {
     document.SmallQuoteForm.Fifth_item_width.value = document.SmallQuoteForm.Fifth_item_height.value;    
 }
 var fifthWidth = removeSpaces((document.SmallQuoteForm.Fifth_item_width.value.replace(/[(*!a-zA-Z)&^@#$%_+,";:,?/\|><{}]/g,"")));
 var ififthSize = (fifthHeight * fifthLength * fifthWidth)/ 1000000;
    document.SmallQuoteForm.Fifth_item_total_size.value = ififthSize;
  if (ififthSize > 0.125)
  {
    document.getElementById('Fifth_note').innerHTML  = '<div class="note">Your item is too large - please use the <a href="http://zx.co.nz/lhquote.htm" class="note">Large/Heavy Item Quote Form</a></div>';
  }

}
 //alert (firstHeight);
 
 

}

function removeSpaces(string) {
	var tstring = "";
	string = '' + string;
	splitstring = string.split(" ");
	for(i = 0; i < splitstring.length; i++)
	tstring += splitstring[i];
	return tstring;
}
