function getPorts(country)
{
	var str = '<option value="">--- Choose ---</option>';
	
	if(typeof ports[country] == 'undefined' || ports[country] == '')
	{
	  $('ports_div').update('<a href="http://www.bidux.com/transport/oceantransport/action/request/countryId/">Send request</a>');
	  $('informeterResult').hide();
	}
	else
	{
		$('ports_div').update('<select id="ports_sel" name="ports_sel" onchange="getPriceOcean(this.value, $(\'country\').value);" style="width: 140px;"></select>');
		ports[country].each(function(s, index) 
		{
		  str += '<option value='+index+'>'+s+'</option>';
		});
		$('ports_sel').update(str);
	}
}

function getPriceOcean(idx, country)
{
  price_lt = parseInt($('price_land').innerHTML);
  if (typeof price_lt == 'undefined' || price_lt == '' || isNaN(price_lt))
  {
    price_lt = 0;
  }
  
  $('informeterResult').show();
  $('ocean_price').update(prices[country][idx]);
  
  price_t = price_lt + parseInt(prices[country][idx]);
  
  $('total').update(price_t);
}

function getLandPrice()
{
  c_zip = $('client_zip').value;
  $('price_land').update("");
  $('price_cur').update("");
   
  new Ajax.Request('http://bidux.com/google.php?zip='+c_zip,
  {
    method:'get',
    onSuccess: function(transport)
    {
       lp = parseInt(transport.responseText);
       if (lp == 0 || isNaN(lp))
       {
          alert("Sorry, try another ZIP. Can't calculate the distance.");
       }
       else
       {
         $('price_land').update(lp);
         $('price_cur').update("USD");
         
         op = parseInt($('ocean_price').innerHTML);
         if (isNaN(op))
         { 
            op = 0;
         }
         
         tp = lp+op;
         $('total').update(tp);
         
       }
    },
    onFailure: function(){ alert('Something went wrong...') }
  });
   
}