var eng_geo = deu_geo = fra_geo = eng_rus = deu_rus = fra_rus = 15.34;
var geo_eng = geo_deu = geo_fra = rus_eng = rus_deu = rus_fra = 17.70;
var ita_geo = esp_geo = grc_geo = ita_rus = esp_rus = grc_rus = geo_ita = geo_esp = geo_grc = rus_ita = rus_esp = rus_grc = 17.70;
var rus_geo = geo_rus = 11.80;
var isr_geo = geo_isr = 23.60;
var ukr_geo = 23.60;
var tur_geo = geo_tur = 21.24;
var nld_geo = geo_nld = 35.40;
var pol_geo = pol_rus = geo_pol = rus_pol = 23.60;
var chn_geo = geo_chn = 35.40;
var aze_geo = geo_aze = 29.50;
var cze_geo = geo_cze = 35.40;
var are_geo = geo_are = 35.40;
var jpn_geo = geo_jpn = 70.80;



function get_translation_price()
{
  var from  = $('#from').val();
  var to    = $('#to').val();
  var price = 0; 
  
  if ((from != '') && (to != '') && (from != to))
  {
    eval("price=" + from + "_" + to);
  }
 
  $('#price').text(price);
  $('#price_description').show();
}



function favorite(id, on, off)
{
  $.ajax({
    type: 'POST',
    url: 'favorite_ajax.php?' + Math.random(),
    data: 'id=' + id + "&value=" + $('#' + id).val(),
    success: function(html)
	{
	  if ((html == "on") || (html == "off"))
	  {
		  
		if (html == "on") 
		{
	      $('#' + id + "_link").html(off);
		}
		else if (html == "off") 
		{
	      $('#' + id + "_link").html(on);
		}
		
	    $('#' + id).val(html);
		
		get_total_favorites();
	  }
    }
  });	
}



function get_total_favorites()
{
  $.ajax({
    type: 'POST',
    url: 'total_favorites_ajax.php?' + Math.random(),
    data: '',
    success: function(html)
	{
	  if (html >= 0)
	  {
	    $('#total_favorites').text('(' + html + ')');
	  }
    }
  });	
}



function is_int(evt)
{
  evt = (evt) ? evt : window.event;
  
  var charCode = (evt.which) ? evt.which : evt.keyCode;
  
  if (charCode > 31 && (charCode < 48 || charCode > 57))
  {
	return false;
  }
  
  return true;
}
  


