

$(document).ready(function() {

//  console.log("WINDOW WIDTH: " + $(window).width());
  if ($(window).width() < 1200) {
    $("#ad1-sub").html($("#ad-1").html()).addClass('adbox').show();
    $("#ad-1").hide();
    $("#ad2-sub").html($("#ad-2").html()).addClass('adbox').show();
    $("#ad-2").hide();
    $(".ad-2-br").remove();
  }
  else {
    $("#ad-1").css({
      "position": "fixed",
      "left": $("#ad-1").get(0).offsetParent.offsetLeft-$("#ad-1").width()-16,
      "top": $("#ad-1").get(0).offsetParent.offsetTop+$("#ad-1").get(0).offsetTop
    });
    $("#ad-2").css({
      "position": "fixed",
      "left": $("#ad-2").get(0).offsetParent.offsetLeft+$("#ad-2").get(0).offsetLeft,
      "top": $("#ad-2").get(0).offsetParent.offsetTop+$("#ad-2").get(0).offsetTop
    });
  }
  
  $(".tab-box h2 a").click(function(e) {
    e.preventDefault();
    //alert('ok');
    $(".tb-tb", $(this).parent().parent()).removeClass('tb-on');
    $("h2", $(this).parent().parent()).removeClass('tb-hon');
    var cl = $(this).parent().attr('class');
    $("#" + cl, $(this).parent().parent()).addClass('tb-on');
    $("." + cl, $(this).parent().parent()).addClass('tb-hon');
    $(this).blur();
  });
  
});
