var currentHash = document.location.hash;
var loopcount = 0;
function load_tabs()
{
}
function check_tabs()
{
  //alert(currentHash);
  //alert(document.location.hash);
  var hash = document.location.hash;
  if (hash!=currentHash)
  {
    switch_tabs();
    currentHash = document.location.hash;
  }
}
function switch_tabs()
{
    hash = document.location.hash.slice(1);
    //alert(hash);
    var params = hash.split(',');
    //alert(params);
    for (i=0; i<params.length; i++)
    {
      param = params[i];
      tmp = param.split('=');
      key = tmp[0];
      value = tmp[1];
      //alert(param+':'+key+':'+value);
      var tabs_holder = document.getElementById(key);
      if (tabs_holder && tabs_holder.load)
      {
        if (value.substr(0,2)=='f.' && tabs_holder.custom)
        {
          var arg = value.substr(2);
          tabs_holder.custom(arg);
        }
        else if ((!tabs_holder.selected || tabs_holder.selected!=value) && document.getElementById(tabs_holder.id_prefix+value))
        {
          document.getElementById(tabs_holder.id_prefix+value).open();
        }
      }
    }
}
check_tabs();
//setInterval(check_tabs, 100);

