function show_more_search_options() {
  $('div.search_options_more input#country_filter_originating_from').attr(
    'checked', $('div.search_options_less input#country_filter_originating_from').attr('checked'));
  $('div.search_options_more input#country_filter_available_in').attr(
    'checked', $('div.search_options_less input#country_filter_available_in').attr('checked'));

  $('div.search_options_more select#country').val($('div.search_options_less select#country').val());
  $('div.search_options_more select#language').val($('div.search_options_less select#language_').val());

  $('div.search_options_more input#free').attr('checked', $('div.search_options_less input#free').attr('checked'));
  $('div.search_options_more input#pay').attr('checked', $('div.search_options_less input#pay').attr('checked'));

  $('.search_options_less').toggle();
  $('.search_options_more').fadeIn('slow');

  return false;
}

function show_less_search_options() {
  $('div.search_options_less input#country_filter_originating_from').attr(
    'checked', $('div.search_options_more input#country_filter_originating_from').attr('checked'));
  $('div.search_options_less input#country_filter_available_in').attr(
    'checked', $('div.search_options_more input#country_filter_available_in').attr('checked'));

  $('div.search_options_less select#country').val($('div.search_options_more select#country').val());

  $('div.search_options_less input#free').attr('checked', $('div.search_options_more input#free').attr('checked'));
  $('div.search_options_less input#pay').attr('checked', $('div.search_options_more input#pay').attr('checked'));

  $('.search_options_less').fadeIn('slow');
  $('.search_options_more').toggle();

  return false;
}

$(document).ready(function() {
  $('a.morelink').click(function(){
    var div = 'div.' + $(this).next('div').attr('class');
    var box = $(div);

    box.css({'visibility':'hidden','display':'block'});
    var boxWidth = $(div + ' .left').outerWidth() +
                   $(div + ' .right').outerWidth() + 3;

    var posLeft = 290 - boxWidth;
    var posTop = $(this).position().top - 10;
    posTop += $(this).offsetParent().position().top;

    $(this).next('div').css({
      'width': boxWidth,
      'top': posTop,
      'left': posLeft,
      'display': 'none',
      'visibility': 'visible'
    });

    box.fadeIn('fast');
  });
});