$(document).ready(function(){
  $(window).resize(function (){
    var w = $(this).width();
    
    if(w<1000) {$('#mainwidth').css('width', '1000px');} else
      if(w>1235) {$('#mainwidth').css('width', '1235px');} else {$('#mainwidth').css('width', w+'px');}
   // if(w-$('#mainwidth').width()>0) $('.w10').show(); else $('.w10').hide();
    
    //$('.w10').hide();
    $.cookie('lastwidth', $('#mainwidth').width(), {expires: 300});
    
    
    $('.scl').each(function (){
      var stris  = '<div class="odin12"><img src="./images/dummy.gif" width="1" height="12" alt=""></div>';
      var strib  = '<div class="odin14"><img src="./images/dummy.gif" width="1" height="14" alt=""></div>';
      var stribb = '<div class="odin25"><img src="./images/dummy.gif" width="1" height="25" alt=""></div>';
      var idd = $(this).attr('idd');
      var cr = 12;
      var wi = $(this).width();
      var rz = Math.floor(wi/cr);
      var nw = (rz*12);
      var insrt = stribb;
      for(var i=1; i<=(rz); i++) {if(i==rz) insrt = insrt+strib; else insrt = insrt+strib+stris;}
      $('#scl'+idd).css('width', nw+'px');
      $('#scl'+idd).html(insrt);
      //$('#scl'+idd).html(nw);
    });
    
  });
  $(window).resize();
});
