<script type="text/javascript">
  $( function() {
    disable_menu();

    $( '#settings-tabs' ).easyResponsiveTabs({
      width: 'auto',
      fit: true,
      tabidentify: 'settings-tabs',
      type: 'vertical'
    });

    $( '#languages-main' ).easyResponsiveTabs({
      width: 'auto',
      fit: true,
      tabidentify: 'languages-main'
    });

    $( '#languages-seo' ).easyResponsiveTabs({
      width: 'auto',
      fit: true,
      tabidentify: 'languages-seo'
    });
  });

  function generate_seo_links( lang, title, category_id )
  {
    if ( title === '' )
      return false;

    $.ajax({
      type: 'POST',
      cache: false,
      url: '/admin/pages/generateSeoLink/',
      data: {
        title: title,
        category_id: category_id
      },
      beforeSend: function() {
        $( '#overlay' ).show();
      },
      success: function( data ) {
        $( '#overlay' ).hide();

        var response = jQuery.parseJSON( data );

        if ( response.status === 'ok' )
          $( '#seo_link_' + lang ).val( response.seo_link );
        else
          create_error( response.msg );
      }
    });
  }
</script>
