var ie    = (document.all) ? true : false;
var ns6   = (document.getElementById && !ie) ? true : false;
var ns    = (document.layers) ? true : false;

var doc_start = (ie) ? "document.all[" : (ns6) ? "document.getElementById(" : "document[";
var doc_end   = (ns6) ? ")" : "]";
var style     = (ie || ns6) ? ".style." : ".";

function supressError()
{
  return true;
}

//
// switch tabs
//
function showhide_tabcontent( tabname )
{
  window.onerror = supressError;
  switch ( tabname )
    {
    case 'tab0':
      // show tab0
      eval(doc_start + "'tab0_tab'" + doc_end + ".className = 'tabcontainer_activetab'");
      eval(doc_start + "'tab0'" + doc_end + style + "display = ''");

      eval(doc_start + "'tab1_tab'" + doc_end + ".className = 'tabcontainer_inactivetab'");
      eval(doc_start + "'tab1'" + doc_end + style + "display = 'none'");

      eval(doc_start + "'tab2_tab'" + doc_end + ".className = 'tabcontainer_inactivetab'");
      eval(doc_start + "'tab2'" + doc_end + style + "display = 'none'");
      break;

    case 'tab1':
      eval(doc_start + "'tab0_tab'" + doc_end + ".className = 'tabcontainer_inactivetab'");
      eval(doc_start + "'tab0'" + doc_end + style + "display = 'none'");

      eval(doc_start + "'tab1_tab'" + doc_end + ".className = 'tabcontainer_activetab'");
      eval(doc_start + "'tab1'" + doc_end + style + "display = ''");

      eval(doc_start + "'tab2_tab'" + doc_end + ".className = 'tabcontainer_inactivetab'");
      eval(doc_start + "'tab2'" + doc_end + style + "display = 'none'");
      break;

    case 'tab2':
      eval(doc_start + "'tab0_tab'" + doc_end + ".className = 'tabcontainer_inactivetab'");
      eval(doc_start + "'tab0'" + doc_end + style + "display = 'none'");

      eval(doc_start + "'tab1_tab'" + doc_end + ".className = 'tabcontainer_inactivetab'");
      eval(doc_start + "'tab1'" + doc_end + style + "display = 'none'");

      eval(doc_start + "'tab2_tab'" + doc_end + ".className = 'tabcontainer_activetab'");
      eval(doc_start + "'tab2'" + doc_end + style + "display = ''");
      break;

    }
}

//
// launch vod player
//
function open_player(id, s)
{
  // 06 Jul 2006 11:15:06 MLM - open VOD landing page
  //window.open( "/cc-common/videos_on_demand/", "vod", "location=no,menubar=no,resizeable,scrollbars");

  // 13 Dec 2006 14:34:50 MLM point main window instead
  window.location="/cc-common/videos_on_demand/";
   
  // open player
  window.open( "/cc-common/videos_on_demand/player.php?track_id=" + id + (s != null && s.length > 0 ? "&s=" + s : ""), "video_player", "location=no,menubar=no,width=727px,height=530px");
}

