var activeTabC1 = 'tab-0';
var activeTabC2 = 'tab-3';
var activeFrag = 'fragment-3';
var activeColorC1 = '#31b7d9';
var activeColorC2 = '#28a7d0';

$(document).ready(function(){
  $('#container-1').tabs();
  $('#container-2').tabs({ fxFade: true, fxSpeed: 'fast' });
  $('#img-'+activeTabC2).attr('class', 'arrow');
  //resizeIE();
});

function setActiveTabC1(tab) {
  activeTabC1 = tab;
  $('#'+activeTabC1).removeAttr('style');
}

function setActiveTabC2(tab, frag) {
  $('#'+activeTabC2).removeAttr('style');
  $('#img-'+activeTabC2).removeAttr('class');
  activeTabC2 = tab;
  activeFrag = frag;
  $('#'+activeTabC2).attr('style', 'background-color:'+activeColorC2);
  $('#img-'+activeTabC2).attr('class', 'arrow');
}

function loadTabContent(tab, pefid, prodid) {
  $('#container-2').tabsHref(tab, 'tab_content.php?pefid='+pefid+'&prodid='+prodid);
}

function chgTdBg(td, dir) {
  tab = $(td).attr('id');

  if(activeTabC1 != tab) {
    if(dir == 1) {
      $(td).attr('style', 'background-color:'+activeColorC1);
    }
    else if(dir == 0) {
      $(td).removeAttr('style');
    }
  }
}

function chgTdBgImg(td, dir) {
  tab = $(td).attr('id');

  if(activeTabC2 != tab) {
    if(dir == 1) {
      $(td).attr('style', 'background-color:'+activeColorC2);
      $('#a-'+tab).attr('class', 'over');
      $('#img-'+tab).attr('class', 'arrow');
    }
    else if(dir == 0) {
      $(td).removeAttr('style');
      $('#img-'+tab).removeAttr('class');
    }
  }
  
  if(dir == 0)
    $('#a-'+tab).removeAttr('class');
}

// ie-hack, um die hoehe anzupassen
function resizeIE() {
  //h = $('#'+activeFrag).height();
  //document.getElementById('container-2').style.height = (h+20)+'px';
  //$('#container-2').height(h+20);
  h = $('#Tabelle_01').height();
  alert('h:'+h);
  //bh = $(document).height();
  $('#bb').height(h);
  bh = $('#bb').height();
  alert('bh:'+bh);
}
