function togglediv(aid) {
  if(document.getElementById(aid).style.display=='none') {
    document.getElementById(aid).style.display = '';
  } else {
    document.getElementById(aid).style.display = 'none';
  }
}

function submitenter(myform,e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;

if (keycode == 13)
   {
    document.getElementById(myform).submit();
    return false;
   }
else
   return true;
}

function __alert(msg) 
{
  if(msg!='') alert(msg);
}
function order_delete(text_confirm, text_attention)
{
 if((document.getElementById('r1').checked ||
     document.getElementById('r2').checked ||
     document.getElementById('r3').checked ||
     document.getElementById('r4').checked ||
     document.getElementById('r5').checked
    ) || 
    (
      document.getElementById('r6').checked &&
      document.getElementById('otherreason').value!=''
    )
   )
   {
    return confirm(text_confirm);
   } else
   {
    alert(text_attention);
    return false;
   } 
}

function checkForInt(evt) {
var charCode = ( evt.which ) ? evt.which : event.keyCode;
return ( charCode >= 48 && charCode <= 57 );
}

function box_reload()
{
 document.getElementById('loader_div').style.display='';
 new Ajax.Updater('search_box', '/pages/search_box.php', {
  evalScripts:       true, 
  parameters : {
    tr_direction:      $F('tr_direction') 
   ,tr_pickup_country: $F('tr_pickup_country') 
   ,tr_pickup_place:   $F('tr_pickup_place') 
   ,tr_dest_place:     $F('tr_dest_place') 
   ,tr_oneway:         $F('tr_oneway') 

   ,tr_start_month:    $F('tr_start_month') 
   ,tr_start_day:      $F('tr_start_day') 
   ,tr_start_hour:     $F('tr_start_hour') 
   ,tr_start_min:      $F('tr_start_min') 
   ,tr_start_num:      $F('tr_start_num') 

   ,tr_ret_month:      $F('tr_ret_month') 
   ,tr_ret_day:        $F('tr_ret_day') 
   ,tr_ret_hour:       $F('tr_ret_hour') 
   ,tr_ret_min:        $F('tr_ret_min') 
   ,tr_ret_num:        $F('tr_ret_num') 
   ,money_type:        0 
   ,afpre:             $F('afpre') 
   ,language:          $F('language_') 
   ,partnercode:       $F('partnercode') 
  }
});
}

