$(function(){
 $(window).on('load resize',function(){
  var h = $('#plusc_subject .sg-head1');
  var p = 0;
  var s = 0;
  var q = 0;
  var d = 0;
  h.each(function(i,e){
   s = $(e).text().length;
   if(s > p){
    p = s;
   }
  });
  q = h.css('font-size');
  if(q != undefined){
   q = q.replace(/[^0-9]/g,'');
   d = h.css('padding-left');
   d = d.replace(/[^0-9]/g,'');
   h.css('flex-basis',(q*p)+(d*2)+1+'px');
  }
 });
});

$(function(){
 $(window).on('load resize',function(){
  var h = $('#plusc_subject .sg-head2');
  var p = 0;
  var s = 0;
  var q = 0;
  var d = 0;
  h.each(function(i,e){
   s = $(e).text().length;
   if(s > p){
    p = s;
   }
  });
  p = p;
  q = h.css('font-size');
  if(q != undefined){
   q = q.replace(/[^0-9]/g,'');
   d = h.css('padding-left');
   d = d.replace(/[^0-9]/g,'');
   h.css('flex-basis',(q*p)+(d*2)+1+'px');
  }

 });
});


$(function(){
 $(window).on('load',function(){
  var k = $('#plusc_subject_tab');
  var t = k.find('li');
  var p = $('#plusc_subject');
  var c = p.find('.subtab');
  var d = '';

  t.click(function(){
   d = $(this).data('tab');
   c.hide();
   p.find('#'+d).slideDown();

   t.css('opacity',0.4);
   $(this).css('opacity',1);

   return false;
  });

  $('#submenu1').css('opacity',1);
 });
});
